import React from 'react'; import { View, Text, Modal, TouchableOpacity, StyleSheet } from 'react-native'; interface InsufficientCreditsModalProps { visible: boolean; requiredCredits: number; availableCredits: number; operation?: string; onClose: () => void; onPurchase?: () => void; } /** * Modal shown when user has insufficient mana credits */ export function InsufficientCreditsModal({ visible, requiredCredits, availableCredits, operation = 'this operation', onClose, onPurchase, }: InsufficientCreditsModalProps) { const shortfall = requiredCredits - availableCredits; return ( {/* Header */} Insufficient Mana {/* Content */} You don't have enough mana to {operation}. Required: {requiredCredits} mana Available: {availableCredits} mana Needed: {shortfall} mana {/* Actions */} {onPurchase && ( Get More Mana )} Cancel ); } const styles = StyleSheet.create({ overlay: { flex: 1, backgroundColor: 'rgba(0, 0, 0, 0.5)', justifyContent: 'center', alignItems: 'center', padding: 20, }, modalContainer: { backgroundColor: 'white', borderRadius: 16, width: '100%', maxWidth: 400, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.25, shadowRadius: 8, elevation: 5, }, header: { alignItems: 'center', paddingTop: 24, paddingBottom: 16, borderBottomWidth: 1, borderBottomColor: '#f0f0f0', }, icon: { fontSize: 48, marginBottom: 8, }, title: { fontSize: 22, fontWeight: '600', color: '#1a1a1a', }, content: { padding: 24, }, message: { fontSize: 16, color: '#666', textAlign: 'center', marginBottom: 20, lineHeight: 24, }, creditsInfo: { backgroundColor: '#f8f9fa', borderRadius: 12, padding: 16, }, creditsRow: { flexDirection: 'row', justifyContent: 'space-between', marginBottom: 12, }, shortfallRow: { marginBottom: 0, paddingTop: 12, borderTopWidth: 1, borderTopColor: '#e0e0e0', }, label: { fontSize: 15, color: '#666', fontWeight: '500', }, value: { fontSize: 15, color: '#1a1a1a', fontWeight: '600', }, shortfall: { color: '#dc2626', }, actions: { padding: 16, gap: 12, }, button: { paddingVertical: 14, paddingHorizontal: 24, borderRadius: 12, alignItems: 'center', }, primaryButton: { backgroundColor: '#3b82f6', }, primaryButtonText: { color: 'white', fontSize: 16, fontWeight: '600', }, secondaryButton: { backgroundColor: 'transparent', borderWidth: 1, borderColor: '#d1d5db', }, secondaryButtonText: { color: '#6b7280', fontSize: 16, fontWeight: '500', }, });