import React from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; import Icon from 'react-native-vector-icons/Ionicons'; import { useTheme } from '@theme'; import { getStyles } from './customerDetailHeader.styles'; import { CustomerDetailHeaderProps } from './customerDetailHeader.props'; import { getInitials, formatDate } from '@utils'; export const CustomerDetailHeader: React.FC = ({ company, fullname, active, datecreated, email, phonenumber, website, onEmailPress, onPhonePress, onWebsitePress, }) => { const { theme: colors } = useTheme(); const styles = getStyles(colors); const displayName = company || fullname || 'Customer'; const initials = getInitials(displayName); return ( {/* Top Row: Avatar + Info + Active Badge */} {initials} {displayName} {fullname && company ? ( {fullname} ) : null} {' '}{phonenumber || 'N/A'}{' '} {' '}{email || 'N/A'} {datecreated ? ( Added {formatDate(datecreated)} ) : null} {active === '1' ? 'Active' : 'Inactive'} {/* Bottom Row: Action Buttons */} {phonenumber ? ( Call ) : null} {email ? ( Email ) : null} {website ? ( Website ) : null} ); };