@Message.User.UserName

@Message.User.DisplayName @Message.User.UserName @Message.CreatedAt.GetPassedTime(CascadingState.Localizer)

@if (Message.Title is { Length: > 0 }) {

@Message.Title

} @if (Message.Content is { Length: > 0 }) {
@((MarkupString)Message.Content)
} @if (Message.Medias.Count != 0) {
@foreach (var media in Message.Medias) { if (media.ContentType.StartsWith("image")) { @media.AltText } else if (media.ContentType.StartsWith("video")) { } else if (media.ContentType.StartsWith("audio")) { } else {

@media.FileName

@media.ContentType

} }
}
@if (OnMessageReply.HasDelegate) { } @if (OnMessageBoost.HasDelegate) { } @if (OnMessageFavourite.HasDelegate) { }
@if (OnUserDirectMessage.HasDelegate) { } @if (OnUserSilence.HasDelegate) { } @if (OnUserBlock.HasDelegate) { } @if (@*Message.User.UserName == CurrentUserName &&*@ OnMessageDelete.HasDelegate) { } @if (IncludeExpand) { }
@if (isAnswering) { }
@code { [CascadingParameter] Task AuthState { get; set; } [CascadingParameter] CascadingState CascadingState { get; set; } [Parameter] public Message Message { get; set; } = new(); [Parameter] public EventCallback OnMessageReply { get; set; } [Parameter] public EventCallback OnMessageBoost { get; set; } [Parameter] public EventCallback OnMessageFavourite { get; set; } [Parameter] public EventCallback OnMessageDelete { get; set; } [Parameter] public EventCallback OnUserDirectMessage { get; set; } [Parameter] public EventCallback OnMessageMediaDownload { get; set; } [Parameter] public EventCallback OnUserBlock { get; set; } [Parameter] public EventCallback OnUserSilence { get; set; } [Parameter] public string CssContainer { get; set; } [Parameter] public bool IncludeExpand { get; set; } = true; bool isAnswering { get; set; } = false; string CurrentUserName { get { return AuthState.Result.User.Identity?.Name; } } async Task DeleteMessage() { isAnswering = false; await OnMessageDelete.InvokeAsync(Message); } async Task SubmitReply(MessageForm messageForm) { isAnswering = false; await OnMessageReply.InvokeAsync(messageForm); } async Task Reply() { await Task.Run(() => { }); isAnswering = !isAnswering; } }