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