import React from 'react'; import { View, Text, StyleSheet, TouchableOpacity, Modal } from 'react-native'; export interface ConfirmOption { label: string; onPress?: () => void; destructive?: boolean; } interface ConfirmModalProps { visible: boolean; title: string; message?: string; options: ConfirmOption[]; onClose: () => void; } export function ConfirmModal({ visible, title, message, options, onClose }: ConfirmModalProps) { const stacked = options.length > 2; return ( {}}> {title} {message ? {message} : null} {options.map((opt, i) => ( { onClose(); opt.onPress?.(); }} > {opt.label} ))} ); } const styles = StyleSheet.create({ overlay: { flex: 1, backgroundColor: 'rgba(0,0,0,0.4)', justifyContent: 'center', alignItems: 'center', }, container: { backgroundColor: '#fff', borderRadius: 16, paddingHorizontal: 20, paddingTop: 12, paddingBottom: 20, width: '85%', }, handle: { width: 36, height: 4, borderRadius: 2, backgroundColor: '#ddd', alignSelf: 'center', marginBottom: 16, }, title: { fontSize: 18, fontWeight: '700', color: '#333', marginBottom: 8, }, message: { fontSize: 14, color: '#666', lineHeight: 20, marginBottom: 20, }, optionsContainer: { flexDirection: 'row', gap: 10, }, optionsStacked: { flexDirection: 'column', gap: 0, }, sideBtn: { flex: 1, paddingVertical: 12, borderRadius: 10, alignItems: 'center', }, sideDestructive: { backgroundColor: '#E53935', }, sideBtnSecondary: { backgroundColor: '#f5f5f5', }, sideBtnText: { fontSize: 15, fontWeight: '600', }, sideDestructiveText: { color: '#fff', }, sideBtnSecondaryText: { color: '#666', }, stackedBtn: { paddingVertical: 14, alignItems: 'center', }, stackedBtnBorder: { borderBottomWidth: 1, borderBottomColor: '#f0f0f0', }, stackedDestructive: {}, stackedSecondary: {}, stackedBtnText: { fontSize: 16, fontWeight: '600', }, stackedDestructiveText: { color: '#E53935', }, stackedSecondaryText: { color: '#333', }, });