@namespace LumexUI.Docs.Client.Components

@if( Status.HasValue )
{
    <span class="@RootClasses">
        @Status.ToString()
    </span>
}

@code {
    [Parameter] public ComponentStatus? Status { get; set; }

    private string? RootClasses => ElementClass.Empty()
        .Add( "px-1.5" )
        .Add( "py-[3px]" )
        .Add( "rounded-full" )
        .Add( "ring-1" )
        .Add( "font-semibold" )
        .Add( "text-[0.5rem]" )
        .Add( "uppercase" )
        .Add( "leading-none" )
        .Add( _variants[Status!.Value], when: Status.HasValue )
        .ToString();

    private static readonly Dictionary<ComponentStatus, string> _variants = new()
    {
        [ComponentStatus.New] = "bg-orange-100 ring-orange-300 text-orange-600",
        [ComponentStatus.Soon] = "bg-foreground-100 ring-foreground-300 text-foreground-600",
        [ComponentStatus.Preview] = "bg-indigo-50 ring-indigo-200 text-indigo-500"
    };
}
