@burdenoff/microfe-adaptercloud 2026.614.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/adaptercloud/AdapterCloudRoot.js +177 -0
- package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -0
- package/dist/adaptercloud/AdapterCloudRoutes.js +215 -0
- package/dist/adaptercloud/AdapterCloudRoutes.js.map +1 -0
- package/dist/adaptercloud/components/EmptyState.js +28 -0
- package/dist/adaptercloud/components/EmptyState.js.map +1 -0
- package/dist/adaptercloud/components/InvestmentCard.js +96 -0
- package/dist/adaptercloud/components/InvestmentCard.js.map +1 -0
- package/dist/adaptercloud/components/MetricsCard.js +46 -0
- package/dist/adaptercloud/components/MetricsCard.js.map +1 -0
- package/dist/adaptercloud/components/PageLayout.js +26 -0
- package/dist/adaptercloud/components/PageLayout.js.map +1 -0
- package/dist/adaptercloud/components/RatingDisplay.js +35 -0
- package/dist/adaptercloud/components/RatingDisplay.js.map +1 -0
- package/dist/adaptercloud/components/StatusBadge.js +45 -0
- package/dist/adaptercloud/components/StatusBadge.js.map +1 -0
- package/dist/adaptercloud/context/AdapterCloudContext.js +93 -0
- package/dist/adaptercloud/context/AdapterCloudContext.js.map +1 -0
- package/dist/adaptercloud/context/index.js +1 -0
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js +223 -0
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -0
- package/dist/adaptercloud/index.js +7 -0
- package/dist/adaptercloud/mocks/data.js +1517 -0
- package/dist/adaptercloud/mocks/data.js.map +1 -0
- package/dist/adaptercloud/mocks/users.js +34 -0
- package/dist/adaptercloud/mocks/users.js.map +1 -0
- package/dist/adaptercloud/pages/HomePage.js +921 -0
- package/dist/adaptercloud/pages/HomePage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +645 -0
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminDashboard.js +639 -0
- package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +421 -0
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +660 -0
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js +259 -0
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +649 -0
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/CartManagementPage.js +869 -0
- package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/UserManagementPage.js +893 -0
- package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +834 -0
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +700 -0
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +760 -0
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +886 -0
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +631 -0
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +913 -0
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +881 -0
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +833 -0
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -0
- package/dist/adaptercloud/pages/common/HelpSupportPage.js +1325 -0
- package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -0
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js +665 -0
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -0
- package/dist/adaptercloud/pages/common/SettingsPage.js +964 -0
- package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +593 -0
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/CartDetailPage.js +620 -0
- package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +547 -0
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/CheckoutPage.js +532 -0
- package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js +496 -0
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +621 -0
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +623 -0
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/FavoritesPage.js +477 -0
- package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +438 -0
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +388 -0
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +488 -0
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/ReviewsPage.js +606 -0
- package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +443 -0
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +849 -0
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +939 -0
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +681 -0
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js +419 -0
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +399 -0
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +569 -0
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +1065 -0
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -0
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +496 -0
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -0
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js +634 -0
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +675 -0
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -0
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +687 -0
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -0
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +578 -0
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -0
- package/dist/adaptercloud/store/adaptercloudStore.js +38 -0
- package/dist/adaptercloud/store/adaptercloudStore.js.map +1 -0
- package/dist/adaptercloud/store/index.js +1 -0
- package/dist/adaptercloud/utils/cn.js +10 -0
- package/dist/adaptercloud/utils/cn.js.map +1 -0
- package/dist/adaptercloud/utils/formatters.js +51 -0
- package/dist/adaptercloud/utils/formatters.js.map +1 -0
- package/dist/adaptercloud/utils/navigation.js +9 -0
- package/dist/adaptercloud/utils/navigation.js.map +1 -0
- package/dist/index.js +7 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
- package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/package.json +106 -0
|
@@ -0,0 +1,893 @@
|
|
|
1
|
+
import { useAdapterCloud as e } from "../../context/AdapterCloudContext.js";
|
|
2
|
+
import { cn as t } from "../../utils/cn.js";
|
|
3
|
+
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
+
import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
5
|
+
import { ChevronLeft as s, ChevronRight as c, Edit3 as l, Loader2 as u, Search as d, Shield as f, Smartphone as p, Trash2 as m, UserCheck as h, UserX as g, Users as _, X as v } from "lucide-react";
|
|
6
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
7
|
+
//#region src/adaptercloud/pages/admin/UserManagementPage.tsx
|
|
8
|
+
var S = [
|
|
9
|
+
{
|
|
10
|
+
id: "user-001",
|
|
11
|
+
email: "rahul.sharma@gmail.com",
|
|
12
|
+
phone: "+91 98765 43210",
|
|
13
|
+
firstName: "Rahul",
|
|
14
|
+
lastName: "Sharma",
|
|
15
|
+
role: "customer",
|
|
16
|
+
isEmailVerified: !0,
|
|
17
|
+
isPhoneVerified: !0,
|
|
18
|
+
profilePicture: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100",
|
|
19
|
+
status: "active",
|
|
20
|
+
lastLoginTime: "2024-06-23T16:45:00Z",
|
|
21
|
+
totalOrders: 45,
|
|
22
|
+
totalSpent: 12350,
|
|
23
|
+
registrationDate: "2024-01-15T08:30:00Z",
|
|
24
|
+
deviceInfo: "iPhone 14 Pro"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "user-002",
|
|
28
|
+
email: "priya.patel@gmail.com",
|
|
29
|
+
phone: "+91 98765 43211",
|
|
30
|
+
firstName: "Priya",
|
|
31
|
+
lastName: "Patel",
|
|
32
|
+
role: "cart_owner",
|
|
33
|
+
isEmailVerified: !0,
|
|
34
|
+
isPhoneVerified: !0,
|
|
35
|
+
profilePicture: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=100",
|
|
36
|
+
status: "active",
|
|
37
|
+
lastLoginTime: "2024-06-24T09:15:00Z",
|
|
38
|
+
totalEarnings: 285e3,
|
|
39
|
+
kycStatus: "verified",
|
|
40
|
+
registrationDate: "2023-08-20T10:15:00Z",
|
|
41
|
+
deviceInfo: "Android Samsung"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "user-003",
|
|
45
|
+
email: "amit.kumar@gmail.com",
|
|
46
|
+
phone: "+91 98765 43212",
|
|
47
|
+
firstName: "Amit",
|
|
48
|
+
lastName: "Kumar",
|
|
49
|
+
role: "worker",
|
|
50
|
+
isEmailVerified: !0,
|
|
51
|
+
isPhoneVerified: !1,
|
|
52
|
+
profilePicture: "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=100",
|
|
53
|
+
status: "suspended",
|
|
54
|
+
lastLoginTime: "2024-06-15T14:30:00Z",
|
|
55
|
+
totalEarnings: 45e3,
|
|
56
|
+
kycStatus: "pending",
|
|
57
|
+
registrationDate: "2024-02-10T12:45:00Z",
|
|
58
|
+
deviceInfo: "Web Browser"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "user-004",
|
|
62
|
+
email: "sneha.investor@gmail.com",
|
|
63
|
+
phone: "+91 98765 43213",
|
|
64
|
+
firstName: "Sneha",
|
|
65
|
+
lastName: "Reddy",
|
|
66
|
+
role: "investor",
|
|
67
|
+
isEmailVerified: !0,
|
|
68
|
+
isPhoneVerified: !0,
|
|
69
|
+
profilePicture: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=100",
|
|
70
|
+
status: "active",
|
|
71
|
+
lastLoginTime: "2024-06-24T10:30:00Z",
|
|
72
|
+
kycStatus: "verified",
|
|
73
|
+
riskScore: 2.1,
|
|
74
|
+
registrationDate: "2023-12-01T15:20:00Z",
|
|
75
|
+
deviceInfo: "MacBook Pro"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "user-005",
|
|
79
|
+
email: "new.user@gmail.com",
|
|
80
|
+
phone: "+91 98765 43214",
|
|
81
|
+
firstName: "New",
|
|
82
|
+
lastName: "User",
|
|
83
|
+
role: "customer",
|
|
84
|
+
isEmailVerified: !1,
|
|
85
|
+
isPhoneVerified: !1,
|
|
86
|
+
profilePicture: "",
|
|
87
|
+
status: "pending",
|
|
88
|
+
registrationDate: "2024-06-24T09:00:00Z",
|
|
89
|
+
deviceInfo: "iPhone 15"
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
function C() {
|
|
93
|
+
let { navigateTo: C } = e(), [w, T] = o([]), [E, D] = o(!0), [O, k] = o(null), [A, j] = o(!1), [M, N] = o("edit"), [P, F] = o({
|
|
94
|
+
firstName: "",
|
|
95
|
+
lastName: "",
|
|
96
|
+
email: "",
|
|
97
|
+
phone: "",
|
|
98
|
+
role: ""
|
|
99
|
+
}), [I, L] = o(1), [R, z] = o({
|
|
100
|
+
role: "",
|
|
101
|
+
status: "",
|
|
102
|
+
searchQuery: "",
|
|
103
|
+
sortBy: "recent",
|
|
104
|
+
registrationDate: ""
|
|
105
|
+
}), [B] = o({
|
|
106
|
+
totalUsers: 2456,
|
|
107
|
+
activeUsers: 2134,
|
|
108
|
+
newUsers: 89,
|
|
109
|
+
verifiedUsers: 2021,
|
|
110
|
+
customers: 1845,
|
|
111
|
+
cartOwners: 342,
|
|
112
|
+
workers: 156,
|
|
113
|
+
investors: 113
|
|
114
|
+
}), V = r(() => {
|
|
115
|
+
D(!0), setTimeout(() => {
|
|
116
|
+
let e = [...S];
|
|
117
|
+
if (R.searchQuery) {
|
|
118
|
+
let t = R.searchQuery.toLowerCase();
|
|
119
|
+
e = e.filter((e) => e.firstName.toLowerCase().includes(t) || e.lastName.toLowerCase().includes(t) || e.email.toLowerCase().includes(t) || e.phone.includes(t));
|
|
120
|
+
}
|
|
121
|
+
if (R.role && (e = e.filter((e) => e.role === R.role)), R.status && (e = e.filter((e) => e.status === R.status)), R.registrationDate) {
|
|
122
|
+
let t = parseInt(R.registrationDate), n = /* @__PURE__ */ new Date(Date.now() - t * 864e5);
|
|
123
|
+
e = e.filter((e) => new Date(e.registrationDate) >= n);
|
|
124
|
+
}
|
|
125
|
+
switch (R.sortBy) {
|
|
126
|
+
case "name":
|
|
127
|
+
e.sort((e, t) => e.firstName.localeCompare(t.firstName));
|
|
128
|
+
break;
|
|
129
|
+
case "activity":
|
|
130
|
+
e.sort((e, t) => {
|
|
131
|
+
let n = e.lastLoginTime ? new Date(e.lastLoginTime).getTime() : 0;
|
|
132
|
+
return (t.lastLoginTime ? new Date(t.lastLoginTime).getTime() : 0) - n;
|
|
133
|
+
});
|
|
134
|
+
break;
|
|
135
|
+
default: e.sort((e, t) => new Date(t.registrationDate).getTime() - new Date(e.registrationDate).getTime());
|
|
136
|
+
}
|
|
137
|
+
T(e), D(!1);
|
|
138
|
+
}, 800);
|
|
139
|
+
}, [R]);
|
|
140
|
+
i(() => {
|
|
141
|
+
V();
|
|
142
|
+
}, [V]);
|
|
143
|
+
let H = (e, t) => {
|
|
144
|
+
z((n) => ({
|
|
145
|
+
...n,
|
|
146
|
+
[e]: t
|
|
147
|
+
})), L(1);
|
|
148
|
+
}, U = (e, t) => {
|
|
149
|
+
if (t === "suspend" || t === "activate" || t === "verify") {
|
|
150
|
+
let n = t === "suspend" ? `User ${e.firstName} ${e.lastName} suspended` : t === "activate" ? `User ${e.firstName} ${e.lastName} activated` : `User ${e.firstName} ${e.lastName} verified`;
|
|
151
|
+
alert(n), V();
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
k(e), N(t), F({
|
|
155
|
+
firstName: e.firstName,
|
|
156
|
+
lastName: e.lastName,
|
|
157
|
+
email: e.email,
|
|
158
|
+
phone: e.phone,
|
|
159
|
+
role: e.role
|
|
160
|
+
}), j(!0);
|
|
161
|
+
}, W = () => {
|
|
162
|
+
O && (alert(`User ${O.firstName} ${O.lastName} deleted`), j(!1), V());
|
|
163
|
+
}, G = () => {
|
|
164
|
+
alert("User updated successfully"), j(!1), V();
|
|
165
|
+
}, K = (e) => new Date(e).toLocaleDateString("en-IN", {
|
|
166
|
+
year: "numeric",
|
|
167
|
+
month: "short",
|
|
168
|
+
day: "numeric"
|
|
169
|
+
}), q = (e) => `₹${e.toLocaleString("en-IN")}`, J = a(() => {
|
|
170
|
+
let e = (I - 1) * 10;
|
|
171
|
+
return w.slice(e, e + 10);
|
|
172
|
+
}, [w, I]), Y = (e) => /* @__PURE__ */ b("span", {
|
|
173
|
+
className: t("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", {
|
|
174
|
+
customer: "bg-blue-500/20 text-blue-600 dark:text-blue-400",
|
|
175
|
+
cart_owner: "bg-green-500/20 text-green-600 dark:text-green-400",
|
|
176
|
+
worker: "bg-yellow-500/20 text-yellow-600 dark:text-yellow-400",
|
|
177
|
+
investor: "bg-purple-500/20 text-purple-600 dark:text-purple-400",
|
|
178
|
+
admin: "bg-red-500/20 text-red-600 dark:text-red-400"
|
|
179
|
+
}[e]),
|
|
180
|
+
children: {
|
|
181
|
+
customer: "Customer",
|
|
182
|
+
cart_owner: "Cart Owner",
|
|
183
|
+
worker: "Worker",
|
|
184
|
+
investor: "Investor",
|
|
185
|
+
admin: "Admin"
|
|
186
|
+
}[e] ?? e
|
|
187
|
+
}), X = (e) => /* @__PURE__ */ b("span", {
|
|
188
|
+
className: t("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium capitalize", {
|
|
189
|
+
active: "bg-green-500/20 text-green-600 dark:text-green-400",
|
|
190
|
+
inactive: "bg-secondary text-secondary-foreground",
|
|
191
|
+
suspended: "bg-red-500/20 text-red-600 dark:text-red-400",
|
|
192
|
+
pending: "bg-yellow-500/20 text-yellow-600 dark:text-yellow-400"
|
|
193
|
+
}[e]),
|
|
194
|
+
children: e
|
|
195
|
+
});
|
|
196
|
+
return E ? /* @__PURE__ */ b(n, {
|
|
197
|
+
title: "User Management",
|
|
198
|
+
description: "Loading users...",
|
|
199
|
+
children: /* @__PURE__ */ x("div", {
|
|
200
|
+
className: "flex flex-col items-center justify-center py-20",
|
|
201
|
+
children: [/* @__PURE__ */ b(u, { className: "h-10 w-10 animate-spin text-muted-foreground mb-4" }), /* @__PURE__ */ b("p", {
|
|
202
|
+
className: "text-muted-foreground",
|
|
203
|
+
children: "Loading users..."
|
|
204
|
+
})]
|
|
205
|
+
})
|
|
206
|
+
}) : /* @__PURE__ */ x(n, {
|
|
207
|
+
title: "User Management",
|
|
208
|
+
description: `${B.totalUsers.toLocaleString("en-IN")} registered users on the platform`,
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ b("div", {
|
|
211
|
+
className: "grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-8 gap-3 mb-6",
|
|
212
|
+
children: [
|
|
213
|
+
{
|
|
214
|
+
label: "Total Users",
|
|
215
|
+
value: B.totalUsers.toLocaleString("en-IN"),
|
|
216
|
+
cls: ""
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
label: "Active",
|
|
220
|
+
value: B.activeUsers.toLocaleString("en-IN"),
|
|
221
|
+
cls: "bg-green-500/10 border-green-500/30"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
label: "New (30d)",
|
|
225
|
+
value: B.newUsers.toString(),
|
|
226
|
+
cls: "bg-blue-500/10 border-blue-500/30"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
label: "Verified",
|
|
230
|
+
value: B.verifiedUsers.toLocaleString("en-IN"),
|
|
231
|
+
cls: "bg-purple-500/10 border-purple-500/30"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
label: "Customers",
|
|
235
|
+
value: B.customers.toLocaleString("en-IN"),
|
|
236
|
+
cls: ""
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
label: "Cart Owners",
|
|
240
|
+
value: B.cartOwners.toString(),
|
|
241
|
+
cls: ""
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
label: "Workers",
|
|
245
|
+
value: B.workers.toString(),
|
|
246
|
+
cls: ""
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
label: "Investors",
|
|
250
|
+
value: B.investors.toString(),
|
|
251
|
+
cls: ""
|
|
252
|
+
}
|
|
253
|
+
].map((e) => /* @__PURE__ */ x("div", {
|
|
254
|
+
className: t("rounded-lg border border-border bg-card p-3", e.cls),
|
|
255
|
+
children: [/* @__PURE__ */ b("p", {
|
|
256
|
+
className: "text-xs text-muted-foreground",
|
|
257
|
+
children: e.label
|
|
258
|
+
}), /* @__PURE__ */ b("p", {
|
|
259
|
+
className: "text-lg font-bold text-foreground",
|
|
260
|
+
children: e.value
|
|
261
|
+
})]
|
|
262
|
+
}, e.label))
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ b("div", {
|
|
265
|
+
className: "rounded-lg border border-border bg-card p-4 mb-6",
|
|
266
|
+
children: /* @__PURE__ */ x("div", {
|
|
267
|
+
className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3",
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ x("div", {
|
|
270
|
+
className: "relative",
|
|
271
|
+
children: [/* @__PURE__ */ b(d, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ b("input", {
|
|
272
|
+
type: "text",
|
|
273
|
+
placeholder: "Search users...",
|
|
274
|
+
value: R.searchQuery,
|
|
275
|
+
onChange: (e) => H("searchQuery", e.target.value),
|
|
276
|
+
className: "w-full rounded-lg border border-border bg-card py-2 pl-10 pr-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
277
|
+
})]
|
|
278
|
+
}),
|
|
279
|
+
/* @__PURE__ */ x("select", {
|
|
280
|
+
value: R.role,
|
|
281
|
+
onChange: (e) => H("role", e.target.value),
|
|
282
|
+
className: "rounded-lg border border-border bg-card py-2 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
|
|
283
|
+
children: [
|
|
284
|
+
/* @__PURE__ */ b("option", {
|
|
285
|
+
value: "",
|
|
286
|
+
children: "All Roles"
|
|
287
|
+
}),
|
|
288
|
+
/* @__PURE__ */ b("option", {
|
|
289
|
+
value: "customer",
|
|
290
|
+
children: "Customers"
|
|
291
|
+
}),
|
|
292
|
+
/* @__PURE__ */ b("option", {
|
|
293
|
+
value: "cart_owner",
|
|
294
|
+
children: "Cart Owners"
|
|
295
|
+
}),
|
|
296
|
+
/* @__PURE__ */ b("option", {
|
|
297
|
+
value: "worker",
|
|
298
|
+
children: "Workers"
|
|
299
|
+
}),
|
|
300
|
+
/* @__PURE__ */ b("option", {
|
|
301
|
+
value: "investor",
|
|
302
|
+
children: "Investors"
|
|
303
|
+
})
|
|
304
|
+
]
|
|
305
|
+
}),
|
|
306
|
+
/* @__PURE__ */ x("select", {
|
|
307
|
+
value: R.status,
|
|
308
|
+
onChange: (e) => H("status", e.target.value),
|
|
309
|
+
className: "rounded-lg border border-border bg-card py-2 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
|
|
310
|
+
children: [
|
|
311
|
+
/* @__PURE__ */ b("option", {
|
|
312
|
+
value: "",
|
|
313
|
+
children: "All Status"
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ b("option", {
|
|
316
|
+
value: "active",
|
|
317
|
+
children: "Active"
|
|
318
|
+
}),
|
|
319
|
+
/* @__PURE__ */ b("option", {
|
|
320
|
+
value: "inactive",
|
|
321
|
+
children: "Inactive"
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ b("option", {
|
|
324
|
+
value: "suspended",
|
|
325
|
+
children: "Suspended"
|
|
326
|
+
}),
|
|
327
|
+
/* @__PURE__ */ b("option", {
|
|
328
|
+
value: "pending",
|
|
329
|
+
children: "Pending"
|
|
330
|
+
})
|
|
331
|
+
]
|
|
332
|
+
}),
|
|
333
|
+
/* @__PURE__ */ x("select", {
|
|
334
|
+
value: R.registrationDate,
|
|
335
|
+
onChange: (e) => H("registrationDate", e.target.value),
|
|
336
|
+
className: "rounded-lg border border-border bg-card py-2 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
|
|
337
|
+
children: [
|
|
338
|
+
/* @__PURE__ */ b("option", {
|
|
339
|
+
value: "",
|
|
340
|
+
children: "All Time"
|
|
341
|
+
}),
|
|
342
|
+
/* @__PURE__ */ b("option", {
|
|
343
|
+
value: "1",
|
|
344
|
+
children: "Last 24 hours"
|
|
345
|
+
}),
|
|
346
|
+
/* @__PURE__ */ b("option", {
|
|
347
|
+
value: "7",
|
|
348
|
+
children: "Last 7 days"
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ b("option", {
|
|
351
|
+
value: "30",
|
|
352
|
+
children: "Last 30 days"
|
|
353
|
+
}),
|
|
354
|
+
/* @__PURE__ */ b("option", {
|
|
355
|
+
value: "90",
|
|
356
|
+
children: "Last 90 days"
|
|
357
|
+
})
|
|
358
|
+
]
|
|
359
|
+
}),
|
|
360
|
+
/* @__PURE__ */ x("select", {
|
|
361
|
+
value: R.sortBy,
|
|
362
|
+
onChange: (e) => H("sortBy", e.target.value),
|
|
363
|
+
className: "rounded-lg border border-border bg-card py-2 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
|
|
364
|
+
children: [
|
|
365
|
+
/* @__PURE__ */ b("option", {
|
|
366
|
+
value: "recent",
|
|
367
|
+
children: "Most Recent"
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ b("option", {
|
|
370
|
+
value: "name",
|
|
371
|
+
children: "Name A-Z"
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ b("option", {
|
|
374
|
+
value: "activity",
|
|
375
|
+
children: "Last Activity"
|
|
376
|
+
})
|
|
377
|
+
]
|
|
378
|
+
})
|
|
379
|
+
]
|
|
380
|
+
})
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ x("div", {
|
|
383
|
+
className: "rounded-lg border border-border bg-card overflow-hidden",
|
|
384
|
+
children: [
|
|
385
|
+
/* @__PURE__ */ b("div", {
|
|
386
|
+
className: "block md:hidden space-y-4 p-4",
|
|
387
|
+
children: J.map((e) => /* @__PURE__ */ x("div", {
|
|
388
|
+
className: "rounded-lg border border-border bg-muted/30 p-4",
|
|
389
|
+
children: [
|
|
390
|
+
/* @__PURE__ */ x("div", {
|
|
391
|
+
className: "flex items-center mb-3",
|
|
392
|
+
children: [e.profilePicture ? /* @__PURE__ */ b("img", {
|
|
393
|
+
src: e.profilePicture,
|
|
394
|
+
alt: `${e.firstName} ${e.lastName}`,
|
|
395
|
+
className: "w-12 h-12 rounded-full object-cover mr-3"
|
|
396
|
+
}) : /* @__PURE__ */ b("div", {
|
|
397
|
+
className: "w-12 h-12 rounded-full bg-muted flex items-center justify-center mr-3",
|
|
398
|
+
children: /* @__PURE__ */ b(_, { className: "h-6 w-6 text-muted-foreground" })
|
|
399
|
+
}), /* @__PURE__ */ x("div", {
|
|
400
|
+
className: "flex-1 min-w-0",
|
|
401
|
+
children: [
|
|
402
|
+
/* @__PURE__ */ x("h3", {
|
|
403
|
+
className: "font-medium text-foreground",
|
|
404
|
+
children: [
|
|
405
|
+
e.firstName,
|
|
406
|
+
" ",
|
|
407
|
+
e.lastName
|
|
408
|
+
]
|
|
409
|
+
}),
|
|
410
|
+
/* @__PURE__ */ b("p", {
|
|
411
|
+
className: "text-sm text-muted-foreground truncate",
|
|
412
|
+
children: e.email
|
|
413
|
+
}),
|
|
414
|
+
/* @__PURE__ */ b("p", {
|
|
415
|
+
className: "text-sm text-muted-foreground",
|
|
416
|
+
children: e.phone
|
|
417
|
+
})
|
|
418
|
+
]
|
|
419
|
+
})]
|
|
420
|
+
}),
|
|
421
|
+
/* @__PURE__ */ x("div", {
|
|
422
|
+
className: "flex flex-wrap gap-2 mb-3",
|
|
423
|
+
children: [Y(e.role), X(e.status)]
|
|
424
|
+
}),
|
|
425
|
+
/* @__PURE__ */ x("div", {
|
|
426
|
+
className: "grid grid-cols-2 gap-4 text-sm mb-3",
|
|
427
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
428
|
+
className: "text-muted-foreground",
|
|
429
|
+
children: "Registered"
|
|
430
|
+
}), /* @__PURE__ */ b("p", {
|
|
431
|
+
className: "text-foreground",
|
|
432
|
+
children: K(e.registrationDate)
|
|
433
|
+
})] }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
434
|
+
className: "text-muted-foreground",
|
|
435
|
+
children: "Last Login"
|
|
436
|
+
}), /* @__PURE__ */ b("p", {
|
|
437
|
+
className: "text-foreground",
|
|
438
|
+
children: e.lastLoginTime ? K(e.lastLoginTime) : "Never"
|
|
439
|
+
})] })]
|
|
440
|
+
}),
|
|
441
|
+
/* @__PURE__ */ x("div", {
|
|
442
|
+
className: "flex flex-wrap gap-3 mb-3",
|
|
443
|
+
children: [
|
|
444
|
+
/* @__PURE__ */ x("div", {
|
|
445
|
+
className: "flex items-center",
|
|
446
|
+
children: [/* @__PURE__ */ b("span", { className: t("w-2 h-2 rounded-full mr-2", e.isEmailVerified ? "bg-green-500" : "bg-red-500") }), /* @__PURE__ */ b("span", {
|
|
447
|
+
className: "text-sm text-muted-foreground",
|
|
448
|
+
children: "Email"
|
|
449
|
+
})]
|
|
450
|
+
}),
|
|
451
|
+
/* @__PURE__ */ x("div", {
|
|
452
|
+
className: "flex items-center",
|
|
453
|
+
children: [/* @__PURE__ */ b("span", { className: t("w-2 h-2 rounded-full mr-2", e.isPhoneVerified ? "bg-green-500" : "bg-red-500") }), /* @__PURE__ */ b("span", {
|
|
454
|
+
className: "text-sm text-muted-foreground",
|
|
455
|
+
children: "Phone"
|
|
456
|
+
})]
|
|
457
|
+
}),
|
|
458
|
+
e.kycStatus && /* @__PURE__ */ x("div", {
|
|
459
|
+
className: "flex items-center",
|
|
460
|
+
children: [/* @__PURE__ */ b("span", { className: t("w-2 h-2 rounded-full mr-2", e.kycStatus === "verified" ? "bg-green-500" : e.kycStatus === "pending" ? "bg-yellow-500" : "bg-red-500") }), /* @__PURE__ */ b("span", {
|
|
461
|
+
className: "text-sm text-muted-foreground",
|
|
462
|
+
children: "KYC"
|
|
463
|
+
})]
|
|
464
|
+
})
|
|
465
|
+
]
|
|
466
|
+
}),
|
|
467
|
+
/* @__PURE__ */ x("div", {
|
|
468
|
+
className: "flex flex-wrap gap-2",
|
|
469
|
+
children: [
|
|
470
|
+
/* @__PURE__ */ b("button", {
|
|
471
|
+
type: "button",
|
|
472
|
+
onClick: () => U(e, "edit"),
|
|
473
|
+
className: "rounded-lg border border-border px-3 py-1.5 text-sm font-medium text-foreground hover:bg-accent transition-colors",
|
|
474
|
+
children: "Edit"
|
|
475
|
+
}),
|
|
476
|
+
e.status === "active" ? /* @__PURE__ */ b("button", {
|
|
477
|
+
type: "button",
|
|
478
|
+
onClick: () => U(e, "suspend"),
|
|
479
|
+
className: "rounded-lg border border-border px-3 py-1.5 text-sm font-medium text-red-600 hover:bg-red-500/10 transition-colors",
|
|
480
|
+
children: "Suspend"
|
|
481
|
+
}) : /* @__PURE__ */ b("button", {
|
|
482
|
+
type: "button",
|
|
483
|
+
onClick: () => U(e, "activate"),
|
|
484
|
+
className: "rounded-lg border border-border px-3 py-1.5 text-sm font-medium text-green-600 hover:bg-green-500/10 transition-colors",
|
|
485
|
+
children: "Activate"
|
|
486
|
+
}),
|
|
487
|
+
e.kycStatus === "pending" && /* @__PURE__ */ b("button", {
|
|
488
|
+
type: "button",
|
|
489
|
+
onClick: () => U(e, "verify"),
|
|
490
|
+
className: "rounded-lg bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
|
|
491
|
+
children: "Verify"
|
|
492
|
+
})
|
|
493
|
+
]
|
|
494
|
+
})
|
|
495
|
+
]
|
|
496
|
+
}, e.id))
|
|
497
|
+
}),
|
|
498
|
+
/* @__PURE__ */ b("div", {
|
|
499
|
+
className: "hidden md:block overflow-x-auto",
|
|
500
|
+
children: /* @__PURE__ */ x("table", {
|
|
501
|
+
className: "w-full",
|
|
502
|
+
children: [/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ x("tr", {
|
|
503
|
+
className: "border-b border-border bg-muted/50",
|
|
504
|
+
children: [
|
|
505
|
+
/* @__PURE__ */ b("th", {
|
|
506
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
507
|
+
children: "User"
|
|
508
|
+
}),
|
|
509
|
+
/* @__PURE__ */ b("th", {
|
|
510
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
511
|
+
children: "Role & Status"
|
|
512
|
+
}),
|
|
513
|
+
/* @__PURE__ */ b("th", {
|
|
514
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
515
|
+
children: "Activity"
|
|
516
|
+
}),
|
|
517
|
+
/* @__PURE__ */ b("th", {
|
|
518
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
519
|
+
children: "Performance"
|
|
520
|
+
}),
|
|
521
|
+
/* @__PURE__ */ b("th", {
|
|
522
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
523
|
+
children: "Verification"
|
|
524
|
+
}),
|
|
525
|
+
/* @__PURE__ */ b("th", {
|
|
526
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
527
|
+
children: "Actions"
|
|
528
|
+
})
|
|
529
|
+
]
|
|
530
|
+
}) }), /* @__PURE__ */ b("tbody", {
|
|
531
|
+
className: "divide-y divide-border",
|
|
532
|
+
children: J.map((e) => /* @__PURE__ */ x("tr", {
|
|
533
|
+
className: "hover:bg-accent/50 transition-colors",
|
|
534
|
+
children: [
|
|
535
|
+
/* @__PURE__ */ b("td", {
|
|
536
|
+
className: "px-4 py-3",
|
|
537
|
+
children: /* @__PURE__ */ x("div", {
|
|
538
|
+
className: "flex items-center gap-3",
|
|
539
|
+
children: [e.profilePicture ? /* @__PURE__ */ b("img", {
|
|
540
|
+
src: e.profilePicture,
|
|
541
|
+
alt: `${e.firstName}`,
|
|
542
|
+
className: "w-10 h-10 rounded-full object-cover"
|
|
543
|
+
}) : /* @__PURE__ */ b("div", {
|
|
544
|
+
className: "w-10 h-10 rounded-full bg-muted flex items-center justify-center",
|
|
545
|
+
children: /* @__PURE__ */ b(_, { className: "h-5 w-5 text-muted-foreground" })
|
|
546
|
+
}), /* @__PURE__ */ x("div", { children: [
|
|
547
|
+
/* @__PURE__ */ x("p", {
|
|
548
|
+
className: "text-sm font-medium text-foreground",
|
|
549
|
+
children: [
|
|
550
|
+
e.firstName,
|
|
551
|
+
" ",
|
|
552
|
+
e.lastName
|
|
553
|
+
]
|
|
554
|
+
}),
|
|
555
|
+
/* @__PURE__ */ b("p", {
|
|
556
|
+
className: "text-xs text-muted-foreground",
|
|
557
|
+
children: e.email
|
|
558
|
+
}),
|
|
559
|
+
/* @__PURE__ */ b("p", {
|
|
560
|
+
className: "text-xs text-muted-foreground",
|
|
561
|
+
children: e.phone
|
|
562
|
+
})
|
|
563
|
+
] })]
|
|
564
|
+
})
|
|
565
|
+
}),
|
|
566
|
+
/* @__PURE__ */ b("td", {
|
|
567
|
+
className: "px-4 py-3",
|
|
568
|
+
children: /* @__PURE__ */ x("div", {
|
|
569
|
+
className: "space-y-1",
|
|
570
|
+
children: [
|
|
571
|
+
Y(e.role),
|
|
572
|
+
/* @__PURE__ */ b("br", {}),
|
|
573
|
+
X(e.status)
|
|
574
|
+
]
|
|
575
|
+
})
|
|
576
|
+
}),
|
|
577
|
+
/* @__PURE__ */ x("td", {
|
|
578
|
+
className: "px-4 py-3 text-sm",
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ x("p", {
|
|
581
|
+
className: "text-foreground",
|
|
582
|
+
children: ["Registered: ", K(e.registrationDate)]
|
|
583
|
+
}),
|
|
584
|
+
e.lastLoginTime && /* @__PURE__ */ x("p", {
|
|
585
|
+
className: "text-muted-foreground",
|
|
586
|
+
children: ["Last login: ", K(e.lastLoginTime)]
|
|
587
|
+
}),
|
|
588
|
+
e.deviceInfo && /* @__PURE__ */ x("p", {
|
|
589
|
+
className: "text-muted-foreground flex items-center gap-1",
|
|
590
|
+
children: [/* @__PURE__ */ b(p, { className: "h-3 w-3" }), e.deviceInfo]
|
|
591
|
+
})
|
|
592
|
+
]
|
|
593
|
+
}),
|
|
594
|
+
/* @__PURE__ */ x("td", {
|
|
595
|
+
className: "px-4 py-3 text-sm",
|
|
596
|
+
children: [
|
|
597
|
+
e.role === "customer" && e.totalOrders != null && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("p", {
|
|
598
|
+
className: "text-foreground",
|
|
599
|
+
children: [e.totalOrders, " orders"]
|
|
600
|
+
}), /* @__PURE__ */ x("p", {
|
|
601
|
+
className: "text-muted-foreground",
|
|
602
|
+
children: [q(e.totalSpent ?? 0), " spent"]
|
|
603
|
+
})] }),
|
|
604
|
+
(e.role === "cart_owner" || e.role === "worker") && e.totalEarnings != null && /* @__PURE__ */ x("p", {
|
|
605
|
+
className: "text-foreground",
|
|
606
|
+
children: [q(e.totalEarnings), " earned"]
|
|
607
|
+
}),
|
|
608
|
+
e.role === "investor" && e.riskScore != null && /* @__PURE__ */ x("p", {
|
|
609
|
+
className: "text-foreground",
|
|
610
|
+
children: [
|
|
611
|
+
"Risk: ",
|
|
612
|
+
e.riskScore,
|
|
613
|
+
"/5"
|
|
614
|
+
]
|
|
615
|
+
})
|
|
616
|
+
]
|
|
617
|
+
}),
|
|
618
|
+
/* @__PURE__ */ b("td", {
|
|
619
|
+
className: "px-4 py-3",
|
|
620
|
+
children: /* @__PURE__ */ x("div", {
|
|
621
|
+
className: "space-y-1",
|
|
622
|
+
children: [
|
|
623
|
+
/* @__PURE__ */ x("div", {
|
|
624
|
+
className: "flex items-center gap-2",
|
|
625
|
+
children: [/* @__PURE__ */ b("span", { className: t("w-2 h-2 rounded-full", e.isEmailVerified ? "bg-green-500" : "bg-red-500") }), /* @__PURE__ */ b("span", {
|
|
626
|
+
className: "text-sm text-muted-foreground",
|
|
627
|
+
children: "Email"
|
|
628
|
+
})]
|
|
629
|
+
}),
|
|
630
|
+
/* @__PURE__ */ x("div", {
|
|
631
|
+
className: "flex items-center gap-2",
|
|
632
|
+
children: [/* @__PURE__ */ b("span", { className: t("w-2 h-2 rounded-full", e.isPhoneVerified ? "bg-green-500" : "bg-red-500") }), /* @__PURE__ */ b("span", {
|
|
633
|
+
className: "text-sm text-muted-foreground",
|
|
634
|
+
children: "Phone"
|
|
635
|
+
})]
|
|
636
|
+
}),
|
|
637
|
+
e.kycStatus && /* @__PURE__ */ x("div", {
|
|
638
|
+
className: "flex items-center gap-2",
|
|
639
|
+
children: [/* @__PURE__ */ b("span", { className: t("w-2 h-2 rounded-full", e.kycStatus === "verified" ? "bg-green-500" : e.kycStatus === "pending" ? "bg-yellow-500" : "bg-red-500") }), /* @__PURE__ */ b("span", {
|
|
640
|
+
className: "text-sm text-muted-foreground",
|
|
641
|
+
children: "KYC"
|
|
642
|
+
})]
|
|
643
|
+
})
|
|
644
|
+
]
|
|
645
|
+
})
|
|
646
|
+
}),
|
|
647
|
+
/* @__PURE__ */ b("td", {
|
|
648
|
+
className: "px-4 py-3",
|
|
649
|
+
children: /* @__PURE__ */ x("div", {
|
|
650
|
+
className: "flex gap-1",
|
|
651
|
+
children: [
|
|
652
|
+
/* @__PURE__ */ b("button", {
|
|
653
|
+
type: "button",
|
|
654
|
+
onClick: () => U(e, "edit"),
|
|
655
|
+
title: "Edit",
|
|
656
|
+
className: "rounded p-1.5 text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",
|
|
657
|
+
children: /* @__PURE__ */ b(l, { className: "h-4 w-4" })
|
|
658
|
+
}),
|
|
659
|
+
e.status === "active" ? /* @__PURE__ */ b("button", {
|
|
660
|
+
type: "button",
|
|
661
|
+
onClick: () => U(e, "suspend"),
|
|
662
|
+
title: "Suspend",
|
|
663
|
+
className: "rounded p-1.5 text-muted-foreground hover:text-red-600 hover:bg-red-500/10 transition-colors",
|
|
664
|
+
children: /* @__PURE__ */ b(g, { className: "h-4 w-4" })
|
|
665
|
+
}) : /* @__PURE__ */ b("button", {
|
|
666
|
+
type: "button",
|
|
667
|
+
onClick: () => U(e, "activate"),
|
|
668
|
+
title: "Activate",
|
|
669
|
+
className: "rounded p-1.5 text-muted-foreground hover:text-green-600 hover:bg-green-500/10 transition-colors",
|
|
670
|
+
children: /* @__PURE__ */ b(h, { className: "h-4 w-4" })
|
|
671
|
+
}),
|
|
672
|
+
e.kycStatus === "pending" && /* @__PURE__ */ b("button", {
|
|
673
|
+
type: "button",
|
|
674
|
+
onClick: () => U(e, "verify"),
|
|
675
|
+
title: "Verify",
|
|
676
|
+
className: "rounded p-1.5 text-muted-foreground hover:text-blue-600 hover:bg-blue-500/10 transition-colors",
|
|
677
|
+
children: /* @__PURE__ */ b(f, { className: "h-4 w-4" })
|
|
678
|
+
})
|
|
679
|
+
]
|
|
680
|
+
})
|
|
681
|
+
})
|
|
682
|
+
]
|
|
683
|
+
}, e.id))
|
|
684
|
+
})]
|
|
685
|
+
})
|
|
686
|
+
}),
|
|
687
|
+
w.length === 0 && /* @__PURE__ */ x("div", {
|
|
688
|
+
className: "flex flex-col items-center justify-center py-12 px-4",
|
|
689
|
+
children: [/* @__PURE__ */ b(_, { className: "h-10 w-10 text-muted-foreground/50 mb-3" }), /* @__PURE__ */ b("p", {
|
|
690
|
+
className: "text-sm text-muted-foreground",
|
|
691
|
+
children: "No users found matching your criteria"
|
|
692
|
+
})]
|
|
693
|
+
})
|
|
694
|
+
]
|
|
695
|
+
}),
|
|
696
|
+
/* @__PURE__ */ x("div", {
|
|
697
|
+
className: "mt-6 flex flex-col sm:flex-row sm:items-center justify-between gap-4",
|
|
698
|
+
children: [/* @__PURE__ */ x("p", {
|
|
699
|
+
className: "text-sm text-muted-foreground text-center sm:text-left",
|
|
700
|
+
children: [
|
|
701
|
+
"Showing",
|
|
702
|
+
" ",
|
|
703
|
+
/* @__PURE__ */ b("span", {
|
|
704
|
+
className: "font-medium",
|
|
705
|
+
children: Math.min((I - 1) * 10 + 1, w.length)
|
|
706
|
+
}),
|
|
707
|
+
" ",
|
|
708
|
+
"to",
|
|
709
|
+
" ",
|
|
710
|
+
/* @__PURE__ */ b("span", {
|
|
711
|
+
className: "font-medium",
|
|
712
|
+
children: Math.min(I * 10, w.length)
|
|
713
|
+
}),
|
|
714
|
+
" ",
|
|
715
|
+
"of ",
|
|
716
|
+
/* @__PURE__ */ b("span", {
|
|
717
|
+
className: "font-medium",
|
|
718
|
+
children: w.length
|
|
719
|
+
}),
|
|
720
|
+
" results"
|
|
721
|
+
]
|
|
722
|
+
}), /* @__PURE__ */ x("div", {
|
|
723
|
+
className: "flex justify-center sm:justify-end gap-2",
|
|
724
|
+
children: [/* @__PURE__ */ x("button", {
|
|
725
|
+
type: "button",
|
|
726
|
+
disabled: I === 1,
|
|
727
|
+
onClick: () => L((e) => Math.max(1, e - 1)),
|
|
728
|
+
className: "flex items-center gap-1.5 rounded-lg border border-border px-3 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
729
|
+
children: [/* @__PURE__ */ b(s, { className: "h-4 w-4" }), "Previous"]
|
|
730
|
+
}), /* @__PURE__ */ x("button", {
|
|
731
|
+
type: "button",
|
|
732
|
+
disabled: I * 10 >= w.length,
|
|
733
|
+
onClick: () => L((e) => e + 1),
|
|
734
|
+
className: "flex items-center gap-1.5 rounded-lg border border-border px-3 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
735
|
+
children: ["Next", /* @__PURE__ */ b(c, { className: "h-4 w-4" })]
|
|
736
|
+
})]
|
|
737
|
+
})]
|
|
738
|
+
}),
|
|
739
|
+
A && O && /* @__PURE__ */ b("div", {
|
|
740
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
741
|
+
children: /* @__PURE__ */ x("div", {
|
|
742
|
+
className: "w-full max-w-md rounded-lg border border-border bg-card shadow-lg max-h-[90vh] overflow-y-auto",
|
|
743
|
+
children: [/* @__PURE__ */ x("div", {
|
|
744
|
+
className: "flex items-center justify-between p-4 border-b border-border",
|
|
745
|
+
children: [/* @__PURE__ */ b("h3", {
|
|
746
|
+
className: "text-lg font-semibold text-foreground",
|
|
747
|
+
children: M === "edit" ? "Edit User" : "Delete User"
|
|
748
|
+
}), /* @__PURE__ */ b("button", {
|
|
749
|
+
type: "button",
|
|
750
|
+
onClick: () => j(!1),
|
|
751
|
+
className: "rounded p-1.5 text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",
|
|
752
|
+
children: /* @__PURE__ */ b(v, { className: "h-5 w-5" })
|
|
753
|
+
})]
|
|
754
|
+
}), /* @__PURE__ */ b("div", {
|
|
755
|
+
className: "p-4",
|
|
756
|
+
children: M === "delete" ? /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("p", {
|
|
757
|
+
className: "text-muted-foreground mb-4",
|
|
758
|
+
children: [
|
|
759
|
+
"Are you sure you want to delete user \"",
|
|
760
|
+
O.firstName,
|
|
761
|
+
" ",
|
|
762
|
+
O.lastName,
|
|
763
|
+
"\"? This action cannot be undone."
|
|
764
|
+
]
|
|
765
|
+
}), /* @__PURE__ */ x("div", {
|
|
766
|
+
className: "flex gap-3",
|
|
767
|
+
children: [/* @__PURE__ */ b("button", {
|
|
768
|
+
type: "button",
|
|
769
|
+
onClick: () => j(!1),
|
|
770
|
+
className: "flex-1 rounded-lg border border-border py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors",
|
|
771
|
+
children: "Cancel"
|
|
772
|
+
}), /* @__PURE__ */ b("button", {
|
|
773
|
+
type: "button",
|
|
774
|
+
onClick: W,
|
|
775
|
+
className: "flex-1 rounded-lg bg-red-600 hover:bg-red-700 py-2 text-sm font-medium text-white transition-colors",
|
|
776
|
+
children: "Delete User"
|
|
777
|
+
})]
|
|
778
|
+
})] }) : /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("div", {
|
|
779
|
+
className: "space-y-4",
|
|
780
|
+
children: [
|
|
781
|
+
/* @__PURE__ */ x("div", {
|
|
782
|
+
className: "grid grid-cols-2 gap-4",
|
|
783
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
784
|
+
className: "block text-sm font-medium text-muted-foreground mb-1",
|
|
785
|
+
children: "First Name"
|
|
786
|
+
}), /* @__PURE__ */ b("input", {
|
|
787
|
+
type: "text",
|
|
788
|
+
value: P.firstName,
|
|
789
|
+
onChange: (e) => F((t) => ({
|
|
790
|
+
...t,
|
|
791
|
+
firstName: e.target.value
|
|
792
|
+
})),
|
|
793
|
+
className: "w-full rounded-lg border border-border bg-card py-2 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
794
|
+
})] }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
795
|
+
className: "block text-sm font-medium text-muted-foreground mb-1",
|
|
796
|
+
children: "Last Name"
|
|
797
|
+
}), /* @__PURE__ */ b("input", {
|
|
798
|
+
type: "text",
|
|
799
|
+
value: P.lastName,
|
|
800
|
+
onChange: (e) => F((t) => ({
|
|
801
|
+
...t,
|
|
802
|
+
lastName: e.target.value
|
|
803
|
+
})),
|
|
804
|
+
className: "w-full rounded-lg border border-border bg-card py-2 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
805
|
+
})] })]
|
|
806
|
+
}),
|
|
807
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
808
|
+
className: "block text-sm font-medium text-muted-foreground mb-1",
|
|
809
|
+
children: "Email"
|
|
810
|
+
}), /* @__PURE__ */ b("input", {
|
|
811
|
+
type: "email",
|
|
812
|
+
value: P.email,
|
|
813
|
+
onChange: (e) => F((t) => ({
|
|
814
|
+
...t,
|
|
815
|
+
email: e.target.value
|
|
816
|
+
})),
|
|
817
|
+
className: "w-full rounded-lg border border-border bg-card py-2 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
818
|
+
})] }),
|
|
819
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
820
|
+
className: "block text-sm font-medium text-muted-foreground mb-1",
|
|
821
|
+
children: "Phone"
|
|
822
|
+
}), /* @__PURE__ */ b("input", {
|
|
823
|
+
type: "tel",
|
|
824
|
+
value: P.phone,
|
|
825
|
+
onChange: (e) => F((t) => ({
|
|
826
|
+
...t,
|
|
827
|
+
phone: e.target.value
|
|
828
|
+
})),
|
|
829
|
+
className: "w-full rounded-lg border border-border bg-card py-2 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
830
|
+
})] }),
|
|
831
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
832
|
+
className: "block text-sm font-medium text-muted-foreground mb-1",
|
|
833
|
+
children: "Role"
|
|
834
|
+
}), /* @__PURE__ */ x("select", {
|
|
835
|
+
value: P.role,
|
|
836
|
+
onChange: (e) => F((t) => ({
|
|
837
|
+
...t,
|
|
838
|
+
role: e.target.value
|
|
839
|
+
})),
|
|
840
|
+
className: "w-full rounded-lg border border-border bg-card py-2 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
|
|
841
|
+
children: [
|
|
842
|
+
/* @__PURE__ */ b("option", {
|
|
843
|
+
value: "customer",
|
|
844
|
+
children: "Customer"
|
|
845
|
+
}),
|
|
846
|
+
/* @__PURE__ */ b("option", {
|
|
847
|
+
value: "cart_owner",
|
|
848
|
+
children: "Cart Owner"
|
|
849
|
+
}),
|
|
850
|
+
/* @__PURE__ */ b("option", {
|
|
851
|
+
value: "worker",
|
|
852
|
+
children: "Worker"
|
|
853
|
+
}),
|
|
854
|
+
/* @__PURE__ */ b("option", {
|
|
855
|
+
value: "investor",
|
|
856
|
+
children: "Investor"
|
|
857
|
+
})
|
|
858
|
+
]
|
|
859
|
+
})] })
|
|
860
|
+
]
|
|
861
|
+
}), /* @__PURE__ */ x("div", {
|
|
862
|
+
className: "flex gap-3 mt-6",
|
|
863
|
+
children: [
|
|
864
|
+
/* @__PURE__ */ b("button", {
|
|
865
|
+
type: "button",
|
|
866
|
+
onClick: () => j(!1),
|
|
867
|
+
className: "flex-1 rounded-lg border border-border py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors",
|
|
868
|
+
children: "Cancel"
|
|
869
|
+
}),
|
|
870
|
+
/* @__PURE__ */ b("button", {
|
|
871
|
+
type: "button",
|
|
872
|
+
onClick: G,
|
|
873
|
+
className: "flex-1 rounded-lg bg-primary py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
|
|
874
|
+
children: "Save Changes"
|
|
875
|
+
}),
|
|
876
|
+
/* @__PURE__ */ b("button", {
|
|
877
|
+
type: "button",
|
|
878
|
+
onClick: () => N("delete"),
|
|
879
|
+
className: "rounded-lg border border-border py-2 px-3 text-sm font-medium text-red-600 hover:bg-red-500/10 transition-colors",
|
|
880
|
+
children: /* @__PURE__ */ b(m, { className: "h-4 w-4" })
|
|
881
|
+
})
|
|
882
|
+
]
|
|
883
|
+
})] })
|
|
884
|
+
})]
|
|
885
|
+
})
|
|
886
|
+
})
|
|
887
|
+
]
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
//#endregion
|
|
891
|
+
export { C as UserManagementPage };
|
|
892
|
+
|
|
893
|
+
//# sourceMappingURL=UserManagementPage.js.map
|