"use client"; import React from "react"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog"; import { Keyboard } from "lucide-react"; interface KeyboardShortcutsGuideProps { isOpen: boolean; onClose: () => void; } interface ShortcutItem { keys: string[]; description: string; category: string; } const shortcuts: ShortcutItem[] = [ // 기본 작업 { keys: ["Delete"], description: "선택한 요소 삭제", category: "기본 작업" }, { keys: ["Ctrl", "C"], description: "요소 복사", category: "기본 작업" }, { keys: ["Ctrl", "V"], description: "요소 붙여넣기", category: "기본 작업" }, // 실행 취소/재실행 (구현 예정) { keys: ["Ctrl", "Z"], description: "실행 취소 (구현 예정)", category: "편집" }, { keys: ["Ctrl", "Shift", "Z"], description: "재실행 (구현 예정)", category: "편집" }, ]; const KeyBadge = ({ keyName }: { keyName: string }) => ( {keyName} ); export function KeyboardShortcutsGuide({ isOpen, onClose }: KeyboardShortcutsGuideProps) { // 카테고리별로 그룹화 const groupedShortcuts = shortcuts.reduce( (acc, shortcut) => { if (!acc[shortcut.category]) { acc[shortcut.category] = []; } acc[shortcut.category].push(shortcut); return acc; }, {} as Record, ); // Mac OS 감지 const isMac = typeof navigator !== "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0; return ( 키보드 단축키 대시보드 편집을 더 빠르게 할 수 있는 단축키 목록입니다 {isMac && " (Mac에서는 Ctrl 대신 Cmd 키를 사용하세요)"} {Object.entries(groupedShortcuts).map(([category, categoryShortcuts]) => ( {category} {categoryShortcuts.map((shortcut, index) => ( {shortcut.description} {shortcut.keys.map((key, keyIndex) => ( {keyIndex < shortcut.keys.length - 1 && +} ))} ))} ))} 💡 팁 입력 필드나 모달에서는 단축키가 자동으로 비활성화됩니다. ); }
💡 팁
입력 필드나 모달에서는 단축키가 자동으로 비활성화됩니다.