/** * The builder's dropdown menu list — compact, theme-styled items (small muted * icon, gold hover) in place of core's MenuItem, whose 24px icons and blue * focus ring didn't belong to this UI. Rendered inside a core Dropdown. */ import type { LucideIcon } from 'lucide-react'; export interface DockMenuItem { key: string; label: string; icon: LucideIcon; onClick: () => void; tone?: 'danger'; } export interface DockMenuGroup { key: string; label?: string; items: DockMenuItem[]; /** Shown in place of the items when there are none. */ empty?: string; } interface DockMenuProps { groups: DockMenuGroup[]; /** Called after any item runs, e.g. the Dropdown's onClose. */ onDone: () => void; } export default function DockMenu( { groups, onDone }: DockMenuProps ) { return (
{ groups.map( ( group ) => (
{ group.label && ( ) } { 0 === group.items.length && group.empty && (

{ group.empty }

) } { group.items.map( ( { key, label, icon: Icon, onClick, tone } ) => ( ) ) }
) ) }
); }