mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 01: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">
|
<MudJustifiedText Typo="Typo.body1">
|
||||||
@this.DetermineIntroText()
|
@this.DetermineIntroText()
|
||||||
</MudJustifiedText>
|
</MudJustifiedText>
|
||||||
<MudButton Color="Color.Default" Variant="Variant.Filled" OnClick="() => this.ShowPandocDialogAsync()">
|
<MudButton Color="@this.DetermineButtonColor()" Variant="Variant.Filled" OnClick="() => this.ShowPandocDialogAsync()">
|
||||||
@this.DetermineButtonText()
|
@this.DetermineButtonText()
|
||||||
</MudButton>
|
</MudButton>
|
||||||
</MudStack>
|
</MudStack>
|
@ -30,6 +30,24 @@ public partial class ManagePandocDependency : MSGComponentBase
|
|||||||
|
|
||||||
#endregion
|
#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()
|
private string DetermineButtonText()
|
||||||
{
|
{
|
||||||
if(this.pandocInstallation == default)
|
if(this.pandocInstallation == default)
|
||||||
|
Loading…
Reference in New Issue
Block a user