mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 11:39:48 +00:00
37 lines
968 B
C#
37 lines
968 B
C#
|
using Microsoft.AspNetCore.Components;
|
|||
|
|
|||
|
namespace AIStudio.Dialogs;
|
|||
|
|
|||
|
public partial class PandocDialog : ComponentBase
|
|||
|
{
|
|||
|
[CascadingParameter]
|
|||
|
private IMudDialogInstance MudDialog { get; set; } = null!;
|
|||
|
|
|||
|
private bool isPandocAvailable;
|
|||
|
private bool showSkeleton;
|
|||
|
private bool showInstallPage;
|
|||
|
|
|||
|
|
|||
|
#region Overrides of ComponentBase
|
|||
|
|
|||
|
protected override async Task OnInitializedAsync()
|
|||
|
{
|
|||
|
await base.OnInitializedAsync();
|
|||
|
this.showSkeleton = true;
|
|||
|
await this.CheckPandocAvailabilityAsync();
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
private void Cancel() => this.MudDialog.Cancel();
|
|||
|
|
|||
|
private async Task CheckPandocAvailabilityAsync()
|
|||
|
{
|
|||
|
await Task.Delay(2500);
|
|||
|
this.isPandocAvailable = await Pandoc.CheckAvailabilityAsync();
|
|||
|
this.showSkeleton = false;
|
|||
|
await this.InvokeAsync(this.StateHasChanged);
|
|||
|
}
|
|||
|
|
|||
|
private void ProceedToInstallation() => this.showInstallPage = true;
|
|||
|
}
|