import React, { useEffect, useState } from "react"; import { useContactProfile } from "../../hooks/useDirectory"; import Avatar from "../common/Avatar"; import moment from "moment"; import NotesDirectory from "./NotesDirectory"; const ProfileContactDirectory = ({ contact, setOpen_contact, closeModal }) => { const { conatProfile, loading } = useContactProfile(contact?.id); const [profileContact, setProfileContact] = useState(); useEffect(() => { setProfileContact(conatProfile); }, [conatProfile]); return (

Contact Profile

{contact?.name} {" "} {conatProfile?.organization} Manager
{conatProfile?.contactEmails?.length > 0 && (

Email

    {conatProfile.contactEmails.map((email, idx) => (
  • {email.emailAddress}
  • ))}
)} {conatProfile?.contactPhones?.length > 0 && (

Phone

    {conatProfile?.contactPhones.map((phone, idx) => (
  • {phone.phoneNumber}
  • ))}
)} {conatProfile?.createdAt && (

Created

  • {moment(conatProfile.createdAt).format("MMMM, DD YYYY")}
)}
{ conatProfile?.buckets?.length > 0 &&
{conatProfile?.contactEmails?.length > 0 && (

Buckets

    {conatProfile.buckets.map((bucket) => (
  • { bucket.name}
  • ))}
)}
}

); }; export default ProfileContactDirectory;