"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 or friendly names return keyName .replace("Cmd", "⌘") .replace("Shift", "Shift") .replace("ArrowLeft", "Arrow Left") .replace("ArrowRight", "Arrow Right") .replace("ArrowUp", "Arrow Up") .replace("ArrowDown", "Arrow Down") .replace("←", "◀") .replace("→", "▶") .replace("Space", "Space"); }; const ShortcutItem = ({ shortcut }: { shortcut: any }) => { // Filter out lowercase duplicates for display - if both "j" and "J" exist, only show "J" const displayKeys = shortcut.keys.filter((key: string) => { const lowerKey = key.toLowerCase(); const upperKey = key.toUpperCase(); // If this is a lowercase letter and the uppercase version exists, skip it if ( key === lowerKey && key !== upperKey && shortcut.keys.includes(upperKey) ) { return false; } return true; }); return (