import type { ConsoleSessionApi } from '../../../../hooks/useConsoleSession'; import { KEY_BYTES, type KeyId } from './keys'; interface Props { session: ConsoleSessionApi; } const BUTTONS: Array<{ id: KeyId; label: string; ariaLabel: string }> = [ { id: 'esc', label: 'Esc', ariaLabel: 'Esc' }, { id: 'tab', label: 'Tab', ariaLabel: 'Tab' }, { id: 'arrow-left', label: '←', ariaLabel: '左' }, { id: 'arrow-down', label: '↓', ariaLabel: '下' }, { id: 'arrow-up', label: '↑', ariaLabel: '上' }, { id: 'arrow-right', label: '→', ariaLabel: '右' }, { id: 'ctrl-c', label: '^C', ariaLabel: 'Ctrl+C' }, ]; export function MobileKeyboardBar({ session }: Props) { const handleKey = (id: KeyId) => { session.send(KEY_BYTES[id]); }; const handlePaste = async () => { try { const text = await navigator.clipboard.readText(); if (text) session.send(text); } catch { /* clipboard API blocked or empty; silent no-op */ } }; return (