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 { contactProfile, loading, refetch } = useContactProfile(contact?.id); const [copiedIndex, setCopiedIndex] = useState(null); const [profileContact, setProfileContact] = useState(); const [expanded, setExpanded] = useState(false); const description = contactProfile?.description || ""; const limit = 500; const toggleReadMore = () => setExpanded(!expanded); const isLong = description.length > limit; const displayText = expanded ? description : description.slice(0, limit) + (isLong ? "..." : ""); useEffect(() => { setProfileContact(contactProfile); }, [contactProfile]); const handleCopy = (email, index) => { navigator.clipboard.writeText(email); setCopiedIndex(index); setTimeout(() => setCopiedIndex(null), 2000); // Reset after 2 seconds }; return (
Contact Profile
Email:
Phone :
Created :
Location:
Orgnization :
Category :
Tags :
Buckets :
Projects :
Description :