1
0
mirror of synced 2024-12-20 02:15:56 +01:00
TaikoLocalServer/TaikoWebUI/Pages/Dashboard.razor
2024-06-05 23:19:14 -04:00

40 lines
1013 B
Plaintext

@page "/"
@inject HttpClient Http
@using Markdig
<MudText Typo="Typo.h4">@Localizer["Dashboard"]</MudText>
<MudGrid Class="my-8">
<MudItem xs="12">
<MudPaper Elevation="0" Outlined="true">
<div class="markdown-container">
@if (isLoading)
{
<MudCircularProgress />
}
else
{
<div class="markdown-content">
@((MarkupString)markdownContent)
</div>
}
</div>
</MudPaper>
</MudItem>
</MudGrid>
@code {
private string markdownContent = string.Empty;
private bool isLoading = true;
protected override async Task OnInitializedAsync()
{
var markdown = await Http.GetStringAsync("Dashboard.md");
if (!string.IsNullOrWhiteSpace(markdown))
{
markdownContent = Markdown.ToHtml(markdown);
}
isLoading = false;
}
}