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 { useEffect } from "react";
import { useRouter } from "next/navigation";
import { useAuthStore } from "@/store/authStore";
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]);
import PublicLayout from '@/components/public/PublicLayout'
import LandingHero from '@/components/public/landing/LandingHero'
import LandingFeatures from '@/components/public/landing/LandingFeatures'
import LandingStats from '@/components/public/landing/LandingStats'
import LandingRecentPosts from '@/components/public/landing/LandingRecentPosts'
import LandingCTA from '@/components/public/landing/LandingCTA'
export default function HomePage() {
return (
<div className="min-h-screen flex items-center justify-center bg-gray-50">
<div className="flex flex-col items-center gap-3">
<div className="w-10 h-10 border-4 border-primary-500 border-t-transparent rounded-full animate-spin" />
<p className="text-gray-500 text-sm">Loading...</p>
</div>
</div>
);
<PublicLayout>
<LandingHero />
<LandingStats />
<LandingFeatures />
<LandingRecentPosts />
<LandingCTA />
</PublicLayout>
)
}