@inject ApiService Api;
@using Iceshrimp.Frontend.Core.Services
@using Iceshrimp.Shared.Schemas.Web
@inject NavigationManager NavigationManager;
@if (UserProfile != null)
{
}
@code {
[Parameter] [EditorRequired] public required UserResponse User { get; set; }
private UserProfileResponse? UserProfile { get; set; }
[Parameter] public bool ShowBio { get; set; } = true;
protected override async Task OnInitializedAsync()
{
UserProfile = await Api.Users.GetUserProfile(User.Id);
}
private void Open()
{
var username = $"@{User.Username}";
if (User.Host != null) username += $"@{User.Host}";
NavigationManager.NavigateTo($"/{username}");
}
}