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 './leadItemCard.styles'; import { LeadItemCardProps } from './leadItemCard.props'; import { getInitials, handleEmailPress, handlePhonePress, formatDate } from '@utils'; export const LeadItemCard: React.FC = ({ item, onPress }) => { const { theme: colors } = useTheme(); const styles = getStyles(colors); const displayName = item.name || 'No Name'; const initials = getInitials(displayName); const accent = item.color?.startsWith('#') ? item.color : colors.icon; return ( {initials} {displayName} {item.company ? ( {item.company} ) : null} {' '}{item.phonenumber || 'N/A'}{' • '} {' '}{item.email || 'N/A'} {item.source_name || item.source || item.dateadded ? ( {item.source_name || item.source ? ( <> {' '}{item.source_name || item.source} ) : null} {item.dateadded ? ` • ${formatDate(item.dateadded)}` : ''} ) : null} {item.status_name || item.status ? ( {item.status_name || item.status} ) : null} handlePhonePress(item.phonenumber)}> Call handleEmailPress(item.email)}> Email ); };