"use client"; import React, { useState } from "react"; import Link from "next/link"; import { ChevronDown } from "lucide-react"; import { cn } from "@/lib/utils"; interface SectionItem { label: string; href: string; description?: string; } interface NavSection { title: string; items: SectionItem[]; } interface NavDropdownProps { label: string; triggerHref?: string; sections: NavSection[]; align?: "left" | "right"; } export function NavDropdown({ label, triggerHref, sections, align = "left" }: NavDropdownProps) { const [isOpen, setIsOpen] = useState(false); return (
setIsOpen(true)} onMouseLeave={() => setIsOpen(false)} >
{triggerHref ? ( {label} ) : ( {label} )}
{sections.map((section, sIdx) => (

{section.title}

    {section.items.map((item, iIdx) => (
  • setIsOpen(false)} >
    {item.label}
    {item.description && (
    {item.description}
    )}
  • ))}
))}
); }