"use client";
import { useEffect } from "react";
import { useRouter } from "next/navigation";

export default function RootPage() {
  const router = useRouter();

  useEffect(() => {
    const hasToken = document.cookie.includes("accessToken");
    if (!hasToken) {
      window.location.href = "/login.html";
    } else {
      router.push("/main/overview/dashboard");
    }
  }, [router]);
}
