@using LibMatrix.Helpers @using LibMatrix.EventTypes.Spec.State @using LibMatrix.Homeservers
@User?.DisplayName
@if (ChildContent is not null) { @ChildContent }
@code { [Parameter] public RenderFragment? ChildContent { get; set; } [Parameter] public ProfileResponseEventContent? User { get; set; } [Parameter] public string UserId { get; set; } private AuthenticatedHomeserverGeneric _homeserver = null!; protected override async Task OnInitializedAsync() { _homeserver = await MRUStorage.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(); } }