import { Frown } from "react-feather"; import HistoricalMessage from "./HistoricalMessage"; import PromptReply from "./PromptReply"; import { useEffect, useRef } from "react"; export default function ChatHistory({ history = [], workspace }) { const replyRef = useRef(null); useEffect(() => { if (replyRef.current) { setTimeout(() => { replyRef.current.scrollIntoView({ behavior: "smooth", block: "end" }); }, 700); } }, [history]); if (history.length === 0) { return (

No chat history found.

Send your first message to get started.

); } return (
{history.map((props, index) => { const isLastMessage = index === history.length - 1; if (props.role === "assistant" && props.animate) { return ( ); } return ( ); })}
); }