()
| 122 | } |
| 123 | |
| 124 | const handleRewrite = () => { |
| 125 | // Get the last user message and resubmit it |
| 126 | const lastUserMessage = [...messages].reverse().find(m => m.role === 'user') |
| 127 | if (lastUserMessage) { |
| 128 | handleInputChange({ target: { value: getMessageContent(lastUserMessage) } } as React.ChangeEvent<HTMLTextAreaElement>) |
| 129 | // Submit the form |
| 130 | setTimeout(() => { |
| 131 | formRef.current?.requestSubmit() |
| 132 | }, 100) |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | |
| 137 | return ( |
nothing calls this directly
no test coverage detected