(e: React.KeyboardEvent<HTMLTextAreaElement>)
| 56 | const minHeight = 60; |
| 57 | |
| 58 | const handleResize = (e: React.KeyboardEvent<HTMLTextAreaElement>) => { |
| 59 | if (fakeTextareaRef.current && textareaRef.current) { |
| 60 | fakeTextareaRef.current.value = e.currentTarget.value; |
| 61 | const newHeight = Math.max( |
| 62 | minHeight, |
| 63 | fakeTextareaRef.current.scrollHeight |
| 64 | ); |
| 65 | |
| 66 | setHeight(Math.max(minHeight, fakeTextareaRef.current.scrollHeight)); |
| 67 | textareaRef.current.style.height = newHeight + "px"; |
| 68 | } |
| 69 | }; |
| 70 | |
| 71 | const showSubmitButton = !previousPrompt && prompt; |
| 72 | const showSubmitEditButton = previousPrompt && previousPrompt !== prompt; |
no outgoing calls
no test coverage detected