import { useRef } from 'react'; import { Form, FormInput, FormButtons, TextField, Button, SubmitButton } from 'react-basics'; import useApi from 'hooks/useApi'; import styles from './Form.module.css'; import { useMutation } from '@tanstack/react-query'; import { DOMAIN_REGEX } from 'lib/constants'; export default function WebsiteAddForm({ onSave, onClose }) { const { post } = useApi(); const { mutate, error, isLoading } = useMutation(data => post('/websites', data)); const ref = useRef(null); const handleSubmit = async data => { mutate(data, { onSuccess: async () => { onSave(); }, }); }; return (
Save
); }