import { Button, Form, FormButtons, FormField, FormSubmitButton, PasswordField, } from '@umami/react-zen'; import { useMessages, useUpdateQuery } from '@/components/hooks'; export function PasswordEditForm({ onSave, onClose }) { const { formatMessage, labels, messages, getErrorMessage } = useMessages(); const { mutateAsync, error, isPending } = useUpdateQuery('/me/password'); const handleSubmit = async (data: any) => { await mutateAsync(data, { onSuccess: async () => { onSave(); onClose(); }, }); }; const samePassword = (value: string, values: Record) => { if (value !== values.newPassword) { return formatMessage(messages.noMatchPassword); } return true; }; return (
{formatMessage(labels.save)}
); }