import { useState } from 'react'; export default function ChatInput({ status, onSubmit, stop, }: { status: string; onSubmit: (text: string) => void; stop?: () => void; }) { const [text, setText] = useState(''); return (
{ e.preventDefault(); if (text.trim() === '') return; onSubmit(text); setText(''); }} > setText(e.target.value)} /> {stop && (status === 'streaming' || status === 'submitted') && ( )}
); }