import type { ReactElement } from 'react'; import MSheet from './MSheet'; /** * The menu a long press on a card opens (useLongPress): what it is about on * top, then its actions, the destructive one in red. The same actions the * card's own buttons offer, so this is a second way, never the only one. */ interface ContextAction { key: string; label: string; icon: ReactElement; onClick: () => void; } interface MContextMenuProps { open: boolean; title: string; actions: ContextAction[]; onClose: () => void; } export default function MContextMenu({ open, title, actions, onClose }: MContextMenuProps) { return (
{title}
{actions.map((action) => { const danger = action.key === 'delete'; return ( ); })}
); }