Skip to content

Commit

Permalink
disable button on empty message
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSahitya committed Jun 3, 2024
1 parent 05a2783 commit b09c0a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/app/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ function ChatpageInner() {
setChatState("idle");
};

const [inputValue, setInputValue] = useState("");

return (
<div
className="px-4 bg-zinc-100 flex-grow pagecont"
Expand Down Expand Up @@ -390,14 +392,17 @@ function ChatpageInner() {
className=" appearance-none border-none outline-none w-full bg-transparent mx-[6px]"
placeholder="Describe your problem ..."
value={message}
onChange={(e) => setMessage(e.target.value)}
onChange={(e) => {
setMessage(e.target.value);
setInputValue(e.target.value);
}}
/>
{/* <ImageChatPopup chatState={chatState} setChatState={setChatState} /> */}
<Button
onClick={() => {
handleClick();
}}
disabled={chatState === "busy" || fetchingChat ? true : false}
disabled={ chatState === "busy" || fetchingChat || !inputValue ? true : false }
>
<FiArrowRight />
</Button>
Expand Down

0 comments on commit b09c0a1

Please sign in to comment.