Iceshrimp.NET/Iceshrimp.Frontend/Components/TimelineNote.razor

34 lines
No EOL
1.1 KiB
Text

@* ReSharper disable once RedundantUsingDirective *@
@using Iceshrimp.Frontend.Components.Note
@using Iceshrimp.Shared.Schemas.Web
@inject NavigationManager Navigation
@if (Note.Filtered is { Hide: true }) { }
else
{
<div class="note-container" id="@Note.Id">
@if (Note.Reply is not null)
{
<div class="ancestor-wrapper" @onclick="() => OpenNote(Note.Reply.Id)">
<div class="note-indent">
<img class="user-avatar" src="@Note.Reply.User.AvatarUrl"/>
<Line></Line>
</div>
<div class="note">
<NoteComponent Note="Note.Reply" Indented="true" AsQuote="true"/>
</div>
</div>
}
<div class="link-wrapper" @onclick="() => OpenNote(Note.RenoteId ?? Note.Id)">
<Note NoteResponse="Note"/>
</div>
</div>
}
@code {
[Parameter] [EditorRequired] public required NoteResponse Note { get; set; }
private void OpenNote(string id)
{
Navigation.NavigateTo($"/notes/{id}");
}
}