import { useState } from 'react'; import { Text, TouchableOpacity, View } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { useTranslation } from 'react-i18next'; import { useColors } from '../lib/theme'; import { FormSheet } from './FormSheet'; /** * Erinnerungs-Sheet wenn der Schutz auf dem Device aus ist (z.B. User hat * in iOS-Settings das Filter-Profil manuell entfernt) und das Backend ihn * trotzdem als aktiv erwartet (= bypassed/recovering). * * Ersetzt das native Alert.alert weil: * - iOS Alert kann den Reactivate-Button nicht visuell höher gewichten * (OK + Reactivate sehen gleich aus, oder OK ist sogar fetter wenn als * cancel-style) * - Wir wollen einen klaren blauen Primary "Schutz einschalten" + dezenten * ghost-Link "Später" — kein "Two-Equal-Buttons"-Look * * Schließbar via swipe-down / Backdrop-Tap / "Später"-Link. */ export function ProtectionOffSheet({ visible, onClose, onReactivate, }: { visible: boolean; onClose: () => void; /** Wird gerufen wenn User "Schutz wieder einschalten" tappt — soll * handleActivateUrlFilter o.ä. callen. */ onReactivate: () => Promise | void; }) { const { t } = useTranslation(); const colors = useColors(); const [busy, setBusy] = useState(false); async function handleReactivate() { if (busy) return; setBusy(true); try { await onReactivate(); onClose(); } finally { setBusy(false); } } return ( {/* Hero-Icon */} {/* Body-Text */} {t('blocker.protection_off_message')} {/* Primary CTA — blau, prominent */} {busy ? t('common.loading') : t('blocker.reactivate_btn')} {/* Secondary CTA — Ghost-Link, klein */} {t('blocker.protection_off_later')} ); }