"use client"; import { useEffect } from "react"; import { useRouter } from "next/navigation"; import { useAuth } from "@/lib/auth"; import { Spinner } from "@/components/ui"; // Entry point: bounce to the dashboard or the login page based on auth state. export default function Home() { const { token, ready } = useAuth(); const router = useRouter(); useEffect(() => { if (!ready) return; router.replace(token ? "/dashboard" : "/login"); }, [ready, token, router]); return (