import { NextPage } from "next";
import { useRouter } from "next/router";
import { deleteTokenCookies } from "@utils/auth";

const AdminLogoutPage: NextPage = () => {
  const router = useRouter();
  // client-side-only code
  if (typeof window !== "undefined") {
    deleteTokenCookies();
    router.push("/admin/login");
  }
  return null;
};

export default AdminLogoutPage;
