diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/index.jsx index 4acda9b8..5869a81f 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/index.jsx @@ -1,66 +1,56 @@ -import { useEffect, useRef, memo } from "react"; +import { memo, forwardRef } from "react"; import { AlertTriangle } from "react-feather"; import Jazzicon from "../../../../UserIcon"; import renderMarkdown from "../../../../../utils/chat/markdown"; import { userFromStorage } from "../../../../../utils/request"; import Citations from "../Citation"; -function HistoricalMessage({ - message, - role, - workspace, - sources = [], - error = false, -}) { - const replyRef = useRef(null); - useEffect(() => { - if (replyRef.current) - replyRef.current.scrollIntoView({ behavior: "smooth", block: "end" }); - }, [replyRef.current]); - - if (role === "user") { - return ( -