import type { ReactNode } from 'react'; import { Pressable, StyleSheet, Text, View } from 'react-native'; import { colors } from '../../../src/theme'; interface Props { visible: boolean; onClose?: () => void; title?: string; children: ReactNode; footer?: ReactNode; } /** 浅色底圆角卡片弹窗 + 半透明遮罩 */ export function Modal({ visible, onClose, title, children, footer }: Props) { if (!visible) return null; return ( {title ? {title} : null} {children} {footer ? {footer} : null} ); } const styles = StyleSheet.create({ overlay: { ...StyleSheet.absoluteFill, justifyContent: 'center', alignItems: 'center', zIndex: 100 }, scrim: { ...StyleSheet.absoluteFill, backgroundColor: colors.scrim }, card: { width: '84%', backgroundColor: colors.white, borderRadius: 20, padding: 22, maxHeight: '80%', }, title: { fontSize: 18, fontWeight: '800', color: colors.textPrimary, marginBottom: 12, textAlign: 'center' }, body: { gap: 10 }, footer: { marginTop: 18, gap: 10 }, });