/** * HelpPanel - displays keyboard shortcuts and help information */ import { Box, Text } from 'ink'; import type { HelpPanelProps } from '../types/ui.js'; /** * Help panel component that displays keyboard shortcuts and usage information */ export function HelpPanel({ shortcuts = [], variant = 'default', borderColor = 'blue' }: HelpPanelProps) { // Default shortcuts if none provided const defaultShortcuts = [ { key: 'Ctrl+C', description: 'Exit application' }, { key: 'Ctrl+L', description: 'Clear message history' }, { key: 'Ctrl+T', description: 'Toggle tool display' }, { key: 'Ctrl+H', description: 'Toggle help' }, { key: 'Enter', description: 'Send message' }, ]; const displayShortcuts = shortcuts.length > 0 ? shortcuts : defaultShortcuts; // Add variant-specific shortcuts const variantShortcuts = { git: [ { key: 'commit', description: 'Start commit workflow' }, { key: 'review', description: 'Start code review' }, { key: 'rebase', description: 'Interactive rebase helper' } ], chat: [ { key: 'Ctrl+Return', description: 'Send message (multiline mode)' }, { key: 'Esc', description: 'Switch to command mode' } ] }; const allShortcuts = [ ...displayShortcuts, ...(variantShortcuts[variant as keyof typeof variantShortcuts] || []) ]; return ( 💡 Keyboard Shortcuts {allShortcuts.map((shortcut, index) => ( {shortcut.key} {shortcut.description} ))} {variant === 'git' && ( 💡 Tip: Use workflow commands from any git repository )} ); }