"use client" import Link from "next/link" import { usePathname } from "next/navigation" import { SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, } from "@/components/ui/sidebar" export interface NavItem { title: string url: string icon?: React.ReactNode /** Если `undefined` — счётчик не показываем (нет данных или раздел без live-источника). */ badge?: string } export interface NavGroup { label: string items: NavItem[] } export function NavMain({ groups }: { groups: NavGroup[] }) { const pathname = usePathname() return ( <> {groups.map((group) => ( {group.label} {group.items.map((item) => ( } > {item.icon} {item.title} {item.badge != null && item.badge !== "" && ( {item.badge} )} ))} ))} ) }