import { FormEvent } from 'react'; interface ChatInputProps { value: string; canSubmit: boolean; placeholder: string; onChange: (value: string) => void; onSubmit: () => Promise | void; } export function ChatInput({ value, canSubmit, placeholder, onChange, onSubmit }: ChatInputProps) { const handleSubmit = (event: FormEvent) => { event.preventDefault(); if (!canSubmit) return; void onSubmit(); }; return (
onChange(event.target.value)} placeholder={placeholder} />
); }