import { NavLink } from "@/lib/router"; import { cn } from "../lib/utils"; import { useSidebar } from "../context/SidebarContext"; import type { LucideIcon } from "lucide-react"; interface SidebarNavItemProps { to: string; label: string; icon: LucideIcon; end?: boolean; className?: string; badge?: number; badgeTone?: "default" | "danger"; alert?: boolean; liveCount?: number; } export function SidebarNavItem({ to, label, icon: Icon, end, className, badge, badgeTone = "default", alert = false, liveCount, }: SidebarNavItemProps) { const { isMobile, setSidebarOpen } = useSidebar(); return ( { if (isMobile) setSidebarOpen(false); }} className={({ isActive }) => cn( "flex items-center gap-2.5 px-3 py-2 text-[13px] font-medium transition-colors", isActive ? "bg-accent text-foreground" : "text-foreground/80 hover:bg-accent/50 hover:text-foreground", className, ) } > {alert && ( )} {label} {liveCount != null && liveCount > 0 && ( {liveCount} live )} {badge != null && badge > 0 && ( {badge} )} ); }