diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx index 311fa763..229bdf2b 100644 --- a/src/components/Dashboard/Dashboard.jsx +++ b/src/components/Dashboard/Dashboard.jsx @@ -27,35 +27,7 @@ const Dashboard = () => { return (
- {isAllProjectsSelected && ( -
- -
- )} - -
- -
- -
- -
- - {isAllProjectsSelected && ( -
- -
- )} - - {!isAllProjectsSelected && ( -
- -
- )} - -
- -
+ {!isAllProjectsSelected && (
{/* ✅ Removed unnecessary projectId prop */} diff --git a/src/components/Directory/ListViewContact.jsx b/src/components/Directory/ListViewContact.jsx index 16e737a7..68eb13b5 100644 --- a/src/components/Directory/ListViewContact.jsx +++ b/src/components/Directory/ListViewContact.jsx @@ -4,8 +4,9 @@ import Pagination from "../common/Pagination"; import { useDirectoryContext } from "../../pages/Directory/DirectoryPage"; import { useActiveInActiveContact } from "../../hooks/useDirectory"; import ConfirmModal from "../common/ConfirmModal"; +import Loader from "../common/Loader"; -const ListViewContact = ({ data, Pagination }) => { +const ListViewContact = ({ data, Pagination, isLoading }) => { const { showActive, setManageContact, setContactOpen } = useDirectoryContext(); const [deleteContact, setDeleteContact] = useState({ @@ -97,103 +98,112 @@ const ListViewContact = ({ data, Pagination }) => { paramData={deleteContact.contactId} isOpen={deleteContact.Open} /> -
+
-
- - - - {contactList?.map((col) => ( -
- {col.label} + {isLoading && ( +
+ +
+ )} + {data && ( +
+ + + + {contactList?.map((col) => ( + + ))} + - ))} - - - - - {Array.isArray(data) && data.length > 0 ? ( - data.map((row, i) => ( - - {contactList.map((col) => ( - - ))} - + + + {Array.isArray(data) && data.length > 0 ? ( + data.map((row, i) => ( + + {contactList.map((col) => ( + + ))} + + + )) + ) : ( + + - )) - ) : ( - - - - - )} - -
+ {col.label} + + Action - Action -
- {col.getValue(row)} - - {showActive ? ( -
- - setContactOpen({ contact: row, Open: true }) - } - > +
+ {col.getValue(row)} + + {showActive ? ( +
+ + setContactOpen({ contact: row, Open: true }) + } + > - - setManageContact({ - isOpen: true, - contactId: row.id, - }) - } - > + + setManageContact({ + isOpen: true, + contactId: row.id, + }) + } + > + + setDeleteContact({ + contactId: row.id, + Open: true, + }) + } + > +
+ ) : ( - setDeleteContact({ - contactId: row.id, - Open: true, - }) - } - > - - ) : ( - { - setActiveContact(row.id); - handleActiveInactive(row.id); - }} - > - )} + title="Restore" + onClick={() => { + setActiveContact(row.id); + handleActiveInactive(row.id); + }} + > + )} +
+ No contacts found
- No contacts found -
- {Pagination && ( -
- {Pagination} -
- )} -
+ )} + +
+ {Pagination && ( +
{Pagination}
+ )} +
+ )} + {data?.length === 0 && !isLoading && ( +
No Expense Found
+ )}
diff --git a/src/components/Directory/ManageContact.jsx b/src/components/Directory/ManageContact.jsx index 04205961..56d45e32 100644 --- a/src/components/Directory/ManageContact.jsx +++ b/src/components/Directory/ManageContact.jsx @@ -23,7 +23,7 @@ import Label from "../common/Label"; const ManageContact = ({ contactId, closeModal }) => { // fetch master data const { buckets, loading: bucketsLoaging } = useBuckets(); - const { projects, loading: projectLoading } = useProjects(); + const { data:projects, loading: projectLoading } = useProjects(); const { contactCategory, loading: contactCategoryLoading } = useContactCategory(); const { organizationList } = useOrganization(); diff --git a/src/components/Layout/Header.jsx b/src/components/Layout/Header.jsx index 970e6003..007c83a8 100644 --- a/src/components/Layout/Header.jsx +++ b/src/components/Layout/Header.jsx @@ -246,16 +246,18 @@ const Header = () => { )}