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, toRgba, formatDate } from '@utils'; export const LeadItemCard: React.FC = ({ item, onPress }) => { const { theme: colors, isDark } = useTheme(); const styles = getStyles(colors); const accent = item.color?.startsWith('#') ? item.color : '#5B4CF5'; const tint = (a: number) => toRgba(accent, isDark ? a + 0.08 : a); return ( {getInitials(item.name)} {item.name || 'No Name'} {(item.company || item.title) && ( {item.company && ( <> {item.company} )} {item.company && item.title && } {item.title && ( {item.title} )} )} {item.status_name || item.status || 'No Status'} {(item.email || item.phonenumber) && ( <> {item.email && ( {item.email} handleEmailPress(item.email)} hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}> )} {item.phonenumber && ( {item.phonenumber} handlePhonePress(item.phonenumber)} hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}> )} )} {(item.source_name || item.source) ? ( {item.source_name || item.source} ) : } {item.dateadded && ( {formatDate(item.dateadded)} )} ); };