diff --git a/src/components/Directory/ListViewDirectory.jsx b/src/components/Directory/ListViewDirectory.jsx index 801d9915..a216a3b0 100644 --- a/src/components/Directory/ListViewDirectory.jsx +++ b/src/components/Directory/ListViewDirectory.jsx @@ -15,6 +15,10 @@ const ListViewDirectory = ({ }) => { const { dirActions, setDirActions } = useDir(); + // Get the first email and phone number if they exist + const firstEmail = contact.contactEmails?.[0]; + const firstPhone = contact.contactPhones?.[0]; + return (
- {contact.contactEmails.length > 0 ? (contact.contactEmails?.map((email, index) => ( - + {firstEmail ? ( + - {email.emailAddress} + {firstEmail.emailAddress} - ))):(NA)} + ) : ( + NA + )}
- {contact.contactPhones?.length > 0 ? ( - contact.contactPhones?.map((phone, index) => ( - + {firstPhone ? ( + - {phone.phoneNumber} + {firstPhone.phoneNumber} - )) - ):(NA)} + ) : ( + NA + )}
@@ -88,12 +94,6 @@ const ListViewDirectory = ({ {contact.organization} - {/* - - {contact?.contactCategory?.name || "Other"} - - */} - {contact?.contactCategory?.name || "Other"} @@ -118,9 +118,10 @@ const ListViewDirectory = ({ )} {!IsActive && ( {