'use client'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { X, Keyboard } from 'lucide-react'; interface KeyboardShortcutsHelpProps { onClose: () => void; } interface ShortcutGroup { title: string; shortcuts: Array<{ keys: string[]; description: string; }>; } const SHORTCUT_GROUPS: ShortcutGroup[] = [ { title: 'Navigation', shortcuts: [ { keys: ['/'], description: 'Focus search field' }, { keys: ['j'], description: 'Select next process' }, { keys: ['k'], description: 'Select previous process' }, { keys: ['Esc'], description: 'Clear selection / Close modals' }, ], }, { title: 'Actions', shortcuts: [ { keys: ['r'], description: 'Refresh process list' }, { keys: ['Space'], description: 'Toggle process selection' }, { keys: ['a'], description: 'Select all processes' }, { keys: ['s'], description: 'Start selected processes' }, { keys: ['x'], description: 'Stop selected processes' }, { keys: ['t'], description: 'Restart selected processes' }, ], }, { title: 'General', shortcuts: [ { keys: ['?'], description: 'Show keyboard shortcuts (this dialog)' }, ], }, ]; export function KeyboardShortcutsHelp({ onClose }: KeyboardShortcutsHelpProps) { return (
Keyboard Shortcuts Use these keyboard shortcuts to navigate and control processes
{SHORTCUT_GROUPS.map((group) => (

{group.title}

{group.shortcuts.map((shortcut, index) => (
{shortcut.description}
{shortcut.keys.map((key, keyIndex) => ( {key} ))}
))}
))}

Note: Most shortcuts are disabled when typing in input fields. Press{' '} Esc {' '} to exit input fields and enable shortcuts.

); }