import { useEffect } from 'react';
import { useRouter } from 'next/router';
import { useAuth } from '../hooks/useAuth';

export default function Home() {
    const router = useRouter();
    const { user, loading } = useAuth();

    useEffect(() => {
        if (!loading) {
            router.push(user ? '/dashboard' : '/login');
        }
    }, [user, loading, router]);

    return (
        <div className="min-h-screen bg-dark-bg flex items-center justify-center">
            <div className="animate-spin w-10 h-10 border-4 border-brand-primary border-t-transparent rounded-full" />
        </div>
    );
}
