import useLLM from "@react-llm/headless"; import { useEffect, useRef } from "react"; import { MemoizedReactMarkdown } from './Markdown' import { CodeBlock } from './CodeBlock' function MessageList({ fileMode }) { const scrollRef = useRef(null); const { conversation, userRoleName } = useLLM(); const messages = conversation?.messages || []; const scrollToBottom = () => { if (scrollRef.current) { scrollRef.current.scrollIntoView(); } }; useEffect(() => { scrollToBottom(); }, [conversation, messages.length]); return (
{children}
);
},
table({ children }) {
return (