@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 (LikedBy != null) @foreach (var el in LikedBy) { }
} @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? LikedBy { get; set; } = []; protected override async Task OnInitializedAsync() { try { LikedBy = await Api.Notes.GetNoteLikes(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}"); } }