fix: apply designer agent improvements to src/app/page.tsx

This commit is contained in:
cupadev-admin 2026-03-09 14:32:12 +00:00
parent a961fd76a5
commit 9cdd9fdded
1 changed files with 15 additions and 28 deletions

View File

@ -1,31 +1,18 @@
"use client"; import PublicLayout from '@/components/public/PublicLayout'
import LandingHero from '@/components/public/landing/LandingHero'
import { useEffect } from "react"; import LandingFeatures from '@/components/public/landing/LandingFeatures'
import { useRouter } from "next/navigation"; import LandingStats from '@/components/public/landing/LandingStats'
import { useAuthStore } from "@/store/authStore"; import LandingRecentPosts from '@/components/public/landing/LandingRecentPosts'
import LandingCTA from '@/components/public/landing/LandingCTA'
export default function Home() {
const router = useRouter();
const { isAuthenticated, checkAuth } = useAuthStore();
useEffect(() => {
checkAuth();
}, [checkAuth]);
useEffect(() => {
if (isAuthenticated) {
router.replace("/dashboard");
} else {
router.replace("/login");
}
}, [isAuthenticated, router]);
export default function HomePage() {
return ( return (
<div className="min-h-screen flex items-center justify-center bg-gray-50"> <PublicLayout>
<div className="flex flex-col items-center gap-3"> <LandingHero />
<div className="w-10 h-10 border-4 border-primary-500 border-t-transparent rounded-full animate-spin" /> <LandingStats />
<p className="text-gray-500 text-sm">Loading...</p> <LandingFeatures />
</div> <LandingRecentPosts />
</div> <LandingCTA />
); </PublicLayout>
)
} }