import React from 'react'; import { useTranslation } from 'react-i18next'; import { Pressable, StyleSheet, Text, View } from 'react-native'; interface PermissionAlertProps { visible: boolean; onConfirm: () => void; onCancel: () => void; title: string; message: string; confirmText?: string; cancelText?: string; } const PermissionAlert: React.FC = ({ visible, onConfirm, onCancel, title, message, confirmText, cancelText }) => { const { t } = useTranslation(); if (!visible) { return null; } return ( {title} {message} {cancelText || t('cancel', { ns: 'permission' })} {confirmText || t('goToSettings', { ns: 'permission' })} ); }; const styles = StyleSheet.create({ overlay: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, zIndex: 99, }, centeredView: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'rgba(0,0,0,0.5)', zIndex: 9999, }, modalView: { width: '80%', backgroundColor: 'white', borderRadius: 16, padding: 24, alignItems: 'center', shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.25, shadowRadius: 4, elevation: 5, }, modalTitle: { fontSize: 20, fontWeight: 'bold', color: '#4C320C', marginBottom: 12, }, modalMessage: { fontSize: 16, color: '#4C320C', textAlign: 'center', marginBottom: 24, }, buttonContainer: { flexDirection: 'row', justifyContent: 'space-between', width: '100%', }, button: { borderRadius: 20, paddingVertical: 12, flex: 1, alignItems: 'center', }, cancelButton: { backgroundColor: '#F5F5F5', marginRight: 8, }, confirmButton: { backgroundColor: '#E2793F', marginLeft: 8, }, buttonText: { color: '#4C320C', fontWeight: '600', }, confirmButtonText: { color: 'white', fontWeight: '600', }, }); export default PermissionAlert;