mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 16:52:57 +00:00
Refine Pandoc button color logic
This commit is contained in:
parent
9cacdf7141
commit
ec0c783cfc
@ -4,7 +4,7 @@
|
||||
<MudJustifiedText Typo="Typo.body1">
|
||||
@this.DetermineIntroText()
|
||||
</MudJustifiedText>
|
||||
<MudButton Color="Color.Default" Variant="Variant.Filled" OnClick="() => this.ShowPandocDialogAsync()">
|
||||
<MudButton Color="@this.DetermineButtonColor()" Variant="Variant.Filled" OnClick="() => this.ShowPandocDialogAsync()">
|
||||
@this.DetermineButtonText()
|
||||
</MudButton>
|
||||
</MudStack>
|
@ -30,6 +30,24 @@ public partial class ManagePandocDependency : MSGComponentBase
|
||||
|
||||
#endregion
|
||||
|
||||
private Color DetermineButtonColor()
|
||||
{
|
||||
if (this.pandocInstallation == default)
|
||||
return Color.Default;
|
||||
|
||||
switch (this.pandocInstallation)
|
||||
{
|
||||
case { CheckWasSuccessful: true, IsAvailable: true }:
|
||||
return Color.Default;
|
||||
|
||||
case { CheckWasSuccessful: true, IsAvailable: false }:
|
||||
return Color.Warning;
|
||||
|
||||
case { CheckWasSuccessful: false }:
|
||||
return Color.Error;
|
||||
}
|
||||
}
|
||||
|
||||
private string DetermineButtonText()
|
||||
{
|
||||
if(this.pandocInstallation == default)
|
||||
|
Loading…
Reference in New Issue
Block a user