import { Select, ListItem, Form, FormField, FormButtons, FormSubmitButton, TextField, PasswordField, Button, } from '@umami/react-zen'; import { useApi, useMessages } from '@/components/hooks'; import { ROLES } from '@/lib/constants'; export function UserAddForm({ onSave, onClose }) { const { post, useMutation } = useApi(); const { mutate, error, isPending } = useMutation({ mutationFn: (data: any) => post(`/users`, data), }); const { formatMessage, labels } = useMessages(); const handleSubmit = async (data: any) => { mutate(data, { onSuccess: async () => { onSave(data); onClose(); }, }); }; return (
{formatMessage(labels.save)}
); }