import React from 'react'; import {View, Text, StyleProp, ViewStyle, TextStyle, StyleSheet} from 'react-native'; import CheckBox from './checkbox'; import Touchable from './touchable'; type HeaderStyle = StyleProp & {text?: TextStyle}; type CheckListHeaderProps = { children?: React.ReactNode; text?: string; style?: HeaderStyle; checkboxProp?: React.ComponentProps['checkboxProp']; onPress?: () => void; isActive?: boolean; theme: string; }; const CheckListHeader = ({ children = null, text = '', style, checkboxProp, onPress = () => {}, isActive = false, theme, }: CheckListHeaderProps) => { const flattenedStyle = StyleSheet.flatten(style) || {}; const headerTextStyle = (style as {text?: TextStyle})?.text || {}; return ( {!!text && ( {text} )} {children} ); }; export default CheckListHeader;