import { Link, usePage } from '@inertiajs/react'; import { LayoutGrid } from 'lucide-react'; import { portalNavigation } from '@/lib/portal-navigation'; import AppLogo from '@/components/app-logo'; import { NavMain } from '@/components/nav-main'; import { NavUser } from '@/components/nav-user'; import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, } from '@/components/ui/sidebar'; import { dashboard } from '@/routes'; import type { Auth } from '@/types'; export function AppSidebar() { const { auth, existingBusinessEnabled, educationEnabled, aiEnabled } = usePage<{ auth: Auth; existingBusinessEnabled?: boolean; educationEnabled?: boolean; aiEnabled?: boolean; }>().props; const groups = portalNavigation({ authenticated: !!auth.user, manager: auth.canManagePortal, businesses: existingBusinessEnabled, education: educationEnabled, ai: aiEnabled, }); const items = groups.map((group) => ({ title: group.label, href: group.children?.find((item) => item.href)?.href ?? '/', icon: LayoutGrid, })); return ( ); }