mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-13 21:21:36 +00:00
Added a Markdown preview
This commit is contained in:
parent
e753b9a2a7
commit
85ebc92b89
@ -27,20 +27,39 @@
|
||||
/>
|
||||
}
|
||||
|
||||
<MudTextField
|
||||
T="string"
|
||||
@bind-Text="@this.FileContent"
|
||||
AdornmentIcon="@Icons.Material.Filled.Article"
|
||||
Adornment="Adornment.Start"
|
||||
Immediate="@true"
|
||||
Label="@T("Loaded Content")"
|
||||
Variant="Variant.Outlined"
|
||||
Lines="6"
|
||||
AutoGrow="@true"
|
||||
MaxLines="25"
|
||||
Class="mt-10"
|
||||
ReadOnly="true"
|
||||
HelperText="@T("This is the content we loaded from your file — including headings, lists, and formatting. Use this to verify your file loads as expected.")"/>
|
||||
<MudTabs Elevation="0" Rounded="true" ApplyEffectsToContainer="true" Outlined="true" PanelClass="pa-2" Class="mb-2">
|
||||
<MudTabPanel Text="@T("Markdown View")" Icon="@Icons.Material.Filled.TextSnippet">
|
||||
<MudField
|
||||
Variant="Variant.Outlined"
|
||||
AdornmentIcon="@Icons.Material.Filled.Article"
|
||||
Adornment="Adornment.Start"
|
||||
Label="@T("Loaded Content")"
|
||||
FullWidth="true"
|
||||
Class="ma-2 pe-4"
|
||||
HelperText="@T("This is the content we loaded from your file — including headings, lists, and formatting. Use this to verify your file loads as expected.")"
|
||||
>
|
||||
<div style="max-height: 40vh; overflow-y: auto;">
|
||||
<MudMarkdown Value="@this.FileContent" Props="Markdown.DefaultConfig" Styling="@this.MarkdownStyling"/>
|
||||
</div>
|
||||
</MudField>
|
||||
</MudTabPanel>
|
||||
<MudTabPanel Text="@T("Raw View")" Icon="@Icons.Material.Filled.Terminal">
|
||||
<MudTextField
|
||||
T="string"
|
||||
@bind-Text="@this.FileContent"
|
||||
AdornmentIcon="@Icons.Material.Filled.Article"
|
||||
Adornment="Adornment.Start"
|
||||
Immediate="@true"
|
||||
Label="@T("Loaded Content")"
|
||||
Variant="Variant.Outlined"
|
||||
Lines="6"
|
||||
AutoGrow="@true"
|
||||
MaxLines="25"
|
||||
ReadOnly="true"
|
||||
Class="ma-2"
|
||||
HelperText="@T("This is the content we loaded from your file — including headings, lists, and formatting. Use this to verify your file loads as expected.")"/>
|
||||
</MudTabPanel>
|
||||
</MudTabs>
|
||||
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
|
||||
@ -38,4 +38,11 @@ public partial class DocumentCheckDialog : MSGComponentBase
|
||||
this.StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private CodeBlockTheme CodeColorPalette => this.SettingsManager.IsDarkMode ? CodeBlockTheme.Dark : CodeBlockTheme.Default;
|
||||
|
||||
private MudMarkdownStyling MarkdownStyling => new()
|
||||
{
|
||||
CodeBlock = { Theme = this.CodeColorPalette },
|
||||
};
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user