import React from 'react'; import { View, Linking, Platform } from 'react-native'; import { useTheme } from '~/features/theme/ThemeProvider'; import Text from '~/components/atoms/Text'; import Button from '~/components/atoms/Button'; import BaseModal from '~/components/atoms/BaseModal'; import Icon from '~/components/atoms/Icon'; import { useTranslation } from 'react-i18next'; interface PermissionDeniedModalProps { isVisible: boolean; onClose: () => void; canAskAgain: boolean; onRetry?: () => void; } /** * Modal that is displayed when microphone permissions are denied. * Provides guidance to users on how to enable permissions manually in device settings. */ const PermissionDeniedModal: React.FC = ({ isVisible, onClose, canAskAgain, onRetry, }) => { const { isDark, themeVariant } = useTheme(); const { t } = useTranslation(); const handleOpenSettings = async () => { try { if (Platform.OS === 'ios') { await Linking.openURL('app-settings:'); } else { await Linking.openSettings(); } } catch (error) { console.debug('Error opening settings:', error); // Fallback: try to open general settings try { await Linking.openSettings(); } catch (fallbackError) { console.debug('Error opening fallback settings:', fallbackError); } } onClose(); }; const handleRetry = () => { onClose(); // Call the retry callback if provided onRetry?.(); }; const renderFooter = () => (