import React from 'react'; import {View, StyleProp, ViewStyle, StyleSheet} from 'react-native'; import CheckBox from './checkbox'; import Touchable from './touchable'; import {ListItem, RenderItem} from './types'; type CheckListItemProps = { children?: React.ReactNode; item?: ListItem | null; style?: StyleProp; checkboxProp?: React.ComponentProps['checkboxProp']; onPress?: () => void; isActive?: boolean; theme: string; renderItem: RenderItem; }; const CheckListItem = ({ children = null, item = null, style, checkboxProp, onPress = () => {}, isActive = false, theme, renderItem, }: CheckListItemProps) => { const flattenedStyle = StyleSheet.flatten(style) || {}; return ( {!!item && {renderItem({item})}} {children} ); }; export default CheckListItem;