"use client" import { type Icon } from "@tabler/icons-react" import { usePathname } from "next/navigation" import { SidebarGroup, SidebarGroupContent, SidebarMenu, SidebarMenuButton, SidebarMenuItem, } from "@/components/ui/sidebar" export function NavMain({ items, }: { items: { title: string url: string icon?: Icon items?: { title: string url: string }[] }[] }) { const pathname = usePathname() return ( {items.map((item) => { const Icon = item.icon const isActive = pathname === item.url || pathname?.startsWith(item.url + '/') return ( {Icon && } {item.title} ) })} ) }