27 lines
No EOL
848 B
Text
27 lines
No EOL
848 B
Text
@using Iceshrimp.Shared.Schemas.Web
|
|
@inject NavigationManager Nav
|
|
|
|
@if (Indented == false)
|
|
{
|
|
<img @onclick="OpenProfile" class="user-avatar" src="@(User.AvatarUrl ?? $"/identicon/{User.Id}")" alt="@(User.DisplayName ?? User.Username)" role="link"/>
|
|
}
|
|
<div class="name-section">
|
|
<span class="display-name"><UserDisplayName User="@User"/></span>
|
|
<span class="identifier">@@@User.Username@(User.Host != null ? $"@{User.Host}" : "")</span>
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter] [EditorRequired] public required UserResponse User { get; set; }
|
|
[Parameter] [EditorRequired] public required bool Indented { get; set; }
|
|
|
|
private void OpenProfile()
|
|
{
|
|
var path = $"@{User.Username}";
|
|
if (User.Host?.Length > 0)
|
|
{
|
|
path += $"@{User.Host}";
|
|
}
|
|
|
|
Nav.NavigateTo($"/{path}");
|
|
}
|
|
} |