import { Form, FormRow, FormInput, FormButtons, TextField, Button, SubmitButton, } from 'react-basics'; import { useApi } from 'components/hooks'; import { DOMAIN_REGEX } from 'lib/constants'; import { useMessages } from 'components/hooks'; import { useContext } from 'react'; import SettingsContext from '../SettingsContext'; export function WebsiteAddForm({ teamId, onSave, onClose, }: { teamId: string; onSave?: () => void; onClose?: () => void; }) { const { formatMessage, labels, messages } = useMessages(); const { websitesUrl } = useContext(SettingsContext); const { post, useMutation } = useApi(); const { mutate, error, isPending } = useMutation({ mutationFn: (data: any) => post(websitesUrl, { ...data, teamId }), }); const handleSubmit = async (data: any) => { mutate(data, { onSuccess: async () => { onSave?.(); onClose?.(); }, }); }; return (
); } export default WebsiteAddForm;