import type { FormEvent } from "react"; export interface ComposerProps { value: string; busy: boolean; error: boolean; onChange: (value: string) => void; onSubmit: () => void; } export function Composer({ value, busy, error, onChange, onSubmit }: ComposerProps) { const empty = value.trim().length === 0; function submit(e: FormEvent) { e.preventDefault(); if (!empty && !busy) onSubmit(); } return (