"use client"; import { handleAxiosError } from "@/core/utils"; import { useLogout } from "@/services/hooks/auth.hook"; import { Logout } from "@mui/icons-material"; import { Button } from "@mui/material"; import { useRouter } from "next/navigation"; import { toast } from "react-toastify"; export default function LogoutButton() { const { mutateAsync, isPending } = useLogout(); const router = useRouter(); const handleLogout = async () => { try { const { message } = await mutateAsync(); toast.success(message); router.push("/"); } catch (error) { toast.error(handleAxiosError(error)); } }; return ( <> ); }