"use client"; // Add this at the top to mark this file as a Client Component import React, { useState, useEffect, useRef } from 'react'; import './styles.css'; // Make sure this matches your CSS file path const App = () => { const [showDivs, setShowDivs] = useState(true); // Default to true to show divs on load const conversationRef = useRef(null); useEffect(() => { // Scroll to bottom when the component mounts or updates const scrollToBottom = () => { const conversation = conversationRef.current; if (conversation) { conversation.scrollTop = conversation.scrollHeight; } }; scrollToBottom(); // Scroll to the bottom when the page loads // Use MutationObserver to efficiently observe changes in the conversation element const observer = new MutationObserver(scrollToBottom); if (conversationRef.current) { observer.observe(conversationRef.current, { childList: true, subtree: true, }); } return () => { if (conversationRef.current) { observer.disconnect(); } }; }, []); const toggleDivs = () => { setShowDivs(prevState => !prevState); }; return (
{showDivs && (
  • history1
  • {/* Add more history items here */}
)} {showDivs && (

Different AI models

)}
{/* Render messages here */} {/* Replace the following example with dynamic rendering */}
User: Example message
AI: Example response
); }; export default App;