"use client"; import { useState } from "react"; import { Button } from "./ui/button"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from "./ui/dialog"; import { Badge } from "./ui/badge"; import { Keyboard } from "lucide-react"; import { useKeyboardShortcuts } from "@/hooks/use-keyboard-shortcuts"; const KeyBadge = ({ keyName }: { keyName: string }) => { // Replace common key names with symbols const displayKey = keyName .replace("Cmd", "⌘") .replace("Shift", "⇧") .replace("←", "◀") .replace("→", "▶") .replace("Space", "⎵"); return ( {displayKey} ); }; const ShortcutItem = ({ shortcut }: { shortcut: any }) => (
{shortcut.icon && (
{shortcut.icon}
)} {shortcut.description}
{shortcut.keys.map((key: string, index: number) => (
{index < shortcut.keys.length - 1 && ( + )}
))}
); export const KeyboardShortcutsHelp = () => { const [open, setOpen] = useState(false); // Get shortcuts from centralized hook (disabled so it doesn't add event listeners) const { shortcuts } = useKeyboardShortcuts({ enabled: false }); const categories = Array.from(new Set(shortcuts.map((s) => s.category))); return ( Keyboard Shortcuts Speed up your video editing workflow with these keyboard shortcuts. Most shortcuts work when the timeline is focused.
{categories.map((category) => (

{category}

{shortcuts .filter((shortcut) => shortcut.category === category) .map((shortcut, index) => ( ))}
))}

Tips:

  • • Shortcuts work when the editor is focused (not typing in inputs)
  • • J/K/L are industry-standard video editing shortcuts
  • • Use arrow keys for frame-perfect positioning
  • • Hold Shift with arrow keys for larger jumps
); };