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