"use client";

import { useEffect } from "react";

import { getToken } from "@/lib/auth";
import { useTranslation } from "@/lib/i18n";

const HomePage = () => {
  const t = useTranslation();

  useEffect(() => {
    const token = getToken();
    window.location.href = token ? "/todos" : "/login";
  }, []);

  return (
    <div className="flex min-h-screen items-center justify-center text-sm text-muted-foreground">
      {t("loading")}
    </div>
  );
};

export default HomePage;
