You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
604 B
28 lines
604 B
@typeparam TItem
|
|
@using System.Diagnostics.CodeAnalysis
|
|
|
|
<table class="table">
|
|
<thead>
|
|
<tr>@TableHeader</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in Items)
|
|
{
|
|
if (RowTemplate is not null)
|
|
{
|
|
<tr>@RowTemplate(item)</tr>
|
|
}
|
|
}
|
|
</tbody>
|
|
</table>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public RenderFragment? TableHeader { get; set; }
|
|
|
|
[Parameter]
|
|
public RenderFragment<TItem>? RowTemplate { get; set; }
|
|
|
|
[Parameter, AllowNull]
|
|
public IReadOnlyList<TItem> Items { get; set; }
|
|
} |