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

51 lines
1.1 KiB
Text
Raw Normal View History

2024-05-30 01:06:08 +00:00
@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>
2024-05-30 01:06:08 +00:00
<div id="bio" class="center-align max">
@if (bio == null)
{
<p><em>Getting Bio...</em></p>
}
else {
@bio
}
</div>
2024-05-30 01:06:08 +00:00
@if (statuses == null) {
<p><em>Loading Statuses...</em></p>
2024-05-30 01:06:08 +00:00
}
else {
<div id="statuses">
@foreach (var status in statuses) {
<StatusCard status="@status"></StatusCard>
2024-05-30 01:06:08 +00:00
}
</div>
}
@code {
[Parameter]
public string Address { get; set; }
private Status[]? statuses;
private MarkupString? bio;
2024-05-30 01:06:08 +00:00
protected override async Task OnInitializedAsync() {
RestService api = new RestService();
await GetBioAsync(api);
// GetStatusesAsync(api);
}
private async Task GetStatusesAsync(RestService api) {
2024-05-30 01:06:08 +00:00
statuses = (await api.Statuslog(Address)).ToArray();
}
private async Task GetBioAsync(RestService api) {
2024-05-30 01:06:08 +00:00
bio = await api.StatuslogBio(Address);
}
}