import React, { useEffect } from "react"; import Avatar from "../common/Avatar"; import { getEmailIcon, getPhoneIcon } from "./DirectoryUtils"; import { useDir } from "../../Context/DireContext"; const ListViewDirectory = ({ IsActive, contact, setSelectedContact, setIsOpenModal, setOpen_contact, setIsOpenModalNote, IsDeleted, restore, }) => { const { dirActions, setDirActions } = useDir(); return ( { if (IsActive) { setIsOpenModalNote(true); setOpen_contact(contact); } }} >
{contact?.name || ""}
{contact.contactEmails.length > 0 ? (contact.contactEmails?.map((email, index) => ( {email.emailAddress} ))):(NA)}
{contact.contactPhones?.length > 0 ? ( contact.contactPhones?.map((phone, index) => ( {phone.phoneNumber} )) ):(NA)}
{contact.organization} {/* {contact?.contactCategory?.name || "Other"} */} {contact?.contactCategory?.name || "Other"} {IsActive && ( <> { setSelectedContact(contact); setIsOpenModal(true); }} > IsDeleted(contact.id)} > )} {!IsActive && ( { setDirActions({ action: false, id: contact.id }); restore(contact.id); }} > )} ); }; export default ListViewDirectory;