@page "/" @using Markdig @inject HttpClient Http @inject BreadcrumbsStateContainer BreadcrumbsStateContainer
@if (isLoading) { } else {
@((MarkupString)markdownContent)
}
@code { private string markdownContent = string.Empty; private bool isLoading = true; protected override async Task OnInitializedAsync() { var pipeline = new MarkdownPipelineBuilder() .UseAdvancedExtensions() .UseEmojiAndSmiley() .Build(); try { var markdown = await Http.GetStringAsync("Dashboard.md"); if (!string.IsNullOrWhiteSpace(markdown)) { markdownContent = Markdown.ToHtml(markdown, pipeline); } } catch (HttpRequestException) { markdownContent = "Error loading dashboard content."; } isLoading = false; BreadcrumbsStateContainer.breadcrumbs.Clear(); BreadcrumbsStateContainer.breadcrumbs.Add(new BreadcrumbItem(Localizer["Dashboard"], href: "/")); BreadcrumbsStateContainer.NotifyStateChanged(); } }