@namespace Lumeo

<div id="@LabelId" class="@CssClass" @attributes="AdditionalAttributes">
    @ChildContent
</div>

@code {
    [CascadingParameter] public SelectGroup.SelectGroupContext? GroupContext { get; set; }
    [Parameter] public RenderFragment? ChildContent { get; set; }
    [Parameter] public string? Class { get; set; }
    [Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object>? AdditionalAttributes { get; set; }

    private string LabelId => GroupContext?.LabelId ?? $"select-label-{Guid.NewGuid():N}";

    private string CssClass => $"px-2 py-1.5 text-sm font-semibold {Class}".Trim();
}
