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

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

export default AdminLogoutPage;
