()
| 386 | let isPromptControlled = props.value !== undefined; |
| 387 | let isAttachmentsControlled = props.attachments !== undefined; |
| 388 | let onSubmit = () => { |
| 389 | if (prompt.segments.length === 0 && attachments.length === 0) { |
| 390 | return; |
| 391 | } |
| 392 | |
| 393 | props.onSubmit?.(prompt, attachments); |
| 394 | voiceStopRef.current?.(); |
| 395 | if (!isPromptControlled) { |
| 396 | setPrompt(new PromptFieldValue([])); |
| 397 | } |
| 398 | if (!isAttachmentsControlled) { |
| 399 | setAttachments([]); |
| 400 | } |
| 401 | inputRef.current?.focus(); |
| 402 | }; |
| 403 | |
| 404 | return ( |
| 405 | <PromptFieldContext.Provider |
no test coverage detected