+
+ Back
+
+
+ @if (isLoading)
+ {
+ Loading...
+ }
+ else
+ {
+ @if (post != null)
+ {
+ @post.Title
+
+ @if (!string.IsNullOrEmpty(post.Author))
+ {
+ @post.Author
+ }
+ @if (!string.IsNullOrEmpty(post.Date_published) && post.Date_published.Length >= 10)
+ {
+ ยท @post.Date_published[..10]
+ }
+
+ }
+
+ @if (htmlContent != null)
+ {
+
+ @((MarkupString)htmlContent)
+
+ }
+ else
+ {
+ Content not available.
+ }
+ }
+
+
+@code {
+ [Parameter]
+ public string PostId { get; set; } = string.Empty;
+
+ private Post? post;
+ private string? htmlContent;
+ private bool isLoading = true;
+
+ protected override async Task OnInitializedAsync()
+ {
+ var postTask = DataService.GetPost(PostId);
+ var htmlTask = DataService.GetPostHtmlAsync(PostId);
+
+ await Task.WhenAll(postTask, htmlTask);
+
+ post = await postTask;
+ htmlContent = await htmlTask;
+ isLoading = false;
+ }
+}
diff --git a/src/NoteBookmark.SharedUI/Components/Pages/Posts.razor b/src/NoteBookmark.SharedUI/Components/Pages/Posts.razor
index 18e7eca..697b5b1 100644
--- a/src/NoteBookmark.SharedUI/Components/Pages/Posts.razor
+++ b/src/NoteBookmark.SharedUI/Components/Pages/Posts.razor
@@ -8,6 +8,7 @@
@inject IToastService toastService
@inject IDialogService DialogService
@inject NavigationManager Navigation
+@inject ILocalHtmlCache localHtmlCache