import { useEffect } from "react"; import { useShortcutContext } from "../contexts/ShortcutContext"; import { ShortcutDefinition } from "../hooks/useKeyboardShortcuts"; interface ShortcutItemProps { shortcut: ShortcutDefinition; } function ShortcutItem({ shortcut }: ShortcutItemProps) { const getKeyCombo = () => { const parts: string[] = []; if (shortcut.meta) parts.push("⌘"); if (shortcut.ctrl) parts.push("⌃"); if (shortcut.alt) parts.push("⌥"); if (shortcut.shift) parts.push("⇧"); // Display key nicely let displayKey = shortcut.key; if (displayKey === "Space") displayKey = "␣"; if (displayKey === "ArrowLeft") displayKey = "←"; if (displayKey === "ArrowRight") displayKey = "→"; if (displayKey === "ArrowUp") displayKey = "↑"; if (displayKey === "ArrowDown") displayKey = "↓"; if (displayKey === "Escape") displayKey = "Esc"; parts.push(displayKey); return parts.join(" "); }; return (