mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-14 23:21:36 +00:00
Added a Markdown preview
This commit is contained in:
parent
e753b9a2a7
commit
85ebc92b89
@ -27,6 +27,23 @@
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<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
|
<MudTextField
|
||||||
T="string"
|
T="string"
|
||||||
@bind-Text="@this.FileContent"
|
@bind-Text="@this.FileContent"
|
||||||
@ -38,9 +55,11 @@
|
|||||||
Lines="6"
|
Lines="6"
|
||||||
AutoGrow="@true"
|
AutoGrow="@true"
|
||||||
MaxLines="25"
|
MaxLines="25"
|
||||||
Class="mt-10"
|
|
||||||
ReadOnly="true"
|
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.")"/>
|
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>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
|
|||||||
@ -38,4 +38,11 @@ public partial class DocumentCheckDialog : MSGComponentBase
|
|||||||
this.StateHasChanged();
|
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