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 './leadDetailHeader.styles'; import { LeadDetailHeaderProps } from './leadDetailHeader.props'; export const LeadDetailHeader: React.FC = ({ name, company, email, phonenumber, statusName, statusColor, avatarColor, onStatusPress, onEmailPress, onPhonePress, }) => { const { theme: colors } = useTheme(); const styles = getStyles(colors); // Get initials from name const getInitials = (name: string): string => { if (!name) return '?'; const nameParts = name.trim().split(' '); if (nameParts.length >= 2) { return (nameParts[0][0] + nameParts[1][0]).toUpperCase(); } return name.substring(0, 2).toUpperCase(); }; return ( {/* Avatar */} {getInitials(name)} {/* Name and Status Row */} {name || 'No Name'} {statusName || 'No Status'} {/* Company */} {company && {company}} {/* Email Row */} {email && ( Email: {email} {onEmailPress && ( )} )} {/* Phone Row */} {phonenumber && ( Phone: {phonenumber} {onPhonePress && ( )} )} ); };