@typeparam TItem
@if (items == null)
{
@Loading
}
else if (!items.Any())
{
@Empty
}
else
{
@foreach (var item in items)
{
@Item(item)
}
}
@code {
IEnumerable items;
[Parameter] public Func>> Loader { get; set; }
[Parameter] public RenderFragment Loading { get; set; }
[Parameter] public RenderFragment Empty { get; set; }
[Parameter] public RenderFragment Item { get; set; }
[Parameter] public string ListGroupClass { get; set; }
protected override async Task OnParametersSetAsync()
{
items = await Loader();
}
}