import { Header } from './components/Header'; import { HomePage } from './components/HomePage'; import { DocumentationPage } from './components/DocumentationPage'; import { useState } from 'react'; export default function App() { const [currentPage, setCurrentPage] = useState<'home' | 'documentation'>('home'); const [isSidebarOpen, setIsSidebarOpen] = useState(false); const [theme, setTheme] = useState<'light' | 'dark'>('light'); const [currentTaxonomyId, setCurrentTaxonomyId] = useState(null); const [currentArticleSlug, setCurrentArticleSlug] = useState(null); const toggleSidebar = () => { setIsSidebarOpen(!isSidebarOpen); }; const toggleTheme = () => { setTheme(theme === 'light' ? 'dark' : 'light'); }; const navigateToHome = () => { setCurrentPage('home'); setIsSidebarOpen(false); setCurrentTaxonomyId(null); setCurrentArticleSlug(null); }; const navigateToDocumentation = () => { setCurrentPage('documentation'); setIsSidebarOpen(false); }; const handleTaxonomyClick = (taxonomyId: string) => { setCurrentPage('documentation'); setCurrentTaxonomyId(taxonomyId); setCurrentArticleSlug(null); setIsSidebarOpen(false); }; const handleArticleClick = (slug: string) => { setCurrentArticleSlug(slug); }; return (
{currentPage === 'home' ? ( ) : ( )} {/* Mobile overlay */} {isSidebarOpen && currentPage === 'documentation' && (
)}
); }