import React, { useState } from 'react'; import { Button, Input, Label } from 'xertica-ui/ui'; import { XerticaLogo } from 'xertica-ui/brand'; import { AuthPageShell, usePasswordStrength, PasswordStrengthMeter } from 'xertica-ui/blocks'; import { ArrowLeft, CheckCircle2, AlertCircle } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { useBrandColors } from 'xertica-ui/hooks'; export function ResetPasswordContent() { const navigate = useNavigate(); const { t } = useTranslation(); const { currentTheme } = useBrandColors(); const [password, setPassword] = useState(''); const [confirmPassword, setConfirmPassword] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); const passwordStrength = usePasswordStrength(password); const handlePasswordChange = (value: string) => { setPassword(value); setError(''); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); if (password.length < 6) { setError(t('resetPassword.errorMinLength')); return; } if (password !== confirmPassword) { setError(t('resetPassword.errorMismatch')); return; } setIsLoading(true); await new Promise(resolve => setTimeout(resolve, 1500)); navigate('/login', { state: { resetSuccess: true } }); setIsLoading(false); }; const content = ( <>
{t('resetPassword.subheading')}