import { View, Text, TouchableOpacity, ActivityIndicator } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useColors } from '../../lib/theme'; type Props = { remainingFormatted: string; // "23:59:42" onCancel: () => Promise; }; export function CooldownBanner({ remainingFormatted, onCancel }: Props) { const { t } = useTranslation(); const colors = useColors(); const [cancelling, setCancelling] = useState(false); async function handleCancel() { setCancelling(true); try { await onCancel(); } finally { setCancelling(false); } } return ( {t('blocker.cooldown_banner_title')} {remainingFormatted} {cancelling ? ( ) : ( {t('common.cancel')} )} ); }