diff --git a/src/components/ServiceProject/ServiceBranch.jsx b/src/components/ServiceProject/ServiceBranch.jsx index 982b4ab4..fc0bf1ac 100644 --- a/src/components/ServiceProject/ServiceBranch.jsx +++ b/src/components/ServiceProject/ServiceBranch.jsx @@ -22,12 +22,11 @@ const ServiceBranch = () => { const { data, isLoading, isError, error } = useBranches( projectId, - debouncedSearch || null, - null, + true, + ITEMS_PER_PAGE, currentPage, - ITEMS_PER_PAGE + debouncedSearch, ); - const paginate = (page) => { if (page >= 1 && page <= (data?.totalPages ?? 1)) { setCurrentPage(page); @@ -68,30 +67,38 @@ const ServiceBranch = () => {
{/* {Array.isArray(filteredData) && filteredData.length > 0 && ( */} - +
{ServiceBranch.map((col) => ( - ))} - - {/* + {isLoading ? ( + ) : isError ? ( + + + ) : data?.data?.length > 0 ? ( data.data.map((branch) => ( - - - + + {ServiceBranch.map((col) => ( + + ))} )) @@ -112,9 +119,7 @@ const ServiceBranch = () => { )} - */} - - +
+ {col.label} Action
Loading...
+ {error?.message || "Error loading branches"} +
{branch.branchName}
+ {col.getValue(branch)} + { branchId: branch.id, }) } - > + />
{/* )} */} {/* {!filteredData ||