import { useState } from 'react'; import { View, Text, TextInput, Pressable, KeyboardAvoidingView, Platform, ActivityIndicator, } from 'react-native'; import { useRouter } from 'expo-router'; import { SafeAreaView } from 'react-native-safe-area-context'; import { useTranslation } from 'react-i18next'; import { useAuthStore } from '../../stores/auth'; const INPUT_STYLE = { fontSize: 16, lineHeight: 22, paddingVertical: 14, paddingHorizontal: 16, color: '#0a0a0a', fontFamily: 'Nunito_400Regular', } as const; export default function ForgotPasswordScreen() { const router = useRouter(); const { t } = useTranslation(); const { resetPasswordForEmail } = useAuthStore(); const [email, setEmail] = useState(''); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(null); const onSubmit = async () => { if (!email.trim()) return; setError(null); setLoading(true); const res = await resetPasswordForEmail(email.trim()); setLoading(false); if (res.error) { setError(res.error); return; } setSent(true); }; return ( {t('auth.resetPasswordTitle')} {t('auth.resetPasswordSubtitle')} {!sent ? ( <> {error && ( {error} )} {loading ? ( ) : ( {t('auth.resetPasswordSend')} )} ) : ( {t('auth.resetPasswordSent')} {t('auth.resetPasswordSentDescPrefix')}{email}{t('auth.resetPasswordSentDescSuffix')} )} router.back()} className="py-4 items-center mt-2" > {t('auth.backToLogin')} ); }