@namespace Lumeo

@if (Context.ActiveItemId is not null)
{
    <div class="@CssClass" @attributes="AdditionalAttributes">
        <div class="@InnerCssClass">
            @ChildContent
        </div>
    </div>
}

@code {
    [CascadingParameter] public NavigationMenu.NavigationMenuContext Context { get; set; } = default!;
    [Parameter] public RenderFragment? ChildContent { get; set; }
    [Parameter] public string? Class { get; set; }
    [Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object>? AdditionalAttributes { get; set; }

    private string CssClass => $"absolute left-0 top-full flex justify-center {Class}".Trim();

    private string InnerCssClass => "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-lg animate-fade-in";
}
