@burdenoff/microfe-adaptercloud 2026.625.1 → 2026.625.2
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/dist/adaptercloud/components/PageLayout.js +24 -17
- package/dist/adaptercloud/components/PageLayout.js.map +1 -1
- package/dist/adaptercloud/pages/HomePage.js +18 -16
- package/dist/adaptercloud/pages/HomePage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +90 -82
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminDashboard.js +70 -44
- package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +60 -55
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +97 -92
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js +59 -57
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +118 -104
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/CartManagementPage.js +145 -140
- package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/UserManagementPage.js +152 -147
- package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +87 -81
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +179 -165
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +73 -48
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +95 -93
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +110 -107
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +293 -299
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +218 -224
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +122 -128
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/common/HelpSupportPage.js +248 -244
- package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js +96 -91
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/adaptercloud/pages/common/SettingsPage.js +754 -736
- package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +63 -61
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CartDetailPage.js +110 -108
- package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +221 -217
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CheckoutPage.js +89 -87
- package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js +410 -381
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +120 -118
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +86 -81
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/FavoritesPage.js +53 -51
- package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +114 -109
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +60 -58
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +87 -72
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/ReviewsPage.js +65 -63
- package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +68 -53
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +63 -61
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +86 -84
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +57 -55
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js +341 -308
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +34 -32
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +48 -46
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +383 -381
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +348 -319
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js +84 -59
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +73 -71
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +76 -74
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +70 -68
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +3 -3
|
@@ -4,8 +4,9 @@ import { PageLayout as n } from "../../components/PageLayout.js";
|
|
|
4
4
|
import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
5
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
6
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
7
|
+
import { EmphasisPanel as S } from "@burdenoff/fe-libs/ui";
|
|
7
8
|
//#region src/adaptercloud/pages/admin/UserManagementPage.tsx
|
|
8
|
-
var
|
|
9
|
+
var C = [
|
|
9
10
|
{
|
|
10
11
|
id: "user-001",
|
|
11
12
|
email: "rahul.sharma@gmail.com",
|
|
@@ -89,20 +90,20 @@ var S = [
|
|
|
89
90
|
deviceInfo: "iPhone 15"
|
|
90
91
|
}
|
|
91
92
|
];
|
|
92
|
-
function
|
|
93
|
-
let { navigateTo:
|
|
93
|
+
function w() {
|
|
94
|
+
let { navigateTo: w } = e(), [T, E] = o([]), [D, O] = o(!0), [k, A] = o(null), [j, M] = o(!1), [N, P] = o("edit"), [F, I] = o({
|
|
94
95
|
firstName: "",
|
|
95
96
|
lastName: "",
|
|
96
97
|
email: "",
|
|
97
98
|
phone: "",
|
|
98
99
|
role: ""
|
|
99
|
-
}), [
|
|
100
|
+
}), [L, R] = o(1), [z, B] = o({
|
|
100
101
|
role: "",
|
|
101
102
|
status: "",
|
|
102
103
|
searchQuery: "",
|
|
103
104
|
sortBy: "recent",
|
|
104
105
|
registrationDate: ""
|
|
105
|
-
}), [
|
|
106
|
+
}), [V] = o({
|
|
106
107
|
totalUsers: 2456,
|
|
107
108
|
activeUsers: 2134,
|
|
108
109
|
newUsers: 89,
|
|
@@ -111,18 +112,18 @@ function C() {
|
|
|
111
112
|
cartOwners: 342,
|
|
112
113
|
workers: 156,
|
|
113
114
|
investors: 113
|
|
114
|
-
}),
|
|
115
|
-
|
|
116
|
-
let e = [...
|
|
117
|
-
if (
|
|
118
|
-
let t =
|
|
115
|
+
}), H = r(() => {
|
|
116
|
+
O(!0), setTimeout(() => {
|
|
117
|
+
let e = [...C];
|
|
118
|
+
if (z.searchQuery) {
|
|
119
|
+
let t = z.searchQuery.toLowerCase();
|
|
119
120
|
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
|
}
|
|
121
|
-
if (
|
|
122
|
-
let t = parseInt(
|
|
122
|
+
if (z.role && (e = e.filter((e) => e.role === z.role)), z.status && (e = e.filter((e) => e.status === z.status)), z.registrationDate) {
|
|
123
|
+
let t = parseInt(z.registrationDate), n = /* @__PURE__ */ new Date(Date.now() - t * 864e5);
|
|
123
124
|
e = e.filter((e) => new Date(e.registrationDate) >= n);
|
|
124
125
|
}
|
|
125
|
-
switch (
|
|
126
|
+
switch (z.sortBy) {
|
|
126
127
|
case "name":
|
|
127
128
|
e.sort((e, t) => e.firstName.localeCompare(t.firstName));
|
|
128
129
|
break;
|
|
@@ -134,42 +135,42 @@ function C() {
|
|
|
134
135
|
break;
|
|
135
136
|
default: e.sort((e, t) => new Date(t.registrationDate).getTime() - new Date(e.registrationDate).getTime());
|
|
136
137
|
}
|
|
137
|
-
|
|
138
|
+
E(e), O(!1);
|
|
138
139
|
}, 800);
|
|
139
|
-
}, [
|
|
140
|
+
}, [z]);
|
|
140
141
|
i(() => {
|
|
141
|
-
|
|
142
|
-
}, [
|
|
143
|
-
let
|
|
144
|
-
|
|
142
|
+
H();
|
|
143
|
+
}, [H]);
|
|
144
|
+
let U = (e, t) => {
|
|
145
|
+
B((n) => ({
|
|
145
146
|
...n,
|
|
146
147
|
[e]: t
|
|
147
|
-
})),
|
|
148
|
-
},
|
|
148
|
+
})), R(1);
|
|
149
|
+
}, W = (e, t) => {
|
|
149
150
|
if (t === "suspend" || t === "activate" || t === "verify") {
|
|
150
151
|
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),
|
|
152
|
+
alert(n), H();
|
|
152
153
|
return;
|
|
153
154
|
}
|
|
154
|
-
|
|
155
|
+
A(e), P(t), I({
|
|
155
156
|
firstName: e.firstName,
|
|
156
157
|
lastName: e.lastName,
|
|
157
158
|
email: e.email,
|
|
158
159
|
phone: e.phone,
|
|
159
160
|
role: e.role
|
|
160
|
-
}),
|
|
161
|
-
}, W = () => {
|
|
162
|
-
O && (alert(`User ${O.firstName} ${O.lastName} deleted`), j(!1), V());
|
|
161
|
+
}), M(!0);
|
|
163
162
|
}, G = () => {
|
|
164
|
-
alert(
|
|
165
|
-
}, K = (
|
|
163
|
+
k && (alert(`User ${k.firstName} ${k.lastName} deleted`), M(!1), H());
|
|
164
|
+
}, K = () => {
|
|
165
|
+
alert("User updated successfully"), M(!1), H();
|
|
166
|
+
}, q = (e) => new Date(e).toLocaleDateString("en-IN", {
|
|
166
167
|
year: "numeric",
|
|
167
168
|
month: "short",
|
|
168
169
|
day: "numeric"
|
|
169
|
-
}),
|
|
170
|
-
let e = (
|
|
171
|
-
return
|
|
172
|
-
}, [
|
|
170
|
+
}), J = (e) => `₹${e.toLocaleString("en-IN")}`, Y = a(() => {
|
|
171
|
+
let e = (L - 1) * 10;
|
|
172
|
+
return T.slice(e, e + 10);
|
|
173
|
+
}, [T, L]), X = (e) => /* @__PURE__ */ b("span", {
|
|
173
174
|
className: t("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", {
|
|
174
175
|
customer: "bg-accent-blue-subtle/20 text-accent-blue",
|
|
175
176
|
cart_owner: "bg-status-success-bg-subtle/20 text-status-success-text",
|
|
@@ -184,7 +185,7 @@ function C() {
|
|
|
184
185
|
investor: "Investor",
|
|
185
186
|
admin: "Admin"
|
|
186
187
|
}[e] ?? e
|
|
187
|
-
}),
|
|
188
|
+
}), Z = (e) => /* @__PURE__ */ b("span", {
|
|
188
189
|
className: t("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium capitalize", {
|
|
189
190
|
active: "bg-status-success-bg-subtle/20 text-status-success-text",
|
|
190
191
|
inactive: "bg-secondary text-secondary-foreground",
|
|
@@ -193,7 +194,7 @@ function C() {
|
|
|
193
194
|
}[e]),
|
|
194
195
|
children: e
|
|
195
196
|
});
|
|
196
|
-
return
|
|
197
|
+
return D ? /* @__PURE__ */ b(n, {
|
|
197
198
|
title: "User Management",
|
|
198
199
|
description: "Loading users...",
|
|
199
200
|
children: /* @__PURE__ */ x("div", {
|
|
@@ -205,61 +206,65 @@ function C() {
|
|
|
205
206
|
})
|
|
206
207
|
}) : /* @__PURE__ */ x(n, {
|
|
207
208
|
title: "User Management",
|
|
208
|
-
description: `${
|
|
209
|
+
description: `${V.totalUsers.toLocaleString("en-IN")} registered users on the platform`,
|
|
210
|
+
purpose: "Manage everyone on the platform — customers, cart owners, workers, and investors. Search for an account to verify it, change a role, or suspend and reactivate users when you need to handle abuse or support cases.",
|
|
209
211
|
children: [
|
|
210
|
-
/* @__PURE__ */ b(
|
|
211
|
-
className: "
|
|
212
|
-
children:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
className: "
|
|
257
|
-
children:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
212
|
+
/* @__PURE__ */ b(S, {
|
|
213
|
+
className: "mb-6",
|
|
214
|
+
children: /* @__PURE__ */ b("div", {
|
|
215
|
+
className: "grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-8 gap-3",
|
|
216
|
+
children: [
|
|
217
|
+
{
|
|
218
|
+
label: "Total Users",
|
|
219
|
+
value: V.totalUsers.toLocaleString("en-IN"),
|
|
220
|
+
cls: ""
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
label: "Active",
|
|
224
|
+
value: V.activeUsers.toLocaleString("en-IN"),
|
|
225
|
+
cls: "bg-status-success-bg-subtle/10 border-status-success-border/30"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
label: "New (30d)",
|
|
229
|
+
value: V.newUsers.toString(),
|
|
230
|
+
cls: "bg-accent-blue-subtle/10 border-accent-blue-subtle/30"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
label: "Verified",
|
|
234
|
+
value: V.verifiedUsers.toLocaleString("en-IN"),
|
|
235
|
+
cls: "bg-accent-purple-subtle/10 border-accent-purple-subtle/30"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
label: "Customers",
|
|
239
|
+
value: V.customers.toLocaleString("en-IN"),
|
|
240
|
+
cls: ""
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
label: "Cart Owners",
|
|
244
|
+
value: V.cartOwners.toString(),
|
|
245
|
+
cls: ""
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
label: "Workers",
|
|
249
|
+
value: V.workers.toString(),
|
|
250
|
+
cls: ""
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
label: "Investors",
|
|
254
|
+
value: V.investors.toString(),
|
|
255
|
+
cls: ""
|
|
256
|
+
}
|
|
257
|
+
].map((e) => /* @__PURE__ */ x("div", {
|
|
258
|
+
className: t("rounded-lg border border-border-subtle bg-bg-surface p-3", e.cls),
|
|
259
|
+
children: [/* @__PURE__ */ b("p", {
|
|
260
|
+
className: "text-xs text-text-secondary",
|
|
261
|
+
children: e.label
|
|
262
|
+
}), /* @__PURE__ */ b("p", {
|
|
263
|
+
className: "text-lg font-bold text-text-primary",
|
|
264
|
+
children: e.value
|
|
265
|
+
})]
|
|
266
|
+
}, e.label))
|
|
267
|
+
})
|
|
263
268
|
}),
|
|
264
269
|
/* @__PURE__ */ b("div", {
|
|
265
270
|
className: "rounded-lg border border-border-seam bg-bg-surface p-4 mb-6 bg-gloss-card shadow-pop",
|
|
@@ -271,14 +276,14 @@ function C() {
|
|
|
271
276
|
children: [/* @__PURE__ */ b(d, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ b("input", {
|
|
272
277
|
type: "text",
|
|
273
278
|
placeholder: "Search users...",
|
|
274
|
-
value:
|
|
275
|
-
onChange: (e) =>
|
|
279
|
+
value: z.searchQuery,
|
|
280
|
+
onChange: (e) => U("searchQuery", e.target.value),
|
|
276
281
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2 pl-10 pr-4 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
277
282
|
})]
|
|
278
283
|
}),
|
|
279
284
|
/* @__PURE__ */ x("select", {
|
|
280
|
-
value:
|
|
281
|
-
onChange: (e) =>
|
|
285
|
+
value: z.role,
|
|
286
|
+
onChange: (e) => U("role", e.target.value),
|
|
282
287
|
className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
283
288
|
children: [
|
|
284
289
|
/* @__PURE__ */ b("option", {
|
|
@@ -304,8 +309,8 @@ function C() {
|
|
|
304
309
|
]
|
|
305
310
|
}),
|
|
306
311
|
/* @__PURE__ */ x("select", {
|
|
307
|
-
value:
|
|
308
|
-
onChange: (e) =>
|
|
312
|
+
value: z.status,
|
|
313
|
+
onChange: (e) => U("status", e.target.value),
|
|
309
314
|
className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
310
315
|
children: [
|
|
311
316
|
/* @__PURE__ */ b("option", {
|
|
@@ -331,8 +336,8 @@ function C() {
|
|
|
331
336
|
]
|
|
332
337
|
}),
|
|
333
338
|
/* @__PURE__ */ x("select", {
|
|
334
|
-
value:
|
|
335
|
-
onChange: (e) =>
|
|
339
|
+
value: z.registrationDate,
|
|
340
|
+
onChange: (e) => U("registrationDate", e.target.value),
|
|
336
341
|
className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
337
342
|
children: [
|
|
338
343
|
/* @__PURE__ */ b("option", {
|
|
@@ -358,8 +363,8 @@ function C() {
|
|
|
358
363
|
]
|
|
359
364
|
}),
|
|
360
365
|
/* @__PURE__ */ x("select", {
|
|
361
|
-
value:
|
|
362
|
-
onChange: (e) =>
|
|
366
|
+
value: z.sortBy,
|
|
367
|
+
onChange: (e) => U("sortBy", e.target.value),
|
|
363
368
|
className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
364
369
|
children: [
|
|
365
370
|
/* @__PURE__ */ b("option", {
|
|
@@ -384,7 +389,7 @@ function C() {
|
|
|
384
389
|
children: [
|
|
385
390
|
/* @__PURE__ */ b("div", {
|
|
386
391
|
className: "block md:hidden space-y-4 p-4",
|
|
387
|
-
children:
|
|
392
|
+
children: Y.map((e) => /* @__PURE__ */ x("div", {
|
|
388
393
|
className: "rounded-lg border border-border-subtle bg-bg-sunken/30 p-4",
|
|
389
394
|
children: [
|
|
390
395
|
/* @__PURE__ */ x("div", {
|
|
@@ -420,7 +425,7 @@ function C() {
|
|
|
420
425
|
}),
|
|
421
426
|
/* @__PURE__ */ x("div", {
|
|
422
427
|
className: "flex flex-wrap gap-2 mb-3",
|
|
423
|
-
children: [
|
|
428
|
+
children: [X(e.role), Z(e.status)]
|
|
424
429
|
}),
|
|
425
430
|
/* @__PURE__ */ x("div", {
|
|
426
431
|
className: "grid grid-cols-2 gap-4 text-sm mb-3",
|
|
@@ -429,13 +434,13 @@ function C() {
|
|
|
429
434
|
children: "Registered"
|
|
430
435
|
}), /* @__PURE__ */ b("p", {
|
|
431
436
|
className: "text-text-primary",
|
|
432
|
-
children:
|
|
437
|
+
children: q(e.registrationDate)
|
|
433
438
|
})] }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
434
439
|
className: "text-text-secondary",
|
|
435
440
|
children: "Last Login"
|
|
436
441
|
}), /* @__PURE__ */ b("p", {
|
|
437
442
|
className: "text-text-primary",
|
|
438
|
-
children: e.lastLoginTime ?
|
|
443
|
+
children: e.lastLoginTime ? q(e.lastLoginTime) : "Never"
|
|
439
444
|
})] })]
|
|
440
445
|
}),
|
|
441
446
|
/* @__PURE__ */ x("div", {
|
|
@@ -469,24 +474,24 @@ function C() {
|
|
|
469
474
|
children: [
|
|
470
475
|
/* @__PURE__ */ b("button", {
|
|
471
476
|
type: "button",
|
|
472
|
-
onClick: () =>
|
|
477
|
+
onClick: () => W(e, "edit"),
|
|
473
478
|
className: "rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
474
479
|
children: "Edit"
|
|
475
480
|
}),
|
|
476
481
|
e.status === "active" ? /* @__PURE__ */ b("button", {
|
|
477
482
|
type: "button",
|
|
478
|
-
onClick: () =>
|
|
483
|
+
onClick: () => W(e, "suspend"),
|
|
479
484
|
className: "rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle/10 transition-colors",
|
|
480
485
|
children: "Suspend"
|
|
481
486
|
}) : /* @__PURE__ */ b("button", {
|
|
482
487
|
type: "button",
|
|
483
|
-
onClick: () =>
|
|
488
|
+
onClick: () => W(e, "activate"),
|
|
484
489
|
className: "rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium text-status-success-text hover:bg-status-success-bg-subtle/10 transition-colors",
|
|
485
490
|
children: "Activate"
|
|
486
491
|
}),
|
|
487
492
|
e.kycStatus === "pending" && /* @__PURE__ */ b("button", {
|
|
488
493
|
type: "button",
|
|
489
|
-
onClick: () =>
|
|
494
|
+
onClick: () => W(e, "verify"),
|
|
490
495
|
className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
|
|
491
496
|
children: "Verify"
|
|
492
497
|
})
|
|
@@ -529,7 +534,7 @@ function C() {
|
|
|
529
534
|
]
|
|
530
535
|
}) }), /* @__PURE__ */ b("tbody", {
|
|
531
536
|
className: "divide-y divide-border",
|
|
532
|
-
children:
|
|
537
|
+
children: Y.map((e) => /* @__PURE__ */ x("tr", {
|
|
533
538
|
className: "hover:bg-accent/50 transition-colors",
|
|
534
539
|
children: [
|
|
535
540
|
/* @__PURE__ */ b("td", {
|
|
@@ -568,9 +573,9 @@ function C() {
|
|
|
568
573
|
children: /* @__PURE__ */ x("div", {
|
|
569
574
|
className: "space-y-1",
|
|
570
575
|
children: [
|
|
571
|
-
|
|
576
|
+
X(e.role),
|
|
572
577
|
/* @__PURE__ */ b("br", {}),
|
|
573
|
-
|
|
578
|
+
Z(e.status)
|
|
574
579
|
]
|
|
575
580
|
})
|
|
576
581
|
}),
|
|
@@ -579,11 +584,11 @@ function C() {
|
|
|
579
584
|
children: [
|
|
580
585
|
/* @__PURE__ */ x("p", {
|
|
581
586
|
className: "text-text-primary",
|
|
582
|
-
children: ["Registered: ",
|
|
587
|
+
children: ["Registered: ", q(e.registrationDate)]
|
|
583
588
|
}),
|
|
584
589
|
e.lastLoginTime && /* @__PURE__ */ x("p", {
|
|
585
590
|
className: "text-text-secondary",
|
|
586
|
-
children: ["Last login: ",
|
|
591
|
+
children: ["Last login: ", q(e.lastLoginTime)]
|
|
587
592
|
}),
|
|
588
593
|
e.deviceInfo && /* @__PURE__ */ x("p", {
|
|
589
594
|
className: "text-text-secondary flex items-center gap-1",
|
|
@@ -599,11 +604,11 @@ function C() {
|
|
|
599
604
|
children: [e.totalOrders, " orders"]
|
|
600
605
|
}), /* @__PURE__ */ x("p", {
|
|
601
606
|
className: "text-text-secondary",
|
|
602
|
-
children: [
|
|
607
|
+
children: [J(e.totalSpent ?? 0), " spent"]
|
|
603
608
|
})] }),
|
|
604
609
|
(e.role === "cart_owner" || e.role === "worker") && e.totalEarnings != null && /* @__PURE__ */ x("p", {
|
|
605
610
|
className: "text-text-primary",
|
|
606
|
-
children: [
|
|
611
|
+
children: [J(e.totalEarnings), " earned"]
|
|
607
612
|
}),
|
|
608
613
|
e.role === "investor" && e.riskScore != null && /* @__PURE__ */ x("p", {
|
|
609
614
|
className: "text-text-primary",
|
|
@@ -651,27 +656,27 @@ function C() {
|
|
|
651
656
|
children: [
|
|
652
657
|
/* @__PURE__ */ b("button", {
|
|
653
658
|
type: "button",
|
|
654
|
-
onClick: () =>
|
|
659
|
+
onClick: () => W(e, "edit"),
|
|
655
660
|
title: "Edit",
|
|
656
661
|
className: "rounded p-1.5 text-text-secondary hover:text-text-primary hover:bg-accent transition-colors",
|
|
657
662
|
children: /* @__PURE__ */ b(l, { className: "h-4 w-4" })
|
|
658
663
|
}),
|
|
659
664
|
e.status === "active" ? /* @__PURE__ */ b("button", {
|
|
660
665
|
type: "button",
|
|
661
|
-
onClick: () =>
|
|
666
|
+
onClick: () => W(e, "suspend"),
|
|
662
667
|
title: "Suspend",
|
|
663
668
|
className: "rounded p-1.5 text-text-secondary hover:text-status-error-text hover:bg-status-error-bg-subtle/10 transition-colors",
|
|
664
669
|
children: /* @__PURE__ */ b(g, { className: "h-4 w-4" })
|
|
665
670
|
}) : /* @__PURE__ */ b("button", {
|
|
666
671
|
type: "button",
|
|
667
|
-
onClick: () =>
|
|
672
|
+
onClick: () => W(e, "activate"),
|
|
668
673
|
title: "Activate",
|
|
669
674
|
className: "rounded p-1.5 text-text-secondary hover:text-status-success-text hover:bg-status-success-bg-subtle/10 transition-colors",
|
|
670
675
|
children: /* @__PURE__ */ b(h, { className: "h-4 w-4" })
|
|
671
676
|
}),
|
|
672
677
|
e.kycStatus === "pending" && /* @__PURE__ */ b("button", {
|
|
673
678
|
type: "button",
|
|
674
|
-
onClick: () =>
|
|
679
|
+
onClick: () => W(e, "verify"),
|
|
675
680
|
title: "Verify",
|
|
676
681
|
className: "rounded p-1.5 text-text-secondary hover:text-accent-blue hover:bg-accent-blue-subtle/10 transition-colors",
|
|
677
682
|
children: /* @__PURE__ */ b(f, { className: "h-4 w-4" })
|
|
@@ -684,7 +689,7 @@ function C() {
|
|
|
684
689
|
})]
|
|
685
690
|
})
|
|
686
691
|
}),
|
|
687
|
-
|
|
692
|
+
T.length === 0 && /* @__PURE__ */ x("div", {
|
|
688
693
|
className: "flex flex-col items-center justify-center py-12 px-4",
|
|
689
694
|
children: [/* @__PURE__ */ b(_, { className: "h-10 w-10 text-text-secondary/50 mb-3" }), /* @__PURE__ */ b("p", {
|
|
690
695
|
className: "text-sm text-text-secondary",
|
|
@@ -702,20 +707,20 @@ function C() {
|
|
|
702
707
|
" ",
|
|
703
708
|
/* @__PURE__ */ b("span", {
|
|
704
709
|
className: "font-medium",
|
|
705
|
-
children: Math.min((
|
|
710
|
+
children: Math.min((L - 1) * 10 + 1, T.length)
|
|
706
711
|
}),
|
|
707
712
|
" ",
|
|
708
713
|
"to",
|
|
709
714
|
" ",
|
|
710
715
|
/* @__PURE__ */ b("span", {
|
|
711
716
|
className: "font-medium",
|
|
712
|
-
children: Math.min(
|
|
717
|
+
children: Math.min(L * 10, T.length)
|
|
713
718
|
}),
|
|
714
719
|
" ",
|
|
715
720
|
"of ",
|
|
716
721
|
/* @__PURE__ */ b("span", {
|
|
717
722
|
className: "font-medium",
|
|
718
|
-
children:
|
|
723
|
+
children: T.length
|
|
719
724
|
}),
|
|
720
725
|
" results"
|
|
721
726
|
]
|
|
@@ -723,20 +728,20 @@ function C() {
|
|
|
723
728
|
className: "flex justify-center sm:justify-end gap-2",
|
|
724
729
|
children: [/* @__PURE__ */ x("button", {
|
|
725
730
|
type: "button",
|
|
726
|
-
disabled:
|
|
727
|
-
onClick: () =>
|
|
731
|
+
disabled: L === 1,
|
|
732
|
+
onClick: () => R((e) => Math.max(1, e - 1)),
|
|
728
733
|
className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
729
734
|
children: [/* @__PURE__ */ b(s, { className: "h-4 w-4" }), "Previous"]
|
|
730
735
|
}), /* @__PURE__ */ x("button", {
|
|
731
736
|
type: "button",
|
|
732
|
-
disabled:
|
|
733
|
-
onClick: () =>
|
|
737
|
+
disabled: L * 10 >= T.length,
|
|
738
|
+
onClick: () => R((e) => e + 1),
|
|
734
739
|
className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
735
740
|
children: ["Next", /* @__PURE__ */ b(c, { className: "h-4 w-4" })]
|
|
736
741
|
})]
|
|
737
742
|
})]
|
|
738
743
|
}),
|
|
739
|
-
|
|
744
|
+
j && k && /* @__PURE__ */ b("div", {
|
|
740
745
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
741
746
|
children: /* @__PURE__ */ x("div", {
|
|
742
747
|
className: "w-full max-w-md rounded-lg border border-border-subtle bg-bg-surface shadow-lg max-h-[90vh] overflow-y-auto",
|
|
@@ -744,34 +749,34 @@ function C() {
|
|
|
744
749
|
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
745
750
|
children: [/* @__PURE__ */ b("h3", {
|
|
746
751
|
className: "text-lg font-semibold text-text-primary",
|
|
747
|
-
children:
|
|
752
|
+
children: N === "edit" ? "Edit User" : "Delete User"
|
|
748
753
|
}), /* @__PURE__ */ b("button", {
|
|
749
754
|
type: "button",
|
|
750
|
-
onClick: () =>
|
|
755
|
+
onClick: () => M(!1),
|
|
751
756
|
className: "rounded p-1.5 text-text-secondary hover:text-text-primary hover:bg-accent transition-colors",
|
|
752
757
|
children: /* @__PURE__ */ b(v, { className: "h-5 w-5" })
|
|
753
758
|
})]
|
|
754
759
|
}), /* @__PURE__ */ b("div", {
|
|
755
760
|
className: "p-4",
|
|
756
|
-
children:
|
|
761
|
+
children: N === "delete" ? /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("p", {
|
|
757
762
|
className: "text-text-secondary mb-4",
|
|
758
763
|
children: [
|
|
759
764
|
"Are you sure you want to delete user \"",
|
|
760
|
-
|
|
765
|
+
k.firstName,
|
|
761
766
|
" ",
|
|
762
|
-
|
|
767
|
+
k.lastName,
|
|
763
768
|
"\"? This action cannot be undone."
|
|
764
769
|
]
|
|
765
770
|
}), /* @__PURE__ */ x("div", {
|
|
766
771
|
className: "flex gap-3",
|
|
767
772
|
children: [/* @__PURE__ */ b("button", {
|
|
768
773
|
type: "button",
|
|
769
|
-
onClick: () =>
|
|
774
|
+
onClick: () => M(!1),
|
|
770
775
|
className: "flex-1 rounded-lg border border-border-subtle py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
771
776
|
children: "Cancel"
|
|
772
777
|
}), /* @__PURE__ */ b("button", {
|
|
773
778
|
type: "button",
|
|
774
|
-
onClick:
|
|
779
|
+
onClick: G,
|
|
775
780
|
className: "flex-1 rounded-lg bg-status-error-bg-subtle hover:bg-status-error-bg-subtle py-2 text-sm font-medium text-white transition-colors",
|
|
776
781
|
children: "Delete User"
|
|
777
782
|
})]
|
|
@@ -785,8 +790,8 @@ function C() {
|
|
|
785
790
|
children: "First Name"
|
|
786
791
|
}), /* @__PURE__ */ b("input", {
|
|
787
792
|
type: "text",
|
|
788
|
-
value:
|
|
789
|
-
onChange: (e) =>
|
|
793
|
+
value: F.firstName,
|
|
794
|
+
onChange: (e) => I((t) => ({
|
|
790
795
|
...t,
|
|
791
796
|
firstName: e.target.value
|
|
792
797
|
})),
|
|
@@ -796,8 +801,8 @@ function C() {
|
|
|
796
801
|
children: "Last Name"
|
|
797
802
|
}), /* @__PURE__ */ b("input", {
|
|
798
803
|
type: "text",
|
|
799
|
-
value:
|
|
800
|
-
onChange: (e) =>
|
|
804
|
+
value: F.lastName,
|
|
805
|
+
onChange: (e) => I((t) => ({
|
|
801
806
|
...t,
|
|
802
807
|
lastName: e.target.value
|
|
803
808
|
})),
|
|
@@ -809,8 +814,8 @@ function C() {
|
|
|
809
814
|
children: "Email"
|
|
810
815
|
}), /* @__PURE__ */ b("input", {
|
|
811
816
|
type: "email",
|
|
812
|
-
value:
|
|
813
|
-
onChange: (e) =>
|
|
817
|
+
value: F.email,
|
|
818
|
+
onChange: (e) => I((t) => ({
|
|
814
819
|
...t,
|
|
815
820
|
email: e.target.value
|
|
816
821
|
})),
|
|
@@ -821,8 +826,8 @@ function C() {
|
|
|
821
826
|
children: "Phone"
|
|
822
827
|
}), /* @__PURE__ */ b("input", {
|
|
823
828
|
type: "tel",
|
|
824
|
-
value:
|
|
825
|
-
onChange: (e) =>
|
|
829
|
+
value: F.phone,
|
|
830
|
+
onChange: (e) => I((t) => ({
|
|
826
831
|
...t,
|
|
827
832
|
phone: e.target.value
|
|
828
833
|
})),
|
|
@@ -832,8 +837,8 @@ function C() {
|
|
|
832
837
|
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
833
838
|
children: "Role"
|
|
834
839
|
}), /* @__PURE__ */ x("select", {
|
|
835
|
-
value:
|
|
836
|
-
onChange: (e) =>
|
|
840
|
+
value: F.role,
|
|
841
|
+
onChange: (e) => I((t) => ({
|
|
837
842
|
...t,
|
|
838
843
|
role: e.target.value
|
|
839
844
|
})),
|
|
@@ -863,19 +868,19 @@ function C() {
|
|
|
863
868
|
children: [
|
|
864
869
|
/* @__PURE__ */ b("button", {
|
|
865
870
|
type: "button",
|
|
866
|
-
onClick: () =>
|
|
871
|
+
onClick: () => M(!1),
|
|
867
872
|
className: "flex-1 rounded-lg border border-border-subtle py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
868
873
|
children: "Cancel"
|
|
869
874
|
}),
|
|
870
875
|
/* @__PURE__ */ b("button", {
|
|
871
876
|
type: "button",
|
|
872
|
-
onClick:
|
|
877
|
+
onClick: K,
|
|
873
878
|
className: "flex-1 rounded-lg bg-action-primary-bg py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
|
|
874
879
|
children: "Save Changes"
|
|
875
880
|
}),
|
|
876
881
|
/* @__PURE__ */ b("button", {
|
|
877
882
|
type: "button",
|
|
878
|
-
onClick: () =>
|
|
883
|
+
onClick: () => P("delete"),
|
|
879
884
|
className: "rounded-lg border border-border-subtle py-2 px-3 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle/10 transition-colors",
|
|
880
885
|
children: /* @__PURE__ */ b(m, { className: "h-4 w-4" })
|
|
881
886
|
})
|
|
@@ -888,6 +893,6 @@ function C() {
|
|
|
888
893
|
});
|
|
889
894
|
}
|
|
890
895
|
//#endregion
|
|
891
|
-
export {
|
|
896
|
+
export { w as UserManagementPage };
|
|
892
897
|
|
|
893
898
|
//# sourceMappingURL=UserManagementPage.js.map
|