@namespace LumexUI.Docs.Client.Components
@rendermode InteractiveWebAssembly

<LumexNavbar Sticky="@true"
             Bordered="@true"
             MaxWidth="@MaxWidth.XLarge"
             Classes="@_navbarClasses">
    <LumexNavbarBrand>
        <LumexLink Href="/"
                   Class="font-bold text-xl text-foreground-900">
            Lumex<span class="font-normal">UI</span>
        </LumexLink>
    </LumexNavbarBrand>

    <LumexNavbarContent Align="@Align.End" Class="hidden sm:flex">
        @foreach( var item in _navItems )
        {
            <LumexNavbarItem>
                <LumexLink Href="@item.Link"
                           Color="@ThemeColor.None"
                           Class="hover:text-orange-500 data-[active=true]:text-orange-500">
                    @item.Name
                </LumexLink>
            </LumexNavbarItem>
        }

        <LumexNavbarItem Class="h-full">
            <LumexDivider Orientation="@Orientation.Vertical" />
        </LumexNavbarItem>
        @_headerActions
    </LumexNavbarContent>

    <LumexNavbarContent Align="@Align.End" Class="sm:hidden gap-4">
        @_headerActions
        <LumexNavbarMenuToggle Class="sm:hidden" />
    </LumexNavbarContent>

    <LumexNavbarMenu Class="pt-0 pb-10 sm:hidden">
        <NavMenu />
    </LumexNavbarMenu>
</LumexNavbar>

@code {
    private static RenderFragment _headerActions =
    @<text>
        <LumexNavbarItem Class="flex">
            <LumexLink Href="https://github.com/LumexUI/lumexui"
                       External="@true"
                       Class="text-foreground-400 hover:text-foreground-600">
                <LumexIcon Icon="@Icons.Brands.GitHub" viewBox="0 0 24 24" />
            </LumexLink>
        </LumexNavbarItem>
    </text>;

    private readonly NavbarSlots _navbarClasses = new()
        {
            Wrapper = "py-5 gap-6"
        };

    private readonly NavItem[] _navItems = new NavItem[]
    {
        new("/", "Docs"),
        new("/docs/components", "Components"),
    };

    private record NavItem( string Link, string Name );
}
