import { Text } from 'react-native'; import React from 'react'; import { BottomSheetView, BottomSheetFlatList } from '@gorhom/bottom-sheet'; import I18n from '../../i18n'; import { useTheme } from '../../theme'; import { IActionSheetItem, Item } from './Item'; import { TActionSheetOptionsItem } from './Provider'; import styles from './styles'; import * as List from '../List'; import Touch from '../Touch'; interface IBottomSheetContentProps { hasCancel?: boolean; options?: TActionSheetOptionsItem[]; hide: () => void; children?: React.ReactElement | null; } const BottomSheetContent = React.memo(({ options, hasCancel, hide, children }: IBottomSheetContentProps) => { const { colors } = useTheme(); const renderFooter = () => hasCancel ? ( {I18n.t('Cancel')} ) : null; const renderItem = ({ item }: { item: IActionSheetItem['item'] }) => ; if (options) { return ( item.title} bounces={true} renderItem={renderItem} style={{ backgroundColor: colors.focusedBackground }} keyboardDismissMode='interactive' indicatorStyle='black' contentContainerStyle={styles.content} ItemSeparatorComponent={List.Separator} ListHeaderComponent={List.Separator} ListFooterComponent={renderFooter} /> ); } return ( {children} ); }); export default BottomSheetContent;