diff --git a/src/pages/Directory/Directory.jsx b/src/pages/Directory/Directory.jsx index c80ec0f2..ca95181f 100644 --- a/src/pages/Directory/Directory.jsx +++ b/src/pages/Directory/Directory.jsx @@ -353,7 +353,7 @@ const Directory = ({ IsPage = true, prefernceContacts }) => { setOpenBucketModal={setOpenBucketModal} contactsToExport={contacts} notesToExport={notes} - selectedNoteNames={selectedNoteNames} + selectedNoteNames={selectedNoteNames} setSelectedNoteNames={setSelectedNoteNames} notesForFilter={notes} setFilterAppliedNotes={setFilterAppliedNotes} @@ -361,35 +361,25 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
- {/* LIST VIEW */} + {(viewType === "card" || viewType === "list" || viewType === "notes") && ( +
+ {!loading && (viewType === "card" || viewType === "list") && contacts?.length === 0 && ( +

No contact found

+ )} + {!loading && + (viewType === "card" || viewType === "list") && + contacts?.length > 0 && + currentItems.length === 0 && ( +

No matching contact found

+ )} +
+ )} + {viewType === "list" && ( -
-
+
+
- {!loading && contacts?.length === 0 ? ( - - -
-

No contact found

-
- - - ) : !loading && contacts?.length > 0 && currentItems.length === 0 ? ( - - -
-

No matching contact found

-
- - - ) : ( - !loading && + {!loading && currentItems.map((contact) => ( { IsDeleted={setDeleteContact} restore={handleDeleteContact} /> - )) - )} + ))}
)} - {/* CARD VIEW */} {viewType === "card" && ( - <> - {contacts?.length === 0 && !loading ? ( -
-

No contact found

-
- ) : currentItems.length === 0 && !loading ? ( -
-

No matching contact found

-
- ) : ( -
- {currentItems.map((contact) => ( -
- -
- ))} -
- )} - +
+ {!loading && + currentItems.map((contact) => ( +
+ +
+ ))} +
)} - {/* NOTES VIEW */} {viewType === "notes" && (
{ setNotesForFilter={setNotes} searchText={searchText} setIsOpenModalNote={setIsOpenModalNote} - filterAppliedNotes={filterAppliedNotes} + filterAppliedNotes={filterAppliedNotes} />
)} - {/* PAGINATION */} + {/* Pagination */} {!loading && viewType !== "notes" && contacts?.length > 0 && @@ -494,10 +464,7 @@ const Directory = ({ IsPage = true, prefernceContacts }) => { ))} -
  • +
  • -
    ); };