"use client"; import {Trash2} from "lucide-react"; import {ButtonWithConfirm} from "@/components/wrappers/common/button/button-with-confirm"; import {useMutation} from "@tanstack/react-query"; import {useRouter} from "next/navigation"; import {toast} from "sonner"; import {deleteUserAction} from "@/components/wrappers/dashboard/profile2/button-delete-account/delete-account.action"; export type ButtonDeleteUserProps = { userId: string; disabled?: boolean; }; export const ButtonDeleteUser = (props: ButtonDeleteUserProps) => { const router = useRouter(); const mutation = useMutation({ mutationFn: () => deleteUserAction(props.userId), onSuccess: async () => { toast.success("User deleted successfully."); router.refresh(); }, }); return (