From 7773b7a43bb74e385158d5ade48f7527cc21cdbf Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Wed, 19 Nov 2025 12:59:57 +0530 Subject: [PATCH] Adding Status and UI implementation in Collection. --- src/components/collections/CollectionList.jsx | 13 +++++- src/components/collections/ViewCollection.jsx | 16 +++----- src/pages/collections/CollectionPage.jsx | 41 ++++++++++--------- 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/components/collections/CollectionList.jsx b/src/components/collections/CollectionList.jsx index bb94130e..339828ed 100644 --- a/src/components/collections/CollectionList.jsx +++ b/src/components/collections/CollectionList.jsx @@ -27,7 +27,7 @@ const CollectionList = ({ fromDate, toDate, isPending, searchString }) => { const selectedProject = useSelectedProject(); const searchDebounce = useDebounce(searchString, 500); - + const { data, isLoading, isError, error } = useCollections( selectedProject, searchDebounce, @@ -40,7 +40,6 @@ const CollectionList = ({ fromDate, toDate, isPending, searchString }) => { ); const { setProcessedPayment, setAddPayment, setViewCollection } = useCollectionContext(); - const paginate = (page) => { if (page >= 1 && page <= (data?.totalPages ?? 1)) { setCurrentPage(page); @@ -129,6 +128,16 @@ const CollectionList = ({ fromDate, toDate, isPending, searchString }) => { ), align: "text-end", }, + { + key: "status", + label: "Status", + getValue: (col) => ( + + {col?.isActive ? "Active" : "Inactive"} + + ), + align: "text-center", + }, { key: "balance", label: "Balance", diff --git a/src/components/collections/ViewCollection.jsx b/src/components/collections/ViewCollection.jsx index 77bc78fe..fdf563b9 100644 --- a/src/components/collections/ViewCollection.jsx +++ b/src/components/collections/ViewCollection.jsx @@ -25,7 +25,6 @@ const ViewCollection = ({ onClose }) => { if (isLoading) return ; if (isError) return
{error.message}
; - return (

Collection Details

@@ -43,9 +42,8 @@ const ViewCollection = ({ onClose }) => {
{" "} {data?.isActive ? "Active" : "Inactive"} @@ -214,9 +212,8 @@ const ViewCollection = ({ onClose }) => {
  • +
{/* Right side: Search + Add Button */}
+ + +