import React from 'react'; import { Command, X } from 'lucide-react'; import './KeyboardCheatsheet.css'; const SECTIONS = [ { title: 'Navigation', items: [ ['?', 'Show this cheatsheet'], ['Esc', 'Close modal / cancel'], ['Cmd/Ctrl+S', 'Save project / commit trim'], ], }, { title: 'Segment editor', items: [ ['Cmd/Ctrl+D', 'Split segment at cursor'], ['Cmd/Ctrl+M', 'Merge with next segment'], ['Cmd/Ctrl+Z', 'Undo'], ['Cmd/Ctrl+Shift+Z', 'Redo'], ['Click row', 'Primary action'], ['Shift+click row', 'Range select'], ], }, { title: 'Audio trimmer', items: [ ['Space', 'Preview play / pause'], ['← / →', 'Nudge start handle'], ['Ctrl+← / →', 'Nudge end handle'], ['Shift+arrow', 'Fine nudge'], ['Alt+arrow', 'Coarse nudge'], ['+ / −', 'Zoom in / out'], ['Home / End', 'Fit all / Fit selection'], ['Enter', 'Confirm trim'], ], }, { title: 'Dub', items: [ ['Cmd/Ctrl+Enter', 'Generate dub'], ['Cmd/Ctrl+B', 'Toggle sidebar'], ], }, ]; function Kbd({ children }) { return {children}; } export default function KeyboardCheatsheet({ open, onClose }) { if (!open) return null; return (
e.stopPropagation()} className="kcs-panel">

Keyboard shortcuts

{SECTIONS.map((sec) => (
{sec.title}
{sec.items.map(([keys, desc]) => (
{desc} {keys.split(' / ').map((group, i, arr) => ( {group.split('+').map((k) => {k})} {i < arr.length - 1 && or} ))}
))}
))}
Press ? any time to open this.
); }