@namespace Lumeo
@typeparam TItem

<tr class="@CssClass" @attributes="AdditionalAttributes">
    <td colspan="@ColSpan" class="p-4">
        @if (DetailTemplate is not null)
        {
            @DetailTemplate(Item)
        }
    </td>
</tr>

@code {
    [Parameter] public TItem Item { get; set; } = default!;
    [Parameter] public RenderFragment<TItem>? DetailTemplate { get; set; }
    [Parameter] public int ColSpan { get; set; } = 1;
    [Parameter] public string? Class { get; set; }
    [Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object>? AdditionalAttributes { get; set; }

    private string CssClass => $"bg-muted/20 {Class}".Trim();
}
