import React, { useEffect, useRef } from 'react'; import { StyleSheet, Animated, TouchableOpacity } from 'react-native'; import { View, Text, useTheme } from '@bettoredge/styles'; import { Ionicons } from '@expo/vector-icons'; export interface AuctionPausedOverlayProps { visible: boolean; isAdmin?: boolean; onResume?: () => void; resuming?: boolean; } export const AuctionPausedOverlay: React.FC = ({ visible, isAdmin, onResume, resuming, }) => { const { theme } = useTheme(); const opacityAnim = useRef(new Animated.Value(0)).current; const pulseAnim = useRef(new Animated.Value(1)).current; useEffect(() => { if (visible) { Animated.timing(opacityAnim, { toValue: 1, duration: 300, useNativeDriver: true }).start(); const loop = Animated.loop( Animated.sequence([ Animated.timing(pulseAnim, { toValue: 0.5, duration: 1200, useNativeDriver: true }), Animated.timing(pulseAnim, { toValue: 1, duration: 1200, useNativeDriver: true }), ]) ); loop.start(); return () => loop.stop(); } else { Animated.timing(opacityAnim, { toValue: 0, duration: 200, useNativeDriver: true }).start(); } }, [visible]); if (!visible) return null; return ( Auction Paused {isAdmin ? 'The auction is paused. Resume when ready.' : 'The host has paused the auction.\nBidding will resume shortly.'} {isAdmin && onResume && ( {resuming ? 'Resuming...' : 'Resume Auction'} )} {!isAdmin && ( Waiting for host... )} ); }; const styles = StyleSheet.create({ overlay: { ...StyleSheet.absoluteFillObject, zIndex: 999, alignItems: 'center', justifyContent: 'center', }, backdrop: { ...StyleSheet.absoluteFillObject, backgroundColor: 'rgba(0,0,0,0.80)', }, content: { alignItems: 'center', padding: 40, }, iconCircle: { width: 100, height: 100, borderRadius: 50, backgroundColor: '#EF4444', alignItems: 'center', justifyContent: 'center', marginBottom: 24, }, title: { color: '#FFFFFF', fontSize: 28, lineHeight: 36, fontWeight: '800', marginBottom: 8, }, subtitle: { color: 'rgba(255,255,255,0.7)', fontSize: 16, textAlign: 'center', lineHeight: 22, marginBottom: 32, }, resumeButton: { flexDirection: 'row', alignItems: 'center', backgroundColor: '#10B981', paddingHorizontal: 28, paddingVertical: 14, borderRadius: 12, }, resumeText: { color: '#FFFFFF', fontSize: 17, lineHeight: 24, fontWeight: '700', marginLeft: 10, }, waitingRow: { flexDirection: 'row', alignItems: 'center', }, waitingDot: { width: 8, height: 8, borderRadius: 4, backgroundColor: '#F59E0B', marginRight: 8, }, waitingText: { color: 'rgba(255,255,255,0.5)', fontSize: 14, lineHeight: 19, }, });