import type { ReactNode } from 'react'; import { Pressable, StyleSheet, Text, View } from 'react-native'; import { colors, spacing } 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: 8, padding: 8, maxHeight: '80%', }, title: { fontSize: 18, fontWeight: '800', color: colors.textPrimary, marginBottom: spacing.block, textAlign: 'center' }, body: { gap: spacing.sm }, footer: { marginTop: spacing.block, gap: spacing.sm }, });