From 08431235056e05324cc4a424db74593a356c1a8b Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Mon, 2 Jun 2025 13:19:13 +0530 Subject: [PATCH] handled error , if does'nt have category --- .../Directory/CardViewDirectory.jsx | 69 ++++++++++--------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/src/components/Directory/CardViewDirectory.jsx b/src/components/Directory/CardViewDirectory.jsx index 9ac982c6..e7583a9d 100644 --- a/src/components/Directory/CardViewDirectory.jsx +++ b/src/components/Directory/CardViewDirectory.jsx @@ -33,7 +33,7 @@ const CardViewDirectory = ({ (contact?.name || "").trim().split(" ")[1]?.charAt(0) || "" } />{" "} - {contact.name} + {contact?.name}
{IsActive && ( @@ -68,7 +68,7 @@ const CardViewDirectory = ({
  • IsDeleted(contact.id)} + onClick={() => IsDeleted(contact?.id)} > Delete @@ -95,17 +95,16 @@ const CardViewDirectory = ({
  • - +
  • + +
  • +
  • + {contact.organization} +
  • +
    { if (IsActive) { setIsOpenModalNote(true); @@ -114,17 +113,16 @@ const CardViewDirectory = ({ }} >
    - {contact.contactEmails[0] && ( -
      -
    • - -
    • -
    • - {contact.contactEmails[0].emailAddress} -
    • -
    -)} - + {contact.contactEmails[0] && ( +
      +
    • + +
    • +
    • + {contact.contactEmails[0].emailAddress} +
    • +
    + )} {contact.contactPhones[0] && (
      @@ -141,17 +139,26 @@ const CardViewDirectory = ({
    )} -
      -
    • - -
    • -
    • - {contact.contactCategory.name} -
    • -
    + {contact?.contactCategory?.name ? ( +
      +
    • + +
    • +
    • + {contact?.contactCategory?.name} +
    • +
    + ) : ( +
      +
    • + +
    • +
    • Other
    • +
    + )}
      - {contact.bucketIds?.map((bucketId) => ( + {contact?.bucketIds?.map((bucketId) => (