@using Iceshrimp.Frontend.Core.Miscellaneous @using Iceshrimp.Frontend.Core.Services @using Iceshrimp.Shared.Schemas.Web @inject ApiService Api; @inject ILogger Logger; @inject NavigationManager Nav; @if (State is State.Loaded) {
@if (RenotedBy != null) @foreach (var el in RenotedBy) {
@el.DisplayName
@@@el.Username@(el.Host != null ? $"@{el.Host}" : "")
}
} @if (State is State.Loading) { Loading } @if (State is State.Error) { Failed to load } @code { [Parameter, EditorRequired] public required string NoteId { get; set; } private State State { get; set; } private List? RenotedBy { get; set; } = []; protected override async Task OnInitializedAsync() { try { RenotedBy = await Api.Notes.GetRenotes(NoteId); State = State.Loaded; } catch (ApiException e) { Logger.LogError(e, "Failed to load likes"); State = State.Error; } } private void OpenProfile(string username, string? host) { var path = $"@{username}"; if (host != null) { path += $"@{host}"; } Nav.NavigateTo($"/{path}"); } }