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

50 lines
1.2 KiB
Text
Raw Normal View History

2024-05-30 01:06:08 +00:00
@page "/person/{Address}"
<h3><i class="fa-solid fa-fw fa-at"></i>@Address</h3>
<img class="pfp" src="https://profiles.cache.lol/@Address/picture" alt="@Address" />
@if (statuses == null) {
<p><em>Loading...</em></p>
}
else {
<div id="bio">
@bio
</div>
<div id="statuses">
@foreach (var status in statuses) {
<article class="status">
<aside class="emoji">
@status.Emoji
</aside>
<p class="author">
<a href="/person/@status.Address">
<i class="fa-solid fa-fw fa-at"></i>@status.Address
</a>
</p>
@status.HtmlContent
<small class="post-info">
<i class="fa fa-clock"></i> @status.RelativeTime
@if (!string.IsNullOrEmpty(status.ExternalUrl)) {
<i class="fa fa-message-dots"></i>
<a href="@status.ExternalUrl">Respond</a>
}
</small>
</article>
}
</div>
}
@code {
[Parameter]
public string Address { get; set; }
private Status[]? statuses;
private MarkupString bio;
protected override async Task OnInitializedAsync() {
RestService api = new RestService();
statuses = (await api.Statuslog(Address)).ToArray();
bio = await api.StatuslogBio(Address);
}
}