apix/app/page.tsx
Khoa.vo ad19603f7c
Some checks are pending
CI / build (18.x) (push) Waiting to run
CI / build (20.x) (push) Waiting to run
fix: Remove GrokChat import and usage from page.tsx
2026-01-07 19:39:29 +07:00

59 lines
1.6 KiB
TypeScript

"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";
export default function Home() {
const { currentView, setCurrentView, loadGallery } = useStore();
useEffect(() => {
loadGallery();
}, [loadGallery]);
return (
<div className="flex h-screen w-full bg-background text-foreground overflow-hidden font-sans flex-col">
{/* Top Navbar */}
<Navbar />
{/* Main Content Area */}
<main className="flex-1 relative flex flex-col h-full w-full overflow-hidden mt-16">
{/* Scrollable Container */}
<div className="flex-1 overflow-y-auto w-full scroll-smooth">
<div className="min-h-full w-full max-w-[1600px] mx-auto p-4 md:p-6 pb-20">
{/* Always show Hero on Create View */}
{currentView === 'gallery' && (
<>
<PromptHero />
<Gallery />
</>
)}
{currentView === 'settings' && <Settings />}
{currentView === 'library' && (
<PromptLibrary onSelect={(p) => setCurrentView('gallery')} />
)}
{currentView === 'history' && <UploadHistory />}
</div>
</div>
</main>
<CookieExpiredDialog />
</div>
);
}