import toast from "react-hot-toast"; import Modal from "../Modal"; import useUserStore from "@/store/admin/users"; import Button from "../ui/Button"; import { useTranslation } from "next-i18next"; type Props = { onClose: Function; userId: number; }; export default function DeleteUserModal({ onClose, userId }: Props) { const { t } = useTranslation(); const { removeUser } = useUserStore(); const deleteUser = async () => { const load = toast.loading(t("deleting_user")); const response = await removeUser(userId); toast.dismiss(load); if (response.ok) { toast.success(t("user_deleted")); } else { toast.error(response.data as string); } onClose(); }; return (

{t("delete_user")}

{t("confirm_user_deletion")}

{t("warning")}: {t("irreversible_action_warning")}
); }