import { Form, FormRow, FormInput, FormButtons, TextField, Button, SubmitButton, } from 'react-basics'; import useApi from 'hooks/useApi'; import { DOMAIN_REGEX } from 'lib/constants'; import useMessages from 'hooks/useMessages'; export function WebsiteAddForm({ onSave, onClose }) { const { formatMessage, labels, messages } = useMessages(); const { post, useMutation } = useApi(); const { mutate, error, isLoading } = useMutation(data => post('/websites', data)); const handleSubmit = async data => { mutate(data, { onSuccess: async () => { onSave(); onClose(); }, }); }; return (
{formatMessage(labels.save)}
); } export default WebsiteAddForm;