diff --git a/web_app/src/components/PromptInput.tsx b/web_app/src/components/PromptInput.tsx index d57f69d..8a72776 100644 --- a/web_app/src/components/PromptInput.tsx +++ b/web_app/src/components/PromptInput.tsx @@ -1,8 +1,9 @@ import React, { FormEvent, useRef } from "react" import { Button } from "./ui/button" -import { Input } from "./ui/input" import { useStore } from "@/lib/states" -import { useClickAway } from "react-use" +import { useClickAway, useToggle } from "react-use" +import { Textarea } from "./ui/textarea" +import { cn } from "@/lib/utils" const PromptInput = () => { const [ @@ -20,18 +21,21 @@ const PromptInput = () => { state.showPrevMask, state.hidePrevMask, ]) + + const [showScroll, toggleShowScroll] = useToggle(false) + const ref = useRef(null) useClickAway(ref, () => { if (ref?.current) { - const input = ref.current as HTMLInputElement + const input = ref.current as HTMLTextAreaElement input.blur() } }) - const handleOnInput = (evt: FormEvent) => { + const handleOnInput = (evt: FormEvent) => { evt.preventDefault() evt.stopPropagation() - const target = evt.target as HTMLInputElement + const target = evt.target as HTMLTextAreaElement updateSettings({ prompt: target.value }) } @@ -56,24 +60,33 @@ const PromptInput = () => { } return ( -
- - +
+
+