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