diff --git a/apps/web/src/chat/composer.tsx b/apps/web/src/chat/composer.tsx index caf182fe6..cc0ae6d9c 100644 --- a/apps/web/src/chat/composer.tsx +++ b/apps/web/src/chat/composer.tsx @@ -23,6 +23,9 @@ export function Composer({ onAttach, onRunWorkflow, onVoice, + voiceUnavailable, + sendLabel = "Send", + autoFocus, }: { readonly placeholder: string; readonly busy: boolean; @@ -35,6 +38,11 @@ export function Composer({ readonly onRunWorkflow?: () => void; /** Starts voice mode; the mic is hidden without it. */ readonly onVoice?: () => void; + /** Shows the mic disabled with this title when there is no `onVoice`. */ + readonly voiceUnavailable?: string; + /** Accessible name of the send button. */ + readonly sendLabel?: string; + readonly autoFocus?: boolean; }) { const [text, setText] = useState(""); const [menuOpen, setMenuOpen] = useState(false); @@ -219,6 +227,7 @@ export function Composer({ placeholder={placeholder} aria-label={placeholder} disabled={disabled} + autoFocus={autoFocus} onChange={(event) => { setText(event.target.value); syncMention(event.target); @@ -252,13 +261,13 @@ export function Composer({ } }} /> - {onVoice === undefined ? null : ( + {onVoice === undefined && voiceUnavailable === undefined ? null : (