import useApi from 'hooks/useApi'; import { Button, Form, FormRow, FormButtons, FormInput, SubmitButton, TextField, } from 'react-basics'; const CONFIRM_VALUE = 'DELETE'; export default function WebsiteDeleteForm({ websiteId, onSave, onClose }) { const { del, useMutation } = useApi(); const { mutate, error, isLoading } = useMutation(data => del(`/websites/${websiteId}`, data)); const handleSubmit = async data => { mutate(data, { onSuccess: async () => { onSave(); }, }); }; return (
To delete this website, type {CONFIRM_VALUE} in the box below to confirm.
value === CONFIRM_VALUE }}> Save
); }