import { Form, FormField, FormButtons, PasswordField, Button, FormSubmitButton, } from '@umami/react-zen'; import { useMessages, useUpdateQuery } from '@/components/hooks'; export function PasswordEditForm({ onSave, onClose }) { const { formatMessage, labels, messages } = useMessages(); const { mutate, error, isPending } = useUpdateQuery('/me/password'); const handleSubmit = async (data: any) => { mutate(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)}
); }