<span class="@BuildCssClass()">
    <span class="ui-status-indicator-dot" aria-hidden="true"></span>
    @if (ChildContent is not null)
    {
        <span class="ui-status-indicator-label">@ChildContent</span>
    }
</span>

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

    [Parameter]
    public string Tone { get; set; } = "neutral";

    [Parameter]
    public string? CssClass { get; set; }

    private string BuildCssClass()
    {
        var classes = new List<string> { "ui-status-indicator", $"is-{Tone.Trim().ToLowerInvariant()}" };
        if (!string.IsNullOrWhiteSpace(CssClass))
        {
            classes.Add(CssClass);
        }

        return string.Join(' ', classes);
    }
}
