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(); // Get the first email and phone number if they exist const firstEmail = contact.contactEmails?.[0]; const firstPhone = contact.contactPhones?.[0]; return (