"use client"; import { RiArrowLeftRightLine, RiBankCard2Line, RiBankLine, RiCalendarEventLine, RiDashboardLine, RiFileChartLine, RiFundsLine, RiGroupLine, RiInboxLine, RiMenuLine, RiPriceTag3Line, RiSparklingLine, RiTodoLine, } from "@remixicon/react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useState } from "react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuList, NavigationMenuTrigger, } from "@/components/ui/navigation-menu"; import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger, } from "@/components/ui/sheet"; import { cn } from "@/lib/utils/ui"; type TopNavMenuProps = { preLancamentosCount?: number; }; const linkBase = "inline-flex h-9 items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-colors"; const linkIdle = "text-foreground/70 hover:text-foreground hover:underline"; const linkActive = "text-primary"; // NavigationMenuTrigger override: remove backgrounds, keep underline style const triggerClass = [ "text-foreground/70!", "bg-transparent!", "hover:bg-transparent!", "hover:text-foreground!", "hover:underline!", "focus:bg-transparent!", "focus:text-foreground!", "data-[state=open]:bg-transparent!", "data-[state=open]:text-foreground!", "data-[state=open]:underline!", "px-3!", ].join(" "); function SimpleNavLink({ href, children, }: { href: string; children: React.ReactNode; }) { const pathname = usePathname(); const isActive = href === "/dashboard" ? pathname === href : pathname === href || pathname.startsWith(`${href}/`); return ( {children} ); } type DropdownLinkItem = { href: string; label: string; icon: React.ReactNode; badge?: number; }; function DropdownLinkList({ items }: { items: DropdownLinkItem[] }) { return (
{label}
); } export function TopNavMenu({ preLancamentosCount = 0 }: TopNavMenuProps) { const [sheetOpen, setSheetOpen] = useState(false); const close = () => setSheetOpen(false); const lancamentosItems: DropdownLinkItem[] = [ { href: "/lancamentos", label: "Lançamentos", icon: