diff --git a/frontend/src/components/chat/ChatInterface.tsx b/frontend/src/components/chat/ChatInterface.tsx index f6d7c12f65..c4fde682af 100644 --- a/frontend/src/components/chat/ChatInterface.tsx +++ b/frontend/src/components/chat/ChatInterface.tsx @@ -1,3 +1,4 @@ +// frontend/src/components/chat/ChatInterface.tsx import React, { useRef } from "react"; import { useDispatch, useSelector } from "react-redux"; import { IoMdChatbubbles } from "react-icons/io"; @@ -8,6 +9,7 @@ import { FaRegThumbsDown, FaRegThumbsUp } from "react-icons/fa"; import { useDisclosure } from "@nextui-org/react"; import ChatInput from "./ChatInput"; import Chat from "./Chat"; +import TypingIndicator from "./TypingIndicator"; import { RootState } from "#/store"; import AgentState from "#/types/AgentState"; import { sendChatMessage } from "#/services/chatService"; @@ -127,19 +129,27 @@ function ChatInterface() {
- {!hitBottom && - ScrollButton({ - onClick: scrollDomToBottom, - icon: , - label: t(I18nKey.CHAT_INTERFACE$TO_BOTTOM), - })} - {curAgentState === AgentState.AWAITING_USER_INPUT && - hitBottom && - ScrollButton({ - onClick: handleSendContinueMsg, - icon: , - label: t(I18nKey.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE), - })} + {!hitBottom && ( + } + label={t(I18nKey.CHAT_INTERFACE$TO_BOTTOM)} + /> + )} + {hitBottom && ( + <> + {curAgentState === AgentState.AWAITING_USER_INPUT && ( + + } + label={t(I18nKey.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} + /> + )} + {curAgentState === AgentState.RUNNING && } + + )}
{feedbackShared !== messages.length && messages.length > 3 && ( diff --git a/frontend/src/components/chat/TypingIndicator.tsx b/frontend/src/components/chat/TypingIndicator.tsx new file mode 100644 index 0000000000..528bc45c40 --- /dev/null +++ b/frontend/src/components/chat/TypingIndicator.tsx @@ -0,0 +1,22 @@ +import React from "react"; + +function TypingIndicator(): React.ReactElement { + return ( +
+ + + +
+ ); +} + +export default TypingIndicator;