'use client' import * as React from 'react' import { Code, ShieldCheck } from 'lucide-react' import { cn } from '@open-mercato/shared/lib/utils' import type { PalettePhase, ConnectionStatus } from '../../types' interface CommandFooterProps { phase: PalettePhase connectionStatus: ConnectionStatus isSessionAuthorized?: boolean showDebug?: boolean onToggleDebug?: () => void } function ConnectionIndicator({ status }: { status: ConnectionStatus }) { const statusConfig: Record = { connected: { color: 'bg-emerald-500', text: 'Connected' }, connecting: { color: 'bg-yellow-500 animate-pulse', text: 'Connecting...' }, disconnected: { color: 'bg-gray-400', text: 'Disconnected' }, error: { color: 'bg-red-500', text: 'Error' }, } const config = statusConfig[status] return (
{config.text}
) } function KeyboardShortcut({ keys }: { keys: string[] }) { return (
{keys.map((key, i) => ( {key} ))}
) } export function CommandFooter({ phase, connectionStatus, isSessionAuthorized = false, showDebug = false, onToggleDebug, }: CommandFooterProps) { const idleShortcuts = [ { label: 'Submit', keys: ['\u21B5'] }, { label: 'Close', keys: ['Esc'] }, ] const chatShortcuts = [ { label: 'Send', keys: ['\u21B5'] }, { label: 'Back', keys: ['Esc'] }, ] const shortcuts = phase === 'idle' ? idleShortcuts : chatShortcuts return (
{/* Session authorization indicator */} {isSessionAuthorized && (
Authorized
)} {/* Debug toggle button */} {onToggleDebug && ( )}
{shortcuts.map((shortcut, i) => (
{shortcut.label}
))}
) }