"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 (
);
};