diff --git a/src/pages/Directory/Directory.jsx b/src/pages/Directory/Directory.jsx index 2509364f..5eaac0ec 100644 --- a/src/pages/Directory/Directory.jsx +++ b/src/pages/Directory/Directory.jsx @@ -38,8 +38,7 @@ const Directory = ({ IsPage = true, prefernceContacts }) => { const [IsDeleting, setDeleting] = useState(false); const [openBucketModal, setOpenBucketModal] = useState(false); const [notes, setNotes] = useState([]); - const [filterAppliedNotes, setFilterAppliedNotes] = useState([]); - const [filterAppliedNotes, setFilterAppliedNotes] = useState([]); + const [filterAppliedNotes, setFilterAppliedNotes] = useState([]); // const [selectedOrgs, setSelectedOrgs] = useState([]); // ✅ Changed to an array for multiple selections @@ -355,7 +354,6 @@ const Directory = ({ IsPage = true, prefernceContacts }) => { contactsToExport={contacts} notesToExport={notes} selectedNoteNames={selectedNoteNames} - selectedNoteNames={selectedNoteNames} setSelectedNoteNames={setSelectedNoteNames} notesForFilter={notes} setFilterAppliedNotes={setFilterAppliedNotes} @@ -363,97 +361,75 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
- {/* LIST VIEW */} - {viewType === "list" && ( -
-
+ {/* Loader when switching between Active/Pending or filtering */} + {loading && ( +
+
+ Loading... +
+
+ )} + + {/* Empty state messages */} + {!loading && (viewType === "card" || viewType === "list") && ( +
+ {contacts?.length === 0 && ( +

No contact found

+ )} + {contacts?.length > 0 && currentItems.length === 0 && ( +

No matching contact found

+ )} +
+ )} + + {/* List View */} + {!loading && viewType === "list" && currentItems.length > 0 && ( +
+
- {!loading && contacts?.length === 0 ? ( - - -
-

No contact found

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

No matching contact found

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

No contact found

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

No matching contact found

-
- ) : ( -
- {currentItems.map((contact) => ( -
- -
- ))} -
- )} - + ))} +
)} - {/* NOTES VIEW */} - {viewType === "notes" && ( + {/* Notes View */} + {!loading && viewType === "notes" && (
{ searchText={searchText} setIsOpenModalNote={setIsOpenModalNote} filterAppliedNotes={filterAppliedNotes} - filterAppliedNotes={filterAppliedNotes} />
)} @@ -470,7 +445,7 @@ const Directory = ({ IsPage = true, prefernceContacts }) => { {!loading && viewType !== "notes" && contacts?.length > 0 && - currentItems.length > ITEMS_PER_PAGE && ( + filteredContacts.length > ITEMS_PER_PAGE && (
-
); }; -export default Directory; \ No newline at end of file +export default Directory; + diff --git a/src/pages/project/ProjectDetails.jsx b/src/pages/project/ProjectDetails.jsx index 732255b8..f34586aa 100644 --- a/src/pages/project/ProjectDetails.jsx +++ b/src/pages/project/ProjectDetails.jsx @@ -81,22 +81,9 @@ const ProjectDetails = () => { switch (activePill) { case "profile": { return ( - <> -
-
- {/* About User */} - - - {/* About User */} -
-
- {/* Profile Overview */} - - {/* Profile Overview */} -
+
+
+
@@ -136,8 +123,8 @@ const ProjectDetails = () => { } case "directory": { return ( -
- +
+
); } @@ -177,7 +164,7 @@ const ProjectDetails = () => { ]} > -
+
{projectLoading &&

Loading....

} {/* {!projectLoading && project && (