import React from 'react'; import { View, Text, StyleSheet } from 'react-native'; import { CardHeaderProps } from './types'; import { useTheme } from '../../theme/ThemeContext'; const CardHeader: React.FC = ({ title, subtitle, left, right, style, titleStyle, subtitleStyle, titleColor, subtitleColor, }) => { const {theme} = useTheme(); return ( {left && {left}} {title && typeof title === 'string' ? ( {title} ) : ( title )} {subtitle && typeof subtitle === 'string' ? ( {subtitle} ) : ( subtitle )} {right && {right}} ); }; const styles = StyleSheet.create({ header: { flexDirection: 'row', padding: 16, paddingBottom: 0, // backgroundColor:"red", // alignItems: 'center' }, left: { marginRight: 16, }, headerTextContainer: { flex: 1, }, right: { marginLeft: 16, }, title: { fontSize: 18, fontWeight: '600', }, subtitle: { fontSize: 14, marginTop: 4, }, }); export default CardHeader;