import { useRef } from 'react'; import type { LucideIcon } from 'lucide-react'; import { cn } from '../lib/classname.ts'; import { useOutsideClick } from '../hooks/use-outside-click.ts'; export interface DropdownLink { link: string; label: string; description: string; Icon: LucideIcon; isExternal?: boolean; isHighlighted?: boolean; isNew?: boolean; } interface NavigationDropdownMenuProps { links: DropdownLink[]; trigger: React.ReactNode; isOpen: boolean; onOpen: () => void; onClose: () => void; } export function NavigationDropdownMenu(props: NavigationDropdownMenuProps) { const { links, trigger, isOpen, onOpen, onClose } = props; const dropdownRef = useRef(null); useOutsideClick(dropdownRef, onClose); return (
{links.map((link) => ( {link.label}{' '} {link.isNew && ( New )} {link.description} ))}
); }