import { useState } from 'react'; import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuShortcut, } from '@/components/ui/dropdown-menu'; import { cn } from '@/lib/utils'; export type MenuItem = // accent highlights an item that is an OFFER rather than a command (Donate). // Generic on purpose: a hard-coded label test in the renderer would break the // moment the menu is translated. | { type: 'item'; label: string; action: string; shortcut?: string; disabled?: boolean; accent?: boolean } | { type: 'separator' }; export interface Menu { name: string; label: string; items: MenuItem[]; } interface Props { menus: Menu[]; onAction: (action: string) => void; } export function Menubar({ menus, onAction }: Props) { // Track which menu is open so hover-to-switch works like a desktop menubar. const [openMenu, setOpenMenu] = useState(null); return ( ); }