import React, { useState, KeyboardEvent } from 'react'; interface Props { disabled?: boolean; placeholder?: string; onSend: (text: string) => void; } export const ChatInput: React.FC = ({ disabled, placeholder, onSend }) => { const [v, setV] = useState(''); const fire = () => { const t = v.trim(); if (!t || disabled) return; onSend(t); setV(''); }; const onKey = (e: KeyboardEvent) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); fire(); } }; return (