Neighbourhood.omg.lol/Components/StatusList.razor

23 lines
654 B
Text

@inject State State
<Virtualize ItemsProvider="GetStatuses" Context="status" ItemSize="180">
<ItemContent>
<StatusCard status="@status"></StatusCard>
</ItemContent>
<Placeholder>
<StatusCardSkeleton></StatusCardSkeleton>
</Placeholder>
</Virtualize>
@code {
[Parameter]
public Func<ItemsProviderRequest, ValueTask<ItemsProviderResult<Status>>> StatusFunc { get; set; }
private async ValueTask<ItemsProviderResult<Status>> GetStatuses(ItemsProviderRequest request) {
return await this.StatusFunc(request);
}
protected override void OnInitialized() {
base.OnInitialized();
State.CurrentPage = Page.Status;
}
}