"use client"; import { useEffect } from 'react'; import { useStore } from '@/lib/store'; import { Navbar } from "@/components/Navbar"; import { Gallery } from "@/components/Gallery"; import { PromptHero } from "@/components/PromptHero"; import { Settings } from "@/components/Settings"; import { PromptLibrary } from "@/components/PromptLibrary"; import { UploadHistory } from "@/components/UploadHistory"; import { CookieExpiredDialog } from "@/components/CookieExpiredDialog"; import { BottomNav } from "@/components/BottomNav"; export default function Home() { const { currentView, setCurrentView, loadGallery } = useStore(); useEffect(() => { loadGallery(); }, [loadGallery]); const handleTabChange = (tab: 'create' | 'library' | 'uploads' | 'settings') => { if (tab === 'create') setCurrentView('gallery'); else if (tab === 'uploads') setCurrentView('history'); else setCurrentView(tab); }; const getActiveTab = () => { if (currentView === 'gallery') return 'create'; if (currentView === 'history') return 'uploads'; return currentView as 'create' | 'library' | 'uploads' | 'settings'; }; return (
{/* Top Navbar - Mobile Header */} {/* Main Content Area */}
{/* Scrollable Container */}
{/* Always show Hero on Create View */} {currentView === 'gallery' && ( <> )} {currentView === 'settings' && } {currentView === 'library' && ( setCurrentView('gallery')} /> )} {currentView === 'history' && }
{/* Bottom Navigation (Mobile & Desktop App-like) */}
); }