@burdenoff/microfe-kadaikodi 2026.802.1 → 2026.830.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/dist/kadaikodi/KadaikodiRoot.d.ts.map +1 -1
- package/dist/kadaikodi/KadaikodiRoot.js +69 -72
- package/dist/kadaikodi/KadaikodiRoot.js.map +1 -1
- package/dist/kadaikodi/components/InvestmentCard.d.ts.map +1 -1
- package/dist/kadaikodi/components/InvestmentCard.js +58 -54
- package/dist/kadaikodi/components/InvestmentCard.js.map +1 -1
- package/dist/kadaikodi/components/OrderCard.d.ts.map +1 -1
- package/dist/kadaikodi/components/StatusBadge.d.ts.map +1 -1
- package/dist/kadaikodi/components/StatusBadge.js +25 -14
- package/dist/kadaikodi/components/StatusBadge.js.map +1 -1
- package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts +24 -0
- package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts.map +1 -1
- package/dist/kadaikodi/hooks/useKadaikodiApi.js +177 -132
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/HomePage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/HomePage.js +284 -282
- package/dist/kadaikodi/pages/HomePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.d.ts +7 -2
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +319 -228
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +1 -1
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/CartManagementPage.d.ts +10 -4
- package/dist/kadaikodi/pages/admin/CartManagementPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/admin/CartManagementPage.js +320 -279
- package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js +365 -292
- package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.d.ts +7 -2
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +300 -158
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/SettingsPage.js +286 -286
- package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDetailPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDetailPage.js +3 -3
- package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.d.ts +13 -3
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +270 -220
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js +97 -97
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.d.ts +5 -3
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +286 -199
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/kadaikodi/types/index.d.ts +46 -2
- package/dist/kadaikodi/types/index.d.ts.map +1 -1
- package/dist/shared/hooks/useTr.d.ts +2 -0
- package/dist/shared/hooks/useTr.d.ts.map +1 -0
- package/dist/shared/hooks/useTr.js +14 -0
- package/dist/shared/hooks/useTr.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/cn.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
3
|
import { EmptyState as n } from "../../components/EmptyState.js";
|
|
4
|
-
import { useProviders as
|
|
5
|
-
import { formatCurrency as
|
|
6
|
-
import { StatCard as
|
|
7
|
-
import { SegmentedTabs as
|
|
4
|
+
import { useProviders as ee, useUpdateProvider as te } from "../../hooks/useKadaikodiApi.js";
|
|
5
|
+
import { formatCurrency as ne } from "../../utils/formatters.js";
|
|
6
|
+
import { StatCard as r } from "../../components/viz/StatCard.js";
|
|
7
|
+
import { SegmentedTabs as i } from "../../components/viz/SegmentedTabs.js";
|
|
8
8
|
import "../../components/viz/index.js";
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { AlertCircle as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { GlassCard as
|
|
9
|
+
import { Fragment as a, useMemo as o, useState as s } from "react";
|
|
10
|
+
import { AlertCircle as c, Ban as re, Calendar as ie, CheckCircle2 as l, ChevronDown as u, FileText as d, IndianRupee as ae, Loader2 as oe, MapPin as se, Search as ce, Star as f, Store as p, X as le } from "lucide-react";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { GlassCard as ue, PagePurpose as de } from "@burdenoff/fe-libs/ui";
|
|
13
13
|
//#region src/kadaikodi/pages/admin/CartManagementPage.tsx
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
let t = e.
|
|
14
|
+
var g = (e) => e.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (e) => e.toUpperCase());
|
|
15
|
+
function _(e) {
|
|
16
|
+
let t = e.status ?? "DRAFT";
|
|
17
17
|
return {
|
|
18
18
|
id: e.id,
|
|
19
19
|
name: e.name,
|
|
@@ -30,41 +30,68 @@ function se(e) {
|
|
|
30
30
|
createdAt: e.createdAt ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
var
|
|
34
|
-
|
|
33
|
+
var v = {
|
|
34
|
+
VERIFIED: {
|
|
35
35
|
label: "Verified",
|
|
36
36
|
cls: "bg-status-success-bg-subtle text-status-success-text"
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
ACTIVE: {
|
|
39
|
+
label: "Active",
|
|
40
|
+
cls: "bg-status-success-bg-subtle text-status-success-text"
|
|
41
|
+
},
|
|
42
|
+
DRAFT: {
|
|
39
43
|
label: "Pending",
|
|
40
44
|
cls: "bg-status-warning-bg-subtle text-status-warning-text"
|
|
41
45
|
},
|
|
42
|
-
|
|
43
|
-
label: "
|
|
46
|
+
PAUSED: {
|
|
47
|
+
label: "Paused",
|
|
48
|
+
cls: "bg-status-warning-bg-subtle text-status-warning-text"
|
|
49
|
+
},
|
|
50
|
+
SUSPENDED: {
|
|
51
|
+
label: "Suspended",
|
|
52
|
+
cls: "bg-status-error-bg-subtle text-status-error-text"
|
|
53
|
+
},
|
|
54
|
+
ARCHIVED: {
|
|
55
|
+
label: "Archived",
|
|
44
56
|
cls: "bg-bg-sunken text-text-secondary"
|
|
45
57
|
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
}, y = [
|
|
59
|
+
"DRAFT",
|
|
60
|
+
"VERIFIED",
|
|
61
|
+
"ACTIVE",
|
|
62
|
+
"PAUSED",
|
|
63
|
+
"SUSPENDED",
|
|
64
|
+
"ARCHIVED"
|
|
65
|
+
], b = (e) => e === "ACTIVE" || e === "VERIFIED" || e === "PAUSED" || e === "DRAFT";
|
|
66
|
+
function x() {
|
|
67
|
+
let { data: x = [], isLoading: fe } = ee(), S = te(), [C, w] = s(null), T = (e, t) => {
|
|
68
|
+
w({
|
|
50
69
|
text: e,
|
|
51
70
|
type: t
|
|
52
|
-
}), setTimeout(() =>
|
|
53
|
-
}, [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
}), setTimeout(() => w(null), 3500);
|
|
72
|
+
}, [E, D] = s("all"), [O, k] = s(""), [A, j] = s(""), [M, N] = s("recent"), [P, F] = s(null), [I, L] = s(null), [R, z] = s("approve"), [B, V] = s(!1), [H, U] = s(""), W = o(() => x.map(_), [x]), G = o(() => {
|
|
73
|
+
let e = y.reduce((e, t) => (e[t] = W.filter((e) => e.status === t).length, e), {
|
|
74
|
+
DRAFT: 0,
|
|
75
|
+
ACTIVE: 0,
|
|
76
|
+
VERIFIED: 0,
|
|
77
|
+
PAUSED: 0,
|
|
78
|
+
SUSPENDED: 0,
|
|
79
|
+
ARCHIVED: 0
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
all: W.length,
|
|
83
|
+
byStatus: e
|
|
84
|
+
};
|
|
85
|
+
}, [W]), K = o(() => {
|
|
86
|
+
let e = W.filter((e) => e.rating > 0);
|
|
60
87
|
return e.length === 0 ? 0 : e.reduce((e, t) => e + t.rating, 0) / e.length;
|
|
61
|
-
}, [
|
|
62
|
-
let e = [...
|
|
63
|
-
if (
|
|
64
|
-
let t =
|
|
88
|
+
}, [W]), pe = o(() => Array.from(new Set(W.map((e) => e.category))).sort(), [W]), q = o(() => {
|
|
89
|
+
let e = [...W];
|
|
90
|
+
if (E !== "all" && (e = e.filter((e) => e.status === E)), A && (e = e.filter((e) => e.category === A)), O) {
|
|
91
|
+
let t = O.toLowerCase();
|
|
65
92
|
e = e.filter((e) => e.name.toLowerCase().includes(t) || e.category.toLowerCase().includes(t) || e.address.toLowerCase().includes(t));
|
|
66
93
|
}
|
|
67
|
-
switch (
|
|
94
|
+
switch (M) {
|
|
68
95
|
case "name":
|
|
69
96
|
e.sort((e, t) => e.name.localeCompare(t.name));
|
|
70
97
|
break;
|
|
@@ -78,174 +105,189 @@ function S() {
|
|
|
78
105
|
}
|
|
79
106
|
return e;
|
|
80
107
|
}, [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
]),
|
|
108
|
+
W,
|
|
109
|
+
E,
|
|
110
|
+
A,
|
|
111
|
+
O,
|
|
112
|
+
M
|
|
113
|
+
]), J = (e) => ne(e, { minimumFractionDigits: 0 }), Y = (e) => new Date(e).toLocaleDateString("en-IN", {
|
|
87
114
|
year: "numeric",
|
|
88
115
|
month: "short",
|
|
89
116
|
day: "numeric"
|
|
90
117
|
}), X = (e, t) => {
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
if (!
|
|
94
|
-
if (
|
|
95
|
-
|
|
118
|
+
L(e), z(t), U(""), V(!0);
|
|
119
|
+
}, me = () => {
|
|
120
|
+
if (!I) return;
|
|
121
|
+
if (R === "reject" && !H.trim()) {
|
|
122
|
+
T("Please provide a rejection reason", "error");
|
|
96
123
|
return;
|
|
97
124
|
}
|
|
98
|
-
let e =
|
|
99
|
-
|
|
100
|
-
id:
|
|
125
|
+
let e = R === "approve" ? "VERIFIED" : R === "reject" ? "ARCHIVED" : R === "reinstate" ? "ACTIVE" : "SUSPENDED";
|
|
126
|
+
S.mutate({
|
|
127
|
+
id: I.id,
|
|
101
128
|
input: { status: e }
|
|
102
129
|
}, {
|
|
103
130
|
onSuccess: () => {
|
|
104
|
-
let e =
|
|
105
|
-
|
|
131
|
+
let e = R === "approve" ? "approved & verified" : R === "reject" ? "rejected" : R === "reinstate" ? "reinstated" : "suspended";
|
|
132
|
+
T(`"${I.name}" ${e}.`, "success"), V(!1), U("");
|
|
106
133
|
},
|
|
107
|
-
onError: () =>
|
|
134
|
+
onError: () => T(`Could not ${R} "${I.name}". Please try again.`, "error")
|
|
108
135
|
});
|
|
109
|
-
}, Z = ({ status: t }) => /* @__PURE__ */
|
|
110
|
-
className: e("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",
|
|
111
|
-
children:
|
|
112
|
-
}), Q = ({ m: t, compact: n }) => /* @__PURE__ */
|
|
136
|
+
}, Z = ({ status: t }) => /* @__PURE__ */ m("span", {
|
|
137
|
+
className: e("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", v[t].cls),
|
|
138
|
+
children: v[t].label
|
|
139
|
+
}), Q = ({ m: t, compact: n }) => /* @__PURE__ */ h("div", {
|
|
113
140
|
className: e("flex gap-2", n ? "flex-wrap" : "items-center justify-end"),
|
|
114
|
-
children: [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
141
|
+
children: [
|
|
142
|
+
t.status !== "VERIFIED" && t.status !== "ARCHIVED" && /* @__PURE__ */ m("button", {
|
|
143
|
+
type: "button",
|
|
144
|
+
onClick: () => X(t, "approve"),
|
|
145
|
+
className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
146
|
+
children: "Approve"
|
|
147
|
+
}),
|
|
148
|
+
b(t.status) && /* @__PURE__ */ m("button", {
|
|
149
|
+
type: "button",
|
|
150
|
+
onClick: () => X(t, "suspend"),
|
|
151
|
+
className: "rounded-lg border border-border-default px-3 py-1.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
|
|
152
|
+
children: "Suspend"
|
|
153
|
+
}),
|
|
154
|
+
t.status === "SUSPENDED" && /* @__PURE__ */ m("button", {
|
|
155
|
+
type: "button",
|
|
156
|
+
onClick: () => X(t, "reinstate"),
|
|
157
|
+
className: "rounded-lg border border-status-success-text/40 px-3 py-1.5 text-sm font-medium text-status-success-text transition-colors hover:bg-status-success-bg-subtle",
|
|
158
|
+
children: "Reinstate"
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
}), $ = ({ m: e }) => /* @__PURE__ */ h("div", {
|
|
126
162
|
className: "rounded-lg border border-border-subtle bg-bg-sunken/40 p-4",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ h("div", {
|
|
128
164
|
className: "grid grid-cols-1 gap-6 md:grid-cols-2",
|
|
129
|
-
children: [/* @__PURE__ */
|
|
165
|
+
children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h4", {
|
|
130
166
|
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
131
167
|
children: "Business Details"
|
|
132
|
-
}), /* @__PURE__ */
|
|
168
|
+
}), /* @__PURE__ */ h("dl", {
|
|
133
169
|
className: "space-y-2 text-sm",
|
|
134
170
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ h("div", {
|
|
136
172
|
className: "flex gap-2",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ m("dt", {
|
|
138
174
|
className: "w-28 shrink-0 text-text-secondary",
|
|
139
175
|
children: "Merchant"
|
|
140
|
-
}), /* @__PURE__ */
|
|
176
|
+
}), /* @__PURE__ */ m("dd", {
|
|
141
177
|
className: "font-medium text-text-primary",
|
|
142
178
|
children: e.name
|
|
143
179
|
})]
|
|
144
180
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ h("div", {
|
|
146
182
|
className: "flex gap-2",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ m("dt", {
|
|
148
184
|
className: "w-28 shrink-0 text-text-secondary",
|
|
149
185
|
children: "Category"
|
|
150
|
-
}), /* @__PURE__ */
|
|
186
|
+
}), /* @__PURE__ */ m("dd", {
|
|
151
187
|
className: "text-text-primary",
|
|
152
|
-
children:
|
|
188
|
+
children: g(e.category)
|
|
153
189
|
})]
|
|
154
190
|
}),
|
|
155
|
-
e.address && /* @__PURE__ */
|
|
191
|
+
e.address && /* @__PURE__ */ h("div", {
|
|
156
192
|
className: "flex gap-2",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ m("dt", {
|
|
158
194
|
className: "w-28 shrink-0 text-text-secondary",
|
|
159
195
|
children: "Address"
|
|
160
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ h("dd", {
|
|
161
197
|
className: "flex items-start gap-1 text-text-primary",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ m(se, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-text-secondary" }), e.address]
|
|
163
199
|
})]
|
|
164
200
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ h("div", {
|
|
166
202
|
className: "flex gap-2",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
203
|
+
children: [/* @__PURE__ */ m("dt", {
|
|
168
204
|
className: "w-28 shrink-0 text-text-secondary",
|
|
169
205
|
children: "Applied"
|
|
170
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ h("dd", {
|
|
171
207
|
className: "flex items-center gap-1 text-text-primary",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ m(ie, { className: "h-3.5 w-3.5 text-text-secondary" }), Y(e.createdAt)]
|
|
173
209
|
})]
|
|
174
210
|
}),
|
|
175
|
-
e.ownerId && /* @__PURE__ */
|
|
211
|
+
e.ownerId && /* @__PURE__ */ h("div", {
|
|
176
212
|
className: "flex gap-2",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ m("dt", {
|
|
178
214
|
className: "w-28 shrink-0 text-text-secondary",
|
|
179
215
|
children: "Owner ID"
|
|
180
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ m("dd", {
|
|
181
217
|
className: "truncate font-mono text-xs text-text-primary",
|
|
182
218
|
children: e.ownerId
|
|
183
219
|
})]
|
|
184
220
|
})
|
|
185
221
|
]
|
|
186
|
-
})] }), /* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */
|
|
222
|
+
})] }), /* @__PURE__ */ h("div", { children: [
|
|
223
|
+
/* @__PURE__ */ m("h4", {
|
|
188
224
|
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
189
225
|
children: "Performance"
|
|
190
226
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ h("div", {
|
|
192
228
|
className: "grid grid-cols-2 gap-3",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ h("div", {
|
|
194
230
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
|
|
195
231
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ m("p", {
|
|
197
233
|
className: "text-xs text-text-secondary",
|
|
198
234
|
children: "Rating"
|
|
199
235
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ h("p", {
|
|
201
237
|
className: "flex items-center gap-1 text-lg font-bold text-text-primary",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }), e.rating > 0 ? e.rating.toFixed(1) : "—"]
|
|
203
239
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ h("p", {
|
|
205
241
|
className: "text-xs text-text-secondary",
|
|
206
242
|
children: [e.reviewCount, " reviews"]
|
|
207
243
|
})
|
|
208
244
|
]
|
|
209
|
-
}), /* @__PURE__ */
|
|
245
|
+
}), /* @__PURE__ */ h("div", {
|
|
210
246
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
247
|
+
children: [/* @__PURE__ */ m("p", {
|
|
212
248
|
className: "text-xs text-text-secondary",
|
|
213
249
|
children: "Avg Order Value"
|
|
214
|
-
}), /* @__PURE__ */
|
|
250
|
+
}), /* @__PURE__ */ h("p", {
|
|
215
251
|
className: "flex items-center gap-0.5 text-lg font-bold text-text-primary",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ m(ae, { className: "h-3.5 w-3.5" }), e.avgOrderValue > 0 ? e.avgOrderValue.toLocaleString("en-IN") : "—"]
|
|
217
253
|
})]
|
|
218
254
|
})]
|
|
219
255
|
}),
|
|
220
|
-
e.serviceTypes.length > 0 && /* @__PURE__ */
|
|
256
|
+
e.serviceTypes.length > 0 && /* @__PURE__ */ m("div", {
|
|
221
257
|
className: "mt-3 flex flex-wrap gap-1.5",
|
|
222
|
-
children: e.serviceTypes.map((e) => /* @__PURE__ */
|
|
258
|
+
children: e.serviceTypes.map((e) => /* @__PURE__ */ m("span", {
|
|
223
259
|
className: "rounded-full bg-bg-surface px-2 py-0.5 text-xs text-text-secondary",
|
|
224
|
-
children:
|
|
260
|
+
children: g(e)
|
|
225
261
|
}, e))
|
|
226
262
|
})
|
|
227
263
|
] })]
|
|
228
|
-
}), /* @__PURE__ */
|
|
264
|
+
}), /* @__PURE__ */ h("div", {
|
|
229
265
|
className: "mt-4 flex flex-col items-start justify-between gap-3 border-t border-border-subtle pt-4 sm:flex-row sm:items-center",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
266
|
+
children: [/* @__PURE__ */ h("p", {
|
|
231
267
|
className: "flex items-center gap-1.5 text-xs text-text-muted",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
233
|
-
}), /* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ m(d, { className: "h-3.5 w-3.5" }), "Verification documents are not stored on the platform yet."]
|
|
269
|
+
}), /* @__PURE__ */ h("div", {
|
|
234
270
|
className: "flex flex-wrap gap-2",
|
|
235
271
|
children: [
|
|
236
|
-
|
|
272
|
+
e.status !== "VERIFIED" && e.status !== "ARCHIVED" && /* @__PURE__ */ m("button", {
|
|
237
273
|
type: "button",
|
|
238
274
|
onClick: () => X(e, "reject"),
|
|
239
275
|
className: "rounded-lg border border-status-error-text/40 px-3 py-1.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
|
|
240
276
|
children: "Reject"
|
|
241
277
|
}),
|
|
242
|
-
|
|
278
|
+
e.status !== "VERIFIED" && e.status !== "ARCHIVED" && /* @__PURE__ */ m("button", {
|
|
243
279
|
type: "button",
|
|
244
280
|
onClick: () => X(e, "approve"),
|
|
245
281
|
className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
246
282
|
children: "Approve Merchant"
|
|
247
283
|
}),
|
|
248
|
-
e.status
|
|
284
|
+
e.status === "SUSPENDED" && /* @__PURE__ */ m("button", {
|
|
285
|
+
type: "button",
|
|
286
|
+
onClick: () => X(e, "reinstate"),
|
|
287
|
+
className: "rounded-lg border border-status-success-text/40 px-3 py-1.5 text-sm font-medium text-status-success-text transition-colors hover:bg-status-success-bg-subtle",
|
|
288
|
+
children: "Reinstate Merchant"
|
|
289
|
+
}),
|
|
290
|
+
b(e.status) && /* @__PURE__ */ m("button", {
|
|
249
291
|
type: "button",
|
|
250
292
|
onClick: () => X(e, "suspend"),
|
|
251
293
|
className: "rounded-lg border border-border-default px-3 py-1.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
|
|
@@ -255,130 +297,122 @@ function S() {
|
|
|
255
297
|
})]
|
|
256
298
|
})]
|
|
257
299
|
});
|
|
258
|
-
return
|
|
300
|
+
return fe ? /* @__PURE__ */ m(t, {
|
|
259
301
|
title: "Merchants",
|
|
260
302
|
description: "Loading merchants...",
|
|
261
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ h("div", {
|
|
262
304
|
className: "flex flex-col items-center justify-center py-20",
|
|
263
|
-
children: [/* @__PURE__ */
|
|
305
|
+
children: [/* @__PURE__ */ m(oe, { className: "mb-4 h-10 w-10 animate-spin text-text-secondary" }), /* @__PURE__ */ m("p", {
|
|
264
306
|
className: "text-text-secondary",
|
|
265
307
|
children: "Loading merchants..."
|
|
266
308
|
})]
|
|
267
309
|
})
|
|
268
|
-
}) : /* @__PURE__ */
|
|
310
|
+
}) : /* @__PURE__ */ h(t, {
|
|
269
311
|
title: "Merchants",
|
|
270
|
-
description: `${
|
|
312
|
+
description: `${G.all} merchants on the platform · ${G.byStatus.DRAFT} awaiting review`,
|
|
271
313
|
children: [
|
|
272
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ m(de, {
|
|
273
315
|
className: "mb-6",
|
|
274
316
|
children: "Onboard and oversee every merchant (cart) on Kadaikodi. Approve and verify legitimate businesses, suspend ones that break the rules, and keep an eye on ratings and performance — so customers only ever see trustworthy, active merchants."
|
|
275
317
|
}),
|
|
276
|
-
|
|
277
|
-
className: e("mb-6 flex items-center gap-2 rounded-lg border p-3",
|
|
278
|
-
children: [
|
|
279
|
-
className: e("text-sm font-medium",
|
|
280
|
-
children:
|
|
318
|
+
C && /* @__PURE__ */ h("div", {
|
|
319
|
+
className: e("mb-6 flex items-center gap-2 rounded-lg border p-3", C.type === "success" ? "border-status-success-text/30 bg-status-success-bg-subtle" : "border-status-error-text/30 bg-status-error-bg-subtle"),
|
|
320
|
+
children: [C.type === "success" ? /* @__PURE__ */ m(l, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ m(c, { className: "h-4 w-4 text-status-error-text" }), /* @__PURE__ */ m("span", {
|
|
321
|
+
className: e("text-sm font-medium", C.type === "success" ? "text-status-success-text" : "text-status-error-text"),
|
|
322
|
+
children: C.text
|
|
281
323
|
})]
|
|
282
324
|
}),
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
className: "mb-6 grid grid-cols-2 gap-4 lg:grid-cols-
|
|
325
|
+
/* @__PURE__ */ h("div", {
|
|
326
|
+
className: "mb-6 grid grid-cols-2 gap-4 lg:grid-cols-5",
|
|
285
327
|
children: [
|
|
286
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ m(r, {
|
|
287
329
|
label: "Total Merchants",
|
|
288
|
-
value:
|
|
289
|
-
icon: /* @__PURE__ */
|
|
330
|
+
value: G.all.toLocaleString("en-IN"),
|
|
331
|
+
icon: /* @__PURE__ */ m(p, { className: "h-4 w-4" })
|
|
290
332
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ m(r, {
|
|
292
334
|
label: "Pending Review",
|
|
293
|
-
value:
|
|
294
|
-
icon: /* @__PURE__ */
|
|
335
|
+
value: G.byStatus.DRAFT.toLocaleString("en-IN"),
|
|
336
|
+
icon: /* @__PURE__ */ m(c, { className: "h-4 w-4" })
|
|
295
337
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ m(r, {
|
|
297
339
|
label: "Verified",
|
|
298
|
-
value:
|
|
299
|
-
icon: /* @__PURE__ */
|
|
340
|
+
value: G.byStatus.VERIFIED.toLocaleString("en-IN"),
|
|
341
|
+
icon: /* @__PURE__ */ m(l, { className: "h-4 w-4" })
|
|
342
|
+
}),
|
|
343
|
+
/* @__PURE__ */ m(r, {
|
|
344
|
+
label: "Suspended",
|
|
345
|
+
value: G.byStatus.SUSPENDED.toLocaleString("en-IN"),
|
|
346
|
+
icon: /* @__PURE__ */ m(re, { className: "h-4 w-4" })
|
|
300
347
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ m(r, {
|
|
302
349
|
label: "Avg Rating",
|
|
303
|
-
value:
|
|
304
|
-
icon: /* @__PURE__ */
|
|
350
|
+
value: K > 0 ? K.toFixed(1) : "—",
|
|
351
|
+
icon: /* @__PURE__ */ m(f, { className: "h-4 w-4" })
|
|
305
352
|
})
|
|
306
353
|
]
|
|
307
354
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ h("div", {
|
|
309
356
|
className: "mb-6 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ m("div", {
|
|
311
358
|
className: "overflow-x-auto",
|
|
312
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ m(i, {
|
|
313
360
|
"aria-label": "Filter merchants by status",
|
|
314
|
-
value:
|
|
315
|
-
onChange: (e) =>
|
|
316
|
-
tabs: [
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
count: K.pending
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
id: "verified",
|
|
329
|
-
label: "Verified",
|
|
330
|
-
count: K.verified
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
id: "inactive",
|
|
334
|
-
label: "Inactive",
|
|
335
|
-
count: K.inactive
|
|
336
|
-
}
|
|
337
|
-
]
|
|
361
|
+
value: E,
|
|
362
|
+
onChange: (e) => D(e),
|
|
363
|
+
tabs: [{
|
|
364
|
+
id: "all",
|
|
365
|
+
label: "All",
|
|
366
|
+
count: G.all
|
|
367
|
+
}, ...y.map((e) => ({
|
|
368
|
+
id: e,
|
|
369
|
+
label: v[e].label,
|
|
370
|
+
count: G.byStatus[e]
|
|
371
|
+
}))]
|
|
338
372
|
})
|
|
339
|
-
}), /* @__PURE__ */
|
|
373
|
+
}), /* @__PURE__ */ h("div", {
|
|
340
374
|
className: "flex flex-col gap-3 sm:flex-row",
|
|
341
375
|
children: [
|
|
342
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ h("div", {
|
|
343
377
|
className: "relative",
|
|
344
|
-
children: [/* @__PURE__ */
|
|
378
|
+
children: [/* @__PURE__ */ m(ce, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ m("input", {
|
|
345
379
|
type: "text",
|
|
346
380
|
placeholder: "Search merchants...",
|
|
347
|
-
value:
|
|
348
|
-
onChange: (e) =>
|
|
381
|
+
value: O,
|
|
382
|
+
onChange: (e) => k(e.target.value),
|
|
349
383
|
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)] sm:w-64"
|
|
350
384
|
})]
|
|
351
385
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
value:
|
|
354
|
-
onChange: (e) =>
|
|
386
|
+
/* @__PURE__ */ h("select", {
|
|
387
|
+
value: A,
|
|
388
|
+
onChange: (e) => j(e.target.value),
|
|
355
389
|
className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ m("option", {
|
|
357
391
|
value: "",
|
|
358
392
|
children: "All Categories"
|
|
359
|
-
}),
|
|
393
|
+
}), pe.map((e) => /* @__PURE__ */ m("option", {
|
|
360
394
|
value: e,
|
|
361
|
-
children:
|
|
395
|
+
children: g(e)
|
|
362
396
|
}, e))]
|
|
363
397
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
value:
|
|
366
|
-
onChange: (e) =>
|
|
398
|
+
/* @__PURE__ */ h("select", {
|
|
399
|
+
value: M,
|
|
400
|
+
onChange: (e) => N(e.target.value),
|
|
367
401
|
className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
368
402
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ m("option", {
|
|
370
404
|
value: "recent",
|
|
371
405
|
children: "Most Recent"
|
|
372
406
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ m("option", {
|
|
374
408
|
value: "name",
|
|
375
409
|
children: "Name A–Z"
|
|
376
410
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ m("option", {
|
|
378
412
|
value: "rating",
|
|
379
413
|
children: "Highest Rated"
|
|
380
414
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ m("option", {
|
|
382
416
|
value: "value",
|
|
383
417
|
children: "Highest Avg Order"
|
|
384
418
|
})
|
|
@@ -387,78 +421,78 @@ function S() {
|
|
|
387
421
|
]
|
|
388
422
|
})]
|
|
389
423
|
}),
|
|
390
|
-
|
|
424
|
+
q.length === 0 ? /* @__PURE__ */ m(n, {
|
|
391
425
|
illustration: "empty-search",
|
|
392
426
|
title: "No merchants found",
|
|
393
427
|
description: "No merchants match your current filters. Try clearing the search or switching tabs.",
|
|
394
|
-
action: /* @__PURE__ */
|
|
428
|
+
action: /* @__PURE__ */ m("button", {
|
|
395
429
|
type: "button",
|
|
396
430
|
onClick: () => {
|
|
397
|
-
|
|
431
|
+
k(""), j(""), D("all");
|
|
398
432
|
},
|
|
399
433
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
|
|
400
434
|
children: "Clear filters"
|
|
401
435
|
})
|
|
402
|
-
}) : /* @__PURE__ */
|
|
436
|
+
}) : /* @__PURE__ */ h(ue, {
|
|
403
437
|
treatment: "plain",
|
|
404
438
|
className: "overflow-hidden",
|
|
405
|
-
children: [/* @__PURE__ */
|
|
439
|
+
children: [/* @__PURE__ */ m("div", {
|
|
406
440
|
className: "hidden overflow-x-auto md:block",
|
|
407
|
-
children: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ h("table", {
|
|
408
442
|
className: "w-full",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
443
|
+
children: [/* @__PURE__ */ m("thead", { children: /* @__PURE__ */ h("tr", {
|
|
410
444
|
className: "border-b border-border-subtle bg-bg-sunken/50",
|
|
411
445
|
children: [
|
|
412
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ m("th", {
|
|
413
447
|
className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
|
|
414
448
|
children: "Merchant"
|
|
415
449
|
}),
|
|
416
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ m("th", {
|
|
417
451
|
className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
|
|
418
452
|
children: "Category"
|
|
419
453
|
}),
|
|
420
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ m("th", {
|
|
421
455
|
className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
|
|
422
456
|
children: "Status"
|
|
423
457
|
}),
|
|
424
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ m("th", {
|
|
425
459
|
className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
|
|
426
460
|
children: "Rating"
|
|
427
461
|
}),
|
|
428
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ m("th", {
|
|
429
463
|
className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
|
|
430
464
|
children: "Avg Order"
|
|
431
465
|
}),
|
|
432
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ m("th", {
|
|
433
467
|
className: "px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-text-secondary",
|
|
434
468
|
children: "Actions"
|
|
435
469
|
})
|
|
436
470
|
]
|
|
437
|
-
}) }), /* @__PURE__ */
|
|
471
|
+
}) }), /* @__PURE__ */ m("tbody", {
|
|
438
472
|
className: "divide-y divide-border",
|
|
439
|
-
children:
|
|
440
|
-
let n =
|
|
441
|
-
return /* @__PURE__ */
|
|
473
|
+
children: q.map((t) => {
|
|
474
|
+
let n = P === t.id;
|
|
475
|
+
return /* @__PURE__ */ h(a, { children: [/* @__PURE__ */ h("tr", {
|
|
442
476
|
className: "transition-colors hover:bg-accent/50",
|
|
443
477
|
children: [
|
|
444
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ m("td", {
|
|
445
479
|
className: "px-4 py-3",
|
|
446
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ h("button", {
|
|
447
481
|
type: "button",
|
|
448
|
-
onClick: () =>
|
|
482
|
+
onClick: () => F(n ? null : t.id),
|
|
449
483
|
className: "flex items-center gap-3 text-left",
|
|
450
484
|
children: [
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ m(u, { className: e("h-4 w-4 shrink-0 text-text-secondary transition-transform", n && "rotate-180") }),
|
|
486
|
+
/* @__PURE__ */ m("div", {
|
|
453
487
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
|
|
454
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ m(p, { className: "h-5 w-5" })
|
|
455
489
|
}),
|
|
456
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ h("div", {
|
|
457
491
|
className: "min-w-0",
|
|
458
|
-
children: [/* @__PURE__ */
|
|
492
|
+
children: [/* @__PURE__ */ m("p", {
|
|
459
493
|
className: "truncate text-sm font-medium text-text-primary",
|
|
460
494
|
children: t.name
|
|
461
|
-
}), t.address && /* @__PURE__ */
|
|
495
|
+
}), t.address && /* @__PURE__ */ m("p", {
|
|
462
496
|
className: "truncate text-xs text-text-secondary",
|
|
463
497
|
children: t.address
|
|
464
498
|
})]
|
|
@@ -466,22 +500,22 @@ function S() {
|
|
|
466
500
|
]
|
|
467
501
|
})
|
|
468
502
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ m("td", {
|
|
470
504
|
className: "px-4 py-3 text-sm text-text-secondary",
|
|
471
|
-
children:
|
|
505
|
+
children: g(t.category)
|
|
472
506
|
}),
|
|
473
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ m("td", {
|
|
474
508
|
className: "px-4 py-3",
|
|
475
|
-
children: /* @__PURE__ */
|
|
509
|
+
children: /* @__PURE__ */ m(Z, { status: t.status })
|
|
476
510
|
}),
|
|
477
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ m("td", {
|
|
478
512
|
className: "px-4 py-3 text-sm",
|
|
479
|
-
children: t.rating > 0 ? /* @__PURE__ */
|
|
513
|
+
children: t.rating > 0 ? /* @__PURE__ */ h("span", {
|
|
480
514
|
className: "flex items-center gap-1 text-text-primary",
|
|
481
515
|
children: [
|
|
482
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ m(f, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" }),
|
|
483
517
|
t.rating.toFixed(1),
|
|
484
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ h("span", {
|
|
485
519
|
className: "text-text-secondary",
|
|
486
520
|
children: [
|
|
487
521
|
"(",
|
|
@@ -490,174 +524,181 @@ function S() {
|
|
|
490
524
|
]
|
|
491
525
|
})
|
|
492
526
|
]
|
|
493
|
-
}) : /* @__PURE__ */
|
|
527
|
+
}) : /* @__PURE__ */ m("span", {
|
|
494
528
|
className: "text-text-secondary",
|
|
495
529
|
children: "—"
|
|
496
530
|
})
|
|
497
531
|
}),
|
|
498
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ m("td", {
|
|
499
533
|
className: "px-4 py-3 text-sm text-text-primary",
|
|
500
|
-
children: t.avgOrderValue > 0 ?
|
|
534
|
+
children: t.avgOrderValue > 0 ? J(t.avgOrderValue) : "—"
|
|
501
535
|
}),
|
|
502
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ m("td", {
|
|
503
537
|
className: "px-4 py-3",
|
|
504
|
-
children: /* @__PURE__ */
|
|
538
|
+
children: /* @__PURE__ */ m(Q, { m: t })
|
|
505
539
|
})
|
|
506
540
|
]
|
|
507
|
-
}), n && /* @__PURE__ */
|
|
541
|
+
}), n && /* @__PURE__ */ m("tr", {
|
|
508
542
|
className: "bg-bg-sunken/20",
|
|
509
|
-
children: /* @__PURE__ */
|
|
543
|
+
children: /* @__PURE__ */ m("td", {
|
|
510
544
|
colSpan: 6,
|
|
511
545
|
className: "px-4 py-4",
|
|
512
|
-
children: /* @__PURE__ */
|
|
546
|
+
children: /* @__PURE__ */ m($, { m: t })
|
|
513
547
|
})
|
|
514
548
|
})] }, t.id);
|
|
515
549
|
})
|
|
516
550
|
})]
|
|
517
551
|
})
|
|
518
|
-
}), /* @__PURE__ */
|
|
552
|
+
}), /* @__PURE__ */ m("div", {
|
|
519
553
|
className: "space-y-4 p-4 md:hidden",
|
|
520
|
-
children:
|
|
521
|
-
let n =
|
|
522
|
-
return /* @__PURE__ */
|
|
554
|
+
children: q.map((t) => {
|
|
555
|
+
let n = P === t.id;
|
|
556
|
+
return /* @__PURE__ */ h("div", {
|
|
523
557
|
className: "rounded-lg border border-border-subtle bg-bg-sunken/30 p-4",
|
|
524
558
|
children: [
|
|
525
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ h("div", {
|
|
526
560
|
className: "mb-3 flex items-start gap-3",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
561
|
+
children: [/* @__PURE__ */ m("div", {
|
|
528
562
|
className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
|
|
529
|
-
children: /* @__PURE__ */
|
|
530
|
-
}), /* @__PURE__ */
|
|
563
|
+
children: /* @__PURE__ */ m(p, { className: "h-6 w-6" })
|
|
564
|
+
}), /* @__PURE__ */ h("div", {
|
|
531
565
|
className: "min-w-0 flex-1",
|
|
532
566
|
children: [
|
|
533
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ m("h3", {
|
|
534
568
|
className: "truncate font-medium text-text-primary",
|
|
535
569
|
children: t.name
|
|
536
570
|
}),
|
|
537
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ m("p", {
|
|
538
572
|
className: "truncate text-sm text-text-secondary",
|
|
539
|
-
children:
|
|
573
|
+
children: g(t.category)
|
|
540
574
|
}),
|
|
541
|
-
t.address && /* @__PURE__ */
|
|
575
|
+
t.address && /* @__PURE__ */ m("p", {
|
|
542
576
|
className: "truncate text-xs text-text-secondary",
|
|
543
577
|
children: t.address
|
|
544
578
|
})
|
|
545
579
|
]
|
|
546
580
|
})]
|
|
547
581
|
}),
|
|
548
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ h("div", {
|
|
549
583
|
className: "mb-3 flex flex-wrap items-center gap-2",
|
|
550
584
|
children: [
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
-
t.rating > 0 && /* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ m(Z, { status: t.status }),
|
|
586
|
+
t.rating > 0 && /* @__PURE__ */ h("span", {
|
|
553
587
|
className: "inline-flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2.5 py-0.5 text-xs font-medium text-status-warning-text",
|
|
554
588
|
children: [
|
|
555
|
-
/* @__PURE__ */
|
|
589
|
+
/* @__PURE__ */ m(f, { className: "h-3 w-3 fill-current" }),
|
|
556
590
|
t.rating.toFixed(1),
|
|
557
591
|
" (",
|
|
558
592
|
t.reviewCount,
|
|
559
593
|
")"
|
|
560
594
|
]
|
|
561
595
|
}),
|
|
562
|
-
t.avgOrderValue > 0 && /* @__PURE__ */
|
|
596
|
+
t.avgOrderValue > 0 && /* @__PURE__ */ h("span", {
|
|
563
597
|
className: "text-xs text-text-secondary",
|
|
564
|
-
children: ["Avg ",
|
|
598
|
+
children: ["Avg ", J(t.avgOrderValue)]
|
|
565
599
|
})
|
|
566
600
|
]
|
|
567
601
|
}),
|
|
568
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ m("div", {
|
|
569
603
|
className: "mb-3",
|
|
570
|
-
children: /* @__PURE__ */
|
|
604
|
+
children: /* @__PURE__ */ m(Q, {
|
|
571
605
|
m: t,
|
|
572
606
|
compact: !0
|
|
573
607
|
})
|
|
574
608
|
}),
|
|
575
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ h("button", {
|
|
576
610
|
type: "button",
|
|
577
|
-
onClick: () =>
|
|
611
|
+
onClick: () => F(n ? null : t.id),
|
|
578
612
|
className: "flex w-full items-center justify-center gap-1 rounded-lg border border-border-subtle py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
|
|
579
|
-
children: [n ? "Hide details" : "View details", /* @__PURE__ */
|
|
613
|
+
children: [n ? "Hide details" : "View details", /* @__PURE__ */ m(u, { className: e("h-4 w-4 transition-transform", n && "rotate-180") })]
|
|
580
614
|
}),
|
|
581
|
-
n && /* @__PURE__ */
|
|
615
|
+
n && /* @__PURE__ */ m("div", {
|
|
582
616
|
className: "mt-3",
|
|
583
|
-
children: /* @__PURE__ */
|
|
617
|
+
children: /* @__PURE__ */ m($, { m: t })
|
|
584
618
|
})
|
|
585
619
|
]
|
|
586
620
|
}, t.id);
|
|
587
621
|
})
|
|
588
622
|
})]
|
|
589
623
|
}),
|
|
590
|
-
|
|
624
|
+
B && I && /* @__PURE__ */ m("div", {
|
|
591
625
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
592
|
-
children: /* @__PURE__ */
|
|
626
|
+
children: /* @__PURE__ */ h("div", {
|
|
593
627
|
className: "max-h-[90vh] w-full max-w-lg overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-lg",
|
|
594
|
-
children: [/* @__PURE__ */
|
|
628
|
+
children: [/* @__PURE__ */ h("div", {
|
|
595
629
|
className: "flex items-center justify-between border-b border-border-subtle p-4",
|
|
596
|
-
children: [/* @__PURE__ */
|
|
630
|
+
children: [/* @__PURE__ */ m("h3", {
|
|
597
631
|
className: "text-lg font-semibold text-text-primary",
|
|
598
|
-
children:
|
|
599
|
-
}), /* @__PURE__ */
|
|
632
|
+
children: R === "approve" ? "Approve Merchant" : R === "reject" ? "Reject Merchant" : R === "reinstate" ? "Reinstate Merchant" : "Suspend Merchant"
|
|
633
|
+
}), /* @__PURE__ */ m("button", {
|
|
600
634
|
type: "button",
|
|
601
|
-
onClick: () =>
|
|
635
|
+
onClick: () => V(!1),
|
|
602
636
|
className: "rounded p-1.5 text-text-secondary transition-colors hover:bg-accent hover:text-text-primary",
|
|
603
|
-
children: /* @__PURE__ */
|
|
637
|
+
children: /* @__PURE__ */ m(le, { className: "h-5 w-5" })
|
|
604
638
|
})]
|
|
605
|
-
}), /* @__PURE__ */
|
|
639
|
+
}), /* @__PURE__ */ h("div", {
|
|
606
640
|
className: "space-y-4 p-4",
|
|
607
641
|
children: [
|
|
608
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ h("div", {
|
|
609
643
|
className: "flex items-center gap-3 rounded-lg bg-bg-sunken/50 p-3",
|
|
610
|
-
children: [/* @__PURE__ */
|
|
644
|
+
children: [/* @__PURE__ */ m("div", {
|
|
611
645
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
|
|
612
|
-
children: /* @__PURE__ */
|
|
613
|
-
}), /* @__PURE__ */
|
|
646
|
+
children: /* @__PURE__ */ m(p, { className: "h-5 w-5" })
|
|
647
|
+
}), /* @__PURE__ */ h("div", {
|
|
614
648
|
className: "min-w-0",
|
|
615
|
-
children: [/* @__PURE__ */
|
|
649
|
+
children: [/* @__PURE__ */ m("p", {
|
|
616
650
|
className: "truncate font-medium text-text-primary",
|
|
617
|
-
children:
|
|
618
|
-
}), /* @__PURE__ */
|
|
651
|
+
children: I.name
|
|
652
|
+
}), /* @__PURE__ */ m("p", {
|
|
619
653
|
className: "truncate text-sm text-text-secondary",
|
|
620
|
-
children:
|
|
654
|
+
children: g(I.category)
|
|
621
655
|
})]
|
|
622
656
|
})]
|
|
623
657
|
}),
|
|
624
|
-
|
|
658
|
+
R === "approve" && /* @__PURE__ */ m("div", {
|
|
625
659
|
className: "rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3",
|
|
626
|
-
children: /* @__PURE__ */
|
|
660
|
+
children: /* @__PURE__ */ m("p", {
|
|
627
661
|
className: "text-sm text-status-success-text",
|
|
628
662
|
children: "This marks the merchant as verified and active, so customers can start ordering from it."
|
|
629
663
|
})
|
|
630
664
|
}),
|
|
631
|
-
|
|
665
|
+
R === "suspend" && /* @__PURE__ */ m("div", {
|
|
632
666
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle p-3",
|
|
633
|
-
children: /* @__PURE__ */
|
|
667
|
+
children: /* @__PURE__ */ m("p", {
|
|
634
668
|
className: "text-sm text-status-error-text",
|
|
635
669
|
children: "This suspends the merchant. It will be hidden from customers until reinstated."
|
|
636
670
|
})
|
|
637
671
|
}),
|
|
638
|
-
|
|
672
|
+
R === "reinstate" && /* @__PURE__ */ m("div", {
|
|
673
|
+
className: "rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3",
|
|
674
|
+
children: /* @__PURE__ */ m("p", {
|
|
675
|
+
className: "text-sm text-status-success-text",
|
|
676
|
+
children: "This returns the merchant to active trading. Re-approve it afterwards if it should also carry the verified badge."
|
|
677
|
+
})
|
|
678
|
+
}),
|
|
679
|
+
R === "reject" && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
639
680
|
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
640
681
|
children: "Rejection Reason *"
|
|
641
|
-
}), /* @__PURE__ */
|
|
682
|
+
}), /* @__PURE__ */ m("textarea", {
|
|
642
683
|
className: "min-h-[100px] w-full rounded-lg border border-border-subtle bg-bg-surface p-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
643
684
|
rows: 4,
|
|
644
|
-
value:
|
|
645
|
-
onChange: (e) =>
|
|
685
|
+
value: H,
|
|
686
|
+
onChange: (e) => U(e.target.value),
|
|
646
687
|
placeholder: "Explain why this application is being rejected..."
|
|
647
688
|
})] }),
|
|
648
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ h("div", {
|
|
649
690
|
className: "flex gap-3 pt-2",
|
|
650
|
-
children: [/* @__PURE__ */
|
|
691
|
+
children: [/* @__PURE__ */ m("button", {
|
|
651
692
|
type: "button",
|
|
652
|
-
onClick: () =>
|
|
693
|
+
onClick: () => V(!1),
|
|
653
694
|
className: "flex-1 rounded-lg border border-border-subtle py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
|
|
654
695
|
children: "Cancel"
|
|
655
|
-
}), /* @__PURE__ */
|
|
696
|
+
}), /* @__PURE__ */ m("button", {
|
|
656
697
|
type: "button",
|
|
657
|
-
onClick:
|
|
658
|
-
disabled:
|
|
698
|
+
onClick: me,
|
|
699
|
+
disabled: S.isPending || R === "reject" && !H.trim(),
|
|
659
700
|
className: "flex-1 rounded-lg bg-action-primary-bg py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover disabled:cursor-not-allowed disabled:opacity-50",
|
|
660
|
-
children:
|
|
701
|
+
children: S.isPending ? "Working…" : R === "approve" ? "Approve Merchant" : R === "reject" ? "Reject Merchant" : R === "reinstate" ? "Reinstate Merchant" : "Suspend Merchant"
|
|
661
702
|
})]
|
|
662
703
|
})
|
|
663
704
|
]
|
|
@@ -668,6 +709,6 @@ function S() {
|
|
|
668
709
|
});
|
|
669
710
|
}
|
|
670
711
|
//#endregion
|
|
671
|
-
export {
|
|
712
|
+
export { x as CartManagementPage };
|
|
672
713
|
|
|
673
714
|
//# sourceMappingURL=CartManagementPage.js.map
|