+ {mode === 'delete' && (
+
+ setModalVisible(false)}
+ onConfirm={confirmDelete}
+ message="Are you sure you want to Delete this customer ?"
+ />
+
+ )}
+ {deactivate && (
+
+
+
+ Are you sure you want to suspend?
+
+ {clickedcustomer?.firstName}
+
+
+
+
+
+
+ )}
+
+ {activate && (
+
+
+
+ Are you sure you want to activate?
+
+ {clickedcustomer?.firstName}
+
+
+
+ setActivate(false)}
+ />
+ HandleActivate(clickedcustomer)}
+ />
+
+
+
+ )}
+
+
+
+
+
+
All ({customers.length})
+
+ Approved ({customers.filter((v) => v.status === 'active').length})
+
+
+ Suspended (
+ {customers.filter((v) => v.status === 'inactive').length})
+
+
+
+
+ HandleSearch(e.target.value)}
+ />
+
+
+
+
+ {status === 'loading' && (
+
+ )}
+
+
+
+
+
Image
+
+ First Name
+
+
+ Last Name
+
+
Email
+
Date
+
Status
+
Role
+
Action
+
+ {customers.length > 0 ? (
+ visiblePage.map((v, id) => (
+
+
+
+
+
+ {v.firstName}
+
+
+ {v.lastName}
+
+
+ {v.email}
+
+
+ {DateFormat(v.updatedAt)}
+
+
+
+ {v.status}
+
+
+
+
Buyer
+
+ handleRole(v)}
+ />
+
+
+
+
HandleActive(v)}>
+
+
+
HandleEdit(v)}>
+
+
+
HandleDelete(v)}
+ >
+
+
+
+
+ ))
+ ) : (
+
No customer Found
+ )}
+
+ HandlePrev()}
+ >
+
+
+ {pages &&
+ pages.map((page) => (
+ setCurrentPage(page)}
+ >
+ {`${page} `}
+
+ ))}
+ HandleNext()}
+ >
+
+
+
+
+
+
+
+ {customers &&
+ visiblePage.map((v, id) => (
+
+
+
+
+
+ {v.firstName} {v.lastName}
+
+
{v.email}
+
+
+
+
First Name: {v.firstName}
+
Date: {DateFormat(v.updatedAt)}
+
+ Status:
+
+ {v.status}
+
+
+
+
+
HandleActive(v)}
+ className="mr-2"
+ >
+
+
+
+ HandleEdit(v)}
+ />
+
+
HandleDelete(v)}
+ >
+
+
+
+
+ ))}
+
+
+
+
+
+
+ Processing....
+
+
+
+
+ {/* -------------------------------------------------------- */}
+ {updateRole && (
+
+
+
+
+
Change Role
+
+
Current Details:
+
+
Name:
+
+ {clickedcustomer?.firstName} {clickedcustomer?.lastName}
+
+
+
+
Email:
+ {clickedcustomer?.email}
+
+
+
Status:
+
+ {clickedcustomer?.status}
+
+
+
+
Current Role:
+
+ Buyer
+
+
+
+
+
+ Make change:
+
+
+
Select Role
+
+
+
+
+
+
+
+
+ closedit()}
+ type="button"
+ className="ml-4 text-xl text-gray-400 hover:text-gray-600"
+ >
+
+
+
+
+
+
+ comformedit()}
+ className="px-4 py-1 bg-primary text-sm text-white rounded-md"
+ >
+ Edit
+
+ closedit()}
+ className="px-4 py-1 bg-red-500 text-sm text-white rounded-md"
+ >
+ Concel
+
+
+
+
+ )}
+ {/* -------------------------------------------------------- */}
+
+ );
+}
+
+export default Customer;
diff --git a/src/routes/AppRoutes.tsx b/src/routes/AppRoutes.tsx
index 25bcaa1..bb9c1d1 100644
--- a/src/routes/AppRoutes.tsx
+++ b/src/routes/AppRoutes.tsx
@@ -27,6 +27,7 @@ import AddCoupon from '@/pages/AddCoupon';
import Coupons from '@/pages/Coupons';
import EditCoupon from '@/pages/EditCoupon';
import TableUserRole from '@/components/dashBoard/UserRole';
+import Customer from '@/pages/customer';
function AppRoutes() {
return (
@@ -66,6 +67,7 @@ function AppRoutes() {