import { useMutation } from '@tanstack/react-query'; import useApi from 'hooks/useApi'; import { Button, Form, FormRow, FormButtons, FormInput, SubmitButton, TextField, } from 'react-basics'; const CONFIRM_VALUE = 'DELETE'; export default function UserDeleteForm({ userId, onSave, onClose }) { const { del } = useApi(); const { mutate, error, isLoading } = useMutation(data => del(`/users/${userId}`, data)); const handleSubmit = async data => { mutate(data, { onSuccess: async () => { onSave(); }, }); }; return (
); }