import React, { useState } from 'react'; import { AnimatePresence, motion } from 'framer-motion'; import { useChat } from './hooks/useChat'; import { Sidebar } from './components/Sidebar'; import { Navbar } from './components/Navbar'; import { Dashboard } from './components/Dashboard'; import { ChatInterface } from './components/ChatInterface'; import { CodePlayground } from './components/CodePlayground'; import { Settings } from './components/Settings'; import { AboutPage } from './components/AboutPage'; export const App: React.FC = () => { const { activeConversation, settings, modelInfo, isLoading, error, updateSettings, createNewConversation, sendMessage, executeCodeAction, clearHistory, } = useChat(); const [activeTab, setActiveTab] = useState('dashboard'); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false); const selectTabFromNav = (tab: string) => { setActiveTab(tab); setMobileSidebarOpen(false); }; return (
{/* 1. Sidebar Navigation (Desktop only, hidden on lg screens down) */}
{/* 2. Responsive Overlay Drawer Sidebar (Mobile / Tablet) */} {mobileSidebarOpen && ( {}} /> {/* Close trigger overlay inside the sidebar */} {/* Backdrop shadow space clicking closer */}
setMobileSidebarOpen(false)}>
)}
{/* 3. Main content frame (Contains sticky header and tabs) */}
setMobileSidebarOpen(true)} />
{activeTab === 'dashboard' && ( )} {activeTab === 'chat' && ( )} {activeTab === 'playground' && ( )} {activeTab === 'settings' && ( )} {activeTab === 'about' && ( )} {/* Placeholder tabs for nav items not yet implemented */} {['history', 'documents', 'snippets', 'models'].includes(activeTab) && (

{activeTab}

This section is coming soon. Core chat and playground features are fully available.

)}
); }; export default App;