Neighbourhood.omg.lol/Components/Pages/Person.razor

50 lines
1.1 KiB
Text

@page "/person/{Address}"
<div class="row center-align">
<h3><i class="fa-solid fa-fw fa-at"></i>@Address</h3>
</div>
<div class="row center-align">
<img class="profile avatar" src="https://profiles.cache.lol/@Address/picture" alt="@Address" />
</div>
<div id="bio" class="center-align max">
@if (bio == null)
{
<p><em>Getting Bio...</em></p>
}
else {
@bio
}
</div>
@if (statuses == null) {
<p><em>Loading Statuses...</em></p>
}
else {
<div id="statuses">
@foreach (var status in statuses) {
<StatusCard status="@status"></StatusCard>
}
</div>
}
@code {
[Parameter]
public string Address { get; set; }
private Status[]? statuses;
private MarkupString? bio;
protected override async Task OnInitializedAsync() {
RestService api = new RestService();
await GetBioAsync(api);
// GetStatusesAsync(api);
}
private async Task GetStatusesAsync(RestService api) {
statuses = (await api.Statuslog(Address)).ToArray();
}
private async Task GetBioAsync(RestService api) {
bio = await api.StatuslogBio(Address);
}
}