@using LibMatrix.Helpers
@using LibMatrix.EventTypes.Spec.State
@using LibMatrix.Homeservers
@using LibMatrix.Responses
@User?.DisplayName
@if (ChildContent is not null) {
@ChildContent
}
@code {
[Parameter]
public RenderFragment? ChildContent { get; set; }
[Parameter]
public UserProfileResponse? User { get; set; }
[Parameter]
public string UserId { get; set; }
private AuthenticatedHomeserverGeneric _homeserver = null!;
protected override async Task OnInitializedAsync() {
_homeserver = await RMUStorage.GetCurrentSessionOrNavigate();
if (_homeserver is null) return;
if (User == null) {
if (UserId == null) {
throw new ArgumentNullException(nameof(UserId));
}
User = await _homeserver.GetProfileAsync(UserId);
}
await base.OnInitializedAsync();
}
}