import { Button, Form, FormButtons, SubmitButton } from 'react-basics'; import useApi from 'hooks/useApi'; import useMessages from 'hooks/useMessages'; export function TeamLeaveForm({ teamId, userId, teamName, onSave, onClose }) { const { formatMessage, labels, messages, FormattedMessage } = useMessages(); const { del, useMutation } = useApi(); const { mutate, error, isLoading } = useMutation(() => del(`/teams/${teamId}/users/${userId}`)); const handleSubmit = async () => { mutate( {}, { onSuccess: async () => { onSave(); onClose(); }, }, ); }; return (

{teamName} }} />

{formatMessage(labels.leave)}
); } export default TeamLeaveForm;