import type { ReactNode } from 'react'; import { KeyboardAvoidingView, Modal, Platform, Pressable, ScrollView, StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; import { AppText } from './app-text'; import { IconButton } from './icon-button'; import { colors, radius, shadow, spacing } from './tokens'; type Props = { visible: boolean; title: string; onClose: () => void; children: ReactNode; footer?: ReactNode; style?: StyleProp; testID?: string; }; /** Shared modal sheet with keyboard-safe padding and a single accessible close control. */ export function BottomSheet({ visible, title, onClose, children, footer, style, testID }: Props) { return {title} {children} {footer ? {footer} : null} ; } const styles = StyleSheet.create({ overlay: { flex: 1, justifyContent: 'flex-end', backgroundColor: colors.neutral.scrim }, backdrop: { ...StyleSheet.absoluteFillObject }, keyboard: { width: '100%', maxHeight: '92%' }, sheet: { borderTopLeftRadius: radius.sheet, borderTopRightRadius: radius.sheet, backgroundColor: colors.neutral.surface, paddingHorizontal: spacing[6], paddingTop: spacing[3], ...shadow.floating }, handle: { width: 36, height: 4, alignSelf: 'center', borderRadius: radius.pill, backgroundColor: colors.neutral.border }, header: { minHeight: 60, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: spacing[4] }, body: { paddingBottom: spacing[5] }, footer: { paddingTop: spacing[3], paddingBottom: spacing[3], borderTopWidth: 1, borderTopColor: colors.neutral.divider }, });