import React, { useState } from 'react'; import { View, StyleSheet, KeyboardAvoidingView, Platform, TouchableOpacity } from 'react-native'; import { useAppDesignTokens } from '@umituz/react-native-design-system/theme'; import { AtomicInput, AtomicButton, AtomicText, AtomicIcon } from '@umituz/react-native-design-system/atoms'; import { SafeAreaView } from '@umituz/react-native-design-system/safe-area'; import { resolvePasswordPrompt } from '../utils/passwordPromptCallback'; export interface PasswordPromptScreenProps { route: { params: { title?: string; message?: string; confirmText?: string; cancelText?: string; }; }; navigation: { goBack: () => void; }; } export const PasswordPromptScreen: React.FC = ({ route, navigation, }) => { const tokens = useAppDesignTokens(); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const { title = 'Password Required', message = 'Enter your password to continue', confirmText = 'Confirm', cancelText = 'Cancel', } = route.params; const handleConfirm = () => { if (!password) { setError('Password is required'); return; } resolvePasswordPrompt(password); navigation.goBack(); }; const handleCancel = () => { resolvePasswordPrompt(null); navigation.goBack(); }; return ( {title} {message} { setPassword(text); setError(''); }} placeholder="Password" secureTextEntry state={error ? 'error' : 'default'} helperText={error} style={{ marginBottom: tokens.spacing.md }} /> ); }; const styles = StyleSheet.create({ safeArea: { flex: 1, }, headerBar: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 16, paddingVertical: 12, borderBottomWidth: 1, }, closeButton: { padding: 4, width: 40, }, placeholder: { width: 40, }, keyboardView: { flex: 1, }, container: { flex: 1, justifyContent: 'center', }, messageContainer: { marginBottom: 24, }, message: { textAlign: 'center', lineHeight: 22, }, content: { flex: 1, justifyContent: 'center', }, buttons: { flexDirection: 'row', }, button: { flex: 1, }, });