@using BlazorApp.Data;

@typeparam TItem

@* Template component *@
@* Render fragment로 이루어진 Razor component *@

<table class="table">
    <thead>
        <tr>
            @this.Header
        </tr>
    </thead>
    <tbody>
        @foreach (var item in this.Items)
        {
            <tr>
                @this.Row(item)
            </tr>
        }
    </tbody>
</table>

@code {
    [Parameter]
    public RenderFragment Header { get; set; }

    [Parameter]
    public RenderFragment<TItem> Row { get; set; }

    [Parameter]
    public IReadOnlyList<TItem> Items { get; set; }
}
