@burdenoff/microfe-store 2026.626.2 → 2026.703.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/components/InstallAppModal.js +50 -50
- package/dist/pages/AdminDashboardPage.js +106 -106
- package/dist/pages/AdminReviewModerationPage.js +51 -51
- package/dist/pages/AdminStoresPage.js +96 -96
- package/dist/pages/AdminSubmissionsQueuePage.js +81 -81
- package/dist/pages/OrderConfirmationPage.js +42 -42
- package/dist/providers/StoreProvider.js +35 -34
- package/dist/providers/StoreProvider.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,13 +2,13 @@ import { useStore as e } from "../providers/StoreProvider.js";
|
|
|
2
2
|
import { formatPriceForModel as t } from "../utils/index.js";
|
|
3
3
|
import { useCallback as n, useEffect as r, useState as i } from "react";
|
|
4
4
|
import { Check as a, CheckCircle as o, ChevronDown as s, ChevronUp as c, ExternalLink as l, LayoutDashboard as u, MessageSquareWarning as d, PackageCheck as f, RefreshCw as p, Store as m, Users as h, X as g, XCircle as _ } from "lucide-react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { graphqlFetch as v } from "@burdenoff/fe-libs/shared/graphql";
|
|
6
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
7
|
+
import { useNavigate as x } from "react-router-dom";
|
|
8
8
|
import { EmphasisPanel as S, GlassCard as C, IllustratedEmptyState as w, NextSteps as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
|
|
9
9
|
//#region src/pages/AdminDashboardPage.tsx
|
|
10
10
|
var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProducts(limit: 5) {\n totalCount\n products {\n id\n slug\n name\n type\n nature\n category\n icon\n price\n currency\n pricingModel\n description\n submittedAt\n submittedBy\n publisher {\n name\n email\n }\n }\n }\n stores {\n id\n }\n recentPublished: products(filter: { status: PUBLISHED }, limit: 5) {\n id\n slug\n name\n icon\n status\n publishedAt\n reviewedBy\n }\n recentRejected: products(filter: { status: REJECTED }, limit: 5) {\n id\n slug\n name\n icon\n status\n reviewedAt\n rejectedReason\n }\n }\n", O = "\n mutation ApproveProduct($id: ID!) {\n approveProduct(id: $id) {\n id\n status\n }\n }\n", k = "\n mutation RejectProduct($id: ID!, $reason: String!) {\n rejectProduct(id: $id, reason: $reason) {\n id\n status\n }\n }\n", A = () => {
|
|
11
|
-
let A =
|
|
11
|
+
let A = x(), { authToken: j, basePath: M } = e(), [N, P] = i({
|
|
12
12
|
pendingCount: 0,
|
|
13
13
|
totalStores: 0,
|
|
14
14
|
recentPending: [],
|
|
@@ -23,7 +23,7 @@ var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
23
23
|
error: null
|
|
24
24
|
}));
|
|
25
25
|
try {
|
|
26
|
-
let e = await
|
|
26
|
+
let e = await v({
|
|
27
27
|
gateway: "global",
|
|
28
28
|
query: D,
|
|
29
29
|
authToken: j || void 0
|
|
@@ -52,7 +52,7 @@ var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
52
52
|
let K = async (e) => {
|
|
53
53
|
I(e), H(null);
|
|
54
54
|
try {
|
|
55
|
-
let t = await
|
|
55
|
+
let t = await v({
|
|
56
56
|
gateway: "global",
|
|
57
57
|
query: O,
|
|
58
58
|
variables: { id: e },
|
|
@@ -69,7 +69,7 @@ var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
69
69
|
if (z.trim()) {
|
|
70
70
|
I(e), H(null);
|
|
71
71
|
try {
|
|
72
|
-
let t = await
|
|
72
|
+
let t = await v({
|
|
73
73
|
gateway: "global",
|
|
74
74
|
query: k,
|
|
75
75
|
variables: {
|
|
@@ -116,37 +116,37 @@ var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
116
116
|
href: `${M}/dashboard`
|
|
117
117
|
}
|
|
118
118
|
];
|
|
119
|
-
return /* @__PURE__ */
|
|
119
|
+
return /* @__PURE__ */ b("div", {
|
|
120
120
|
className: "min-h-screen bg-surface-default",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
121
|
+
children: [/* @__PURE__ */ y("header", {
|
|
122
122
|
className: "border-b border-border-seam bg-surface-raised",
|
|
123
|
-
children: /* @__PURE__ */
|
|
123
|
+
children: /* @__PURE__ */ b("div", {
|
|
124
124
|
className: "mx-auto max-w-7xl px-6 py-4",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ b("div", {
|
|
126
126
|
className: "flex items-center justify-between",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ b("div", {
|
|
128
128
|
className: "flex items-center gap-2",
|
|
129
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ y(u, { className: "size-5 text-text-primary" }), /* @__PURE__ */ y("h1", {
|
|
130
130
|
className: "text-xl font-semibold text-text-primary",
|
|
131
131
|
children: "Store admin dashboard"
|
|
132
132
|
})]
|
|
133
|
-
}), /* @__PURE__ */
|
|
133
|
+
}), /* @__PURE__ */ b("button", {
|
|
134
134
|
type: "button",
|
|
135
135
|
onClick: () => void G(),
|
|
136
136
|
disabled: N.loading,
|
|
137
137
|
className: "inline-flex items-center gap-2 rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary hover:bg-surface-hover disabled:opacity-60",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
138
|
+
children: [/* @__PURE__ */ y(p, { className: `size-4 ${N.loading ? "animate-spin" : ""}` }), "Refresh"]
|
|
139
139
|
})]
|
|
140
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ y("p", {
|
|
141
141
|
className: "mt-1 text-sm text-text-secondary",
|
|
142
142
|
children: "Manage store submissions, multi-store registry, and review moderation."
|
|
143
143
|
})]
|
|
144
144
|
})
|
|
145
|
-
}), /* @__PURE__ */
|
|
145
|
+
}), /* @__PURE__ */ b("main", {
|
|
146
146
|
className: "mx-auto max-w-7xl space-y-6 p-6",
|
|
147
147
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ y(E, { children: "Your control room for the marketplace. At a glance, see how many products are waiting for review, how many stores are live, and what was recently approved or rejected — then act on the most urgent items (pending submissions) without leaving this page. Use the tiles to jump into the full queue, store registry, or review moderation." }),
|
|
149
|
+
/* @__PURE__ */ y(T, {
|
|
150
150
|
storageKey: "store-admin-dashboard",
|
|
151
151
|
steps: [
|
|
152
152
|
{
|
|
@@ -170,79 +170,79 @@ var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
170
170
|
}
|
|
171
171
|
]
|
|
172
172
|
}),
|
|
173
|
-
N.error && /* @__PURE__ */
|
|
173
|
+
N.error && /* @__PURE__ */ y("div", {
|
|
174
174
|
role: "alert",
|
|
175
175
|
className: "rounded-md border border-border-danger bg-surface-danger-muted px-4 py-3 text-sm text-text-danger",
|
|
176
176
|
children: N.error
|
|
177
177
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ y("div", {
|
|
179
179
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
180
180
|
children: Y.map((e) => {
|
|
181
181
|
let t = e.icon;
|
|
182
|
-
return /* @__PURE__ */
|
|
182
|
+
return /* @__PURE__ */ b("button", {
|
|
183
183
|
type: "button",
|
|
184
184
|
onClick: () => A(e.href),
|
|
185
185
|
className: "rounded-card border border-border-seam bg-bg-surface bg-accent-wash p-4 text-left shadow-elevation-1 transition-[box-shadow,border-color] hover:border-border-strong hover:shadow-elevation-2",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ b("div", {
|
|
187
187
|
className: "flex items-center justify-between",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ y("span", {
|
|
189
189
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
190
190
|
children: e.label
|
|
191
|
-
}), /* @__PURE__ */
|
|
192
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ y(t, { className: "size-4 text-text-tertiary" })]
|
|
192
|
+
}), /* @__PURE__ */ y("div", {
|
|
193
193
|
className: "mt-2 text-3xl font-semibold tabular-nums text-text-primary",
|
|
194
194
|
children: N.loading ? "…" : e.value
|
|
195
195
|
})]
|
|
196
196
|
}, e.label);
|
|
197
197
|
})
|
|
198
198
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ b(S, { children: [
|
|
200
|
+
/* @__PURE__ */ b("div", {
|
|
201
201
|
className: "mb-3 flex items-center justify-between",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
203
203
|
className: "text-sm font-semibold text-text-primary",
|
|
204
204
|
children: "Recent Submissions"
|
|
205
|
-
}), /* @__PURE__ */
|
|
205
|
+
}), /* @__PURE__ */ b("button", {
|
|
206
206
|
type: "button",
|
|
207
207
|
onClick: () => A(`${M}/submissions`),
|
|
208
208
|
className: "inline-flex items-center gap-1 text-xs text-text-accent hover:underline",
|
|
209
|
-
children: ["View all", /* @__PURE__ */
|
|
209
|
+
children: ["View all", /* @__PURE__ */ y(l, { className: "size-3" })]
|
|
210
210
|
})]
|
|
211
211
|
}),
|
|
212
|
-
V && /* @__PURE__ */
|
|
212
|
+
V && /* @__PURE__ */ y("div", {
|
|
213
213
|
role: "alert",
|
|
214
214
|
className: "mb-3 rounded-md border border-border-danger bg-surface-danger-muted px-4 py-2 text-sm text-text-danger",
|
|
215
215
|
children: V
|
|
216
216
|
}),
|
|
217
|
-
N.loading ? /* @__PURE__ */
|
|
217
|
+
N.loading ? /* @__PURE__ */ y("div", {
|
|
218
218
|
className: "rounded-lg border border-border-default bg-surface-raised py-10 text-center text-sm text-text-secondary",
|
|
219
219
|
children: "Loading…"
|
|
220
|
-
}) : N.recentPending.length === 0 ? /* @__PURE__ */
|
|
220
|
+
}) : N.recentPending.length === 0 ? /* @__PURE__ */ y(w, {
|
|
221
221
|
illustration: "empty-notifications",
|
|
222
222
|
title: "All caught up",
|
|
223
223
|
description: "There are no submissions waiting for review. New products from publishers will surface here."
|
|
224
|
-
}) : /* @__PURE__ */
|
|
224
|
+
}) : /* @__PURE__ */ y("ul", {
|
|
225
225
|
className: "space-y-2",
|
|
226
|
-
children: N.recentPending.map((e) => /* @__PURE__ */
|
|
226
|
+
children: N.recentPending.map((e) => /* @__PURE__ */ b("li", {
|
|
227
227
|
className: "overflow-hidden rounded-lg border border-border-seam bg-surface-raised transition-[box-shadow,border-color] hover:border-border-strong hover:shadow-[var(--shadow-pop)]",
|
|
228
228
|
children: [
|
|
229
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ b("div", {
|
|
230
230
|
className: "flex items-center gap-3 px-4 py-3",
|
|
231
231
|
children: [
|
|
232
|
-
e.icon ? /* @__PURE__ */
|
|
232
|
+
e.icon ? /* @__PURE__ */ y("img", {
|
|
233
233
|
src: e.icon,
|
|
234
234
|
alt: "",
|
|
235
235
|
className: "size-10 flex-shrink-0 rounded-md object-cover"
|
|
236
|
-
}) : /* @__PURE__ */
|
|
236
|
+
}) : /* @__PURE__ */ y("div", {
|
|
237
237
|
className: "flex size-10 flex-shrink-0 items-center justify-center rounded-md bg-surface-muted text-xs text-text-secondary",
|
|
238
238
|
children: e.type.slice(0, 2)
|
|
239
239
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ b("div", {
|
|
241
241
|
className: "min-w-0 flex-1",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ y("p", {
|
|
243
243
|
className: "truncate text-sm font-medium text-text-primary",
|
|
244
244
|
children: e.name
|
|
245
|
-
}), /* @__PURE__ */
|
|
245
|
+
}), /* @__PURE__ */ b("p", {
|
|
246
246
|
className: "text-xs text-text-secondary",
|
|
247
247
|
children: [
|
|
248
248
|
e.publisher?.name ?? "Unknown publisher",
|
|
@@ -255,77 +255,77 @@ var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
255
255
|
]
|
|
256
256
|
})]
|
|
257
257
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ b("div", {
|
|
259
259
|
className: "flex flex-shrink-0 items-center gap-2",
|
|
260
260
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ b("button", {
|
|
262
262
|
type: "button",
|
|
263
263
|
onClick: () => W(U === e.id ? null : e.id),
|
|
264
264
|
className: "inline-flex items-center gap-1 rounded-md border border-border-default px-3 py-1.5 text-xs text-text-secondary hover:bg-surface-hover",
|
|
265
|
-
children: [U === e.id ? /* @__PURE__ */
|
|
265
|
+
children: [U === e.id ? /* @__PURE__ */ y(c, { className: "size-3.5" }) : /* @__PURE__ */ y(s, { className: "size-3.5" }), "Details"]
|
|
266
266
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ b("button", {
|
|
268
268
|
type: "button",
|
|
269
269
|
onClick: () => void K(e.id),
|
|
270
270
|
disabled: F === e.id,
|
|
271
271
|
className: "inline-flex items-center gap-1 rounded-md bg-surface-success px-3 py-1.5 text-xs font-medium text-text-on-success hover:bg-surface-success-hover disabled:opacity-60",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ y(a, { className: "size-3.5" }), "Approve"]
|
|
273
273
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ b("button", {
|
|
275
275
|
type: "button",
|
|
276
276
|
onClick: () => {
|
|
277
277
|
R(e.id), B(""), H(null);
|
|
278
278
|
},
|
|
279
279
|
disabled: F === e.id,
|
|
280
280
|
className: "inline-flex items-center gap-1 rounded-md border border-border-danger bg-surface-danger-muted px-3 py-1.5 text-xs font-medium text-text-danger hover:bg-surface-danger hover:text-text-on-danger disabled:opacity-60",
|
|
281
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ y(g, { className: "size-3.5" }), "Reject"]
|
|
282
282
|
})
|
|
283
283
|
]
|
|
284
284
|
})
|
|
285
285
|
]
|
|
286
286
|
}),
|
|
287
|
-
U === e.id && /* @__PURE__ */
|
|
287
|
+
U === e.id && /* @__PURE__ */ y("div", {
|
|
288
288
|
className: "border-t border-border-seam bg-surface-muted p-4",
|
|
289
|
-
children: /* @__PURE__ */
|
|
289
|
+
children: /* @__PURE__ */ b("dl", {
|
|
290
290
|
className: "grid grid-cols-2 gap-x-6 gap-y-3 text-xs sm:grid-cols-3",
|
|
291
291
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", {
|
|
293
293
|
className: "font-medium text-text-secondary",
|
|
294
294
|
children: "Slug"
|
|
295
|
-
}), /* @__PURE__ */
|
|
295
|
+
}), /* @__PURE__ */ y("dd", {
|
|
296
296
|
className: "mt-0.5 font-mono text-text-primary",
|
|
297
297
|
children: e.slug
|
|
298
298
|
})] }),
|
|
299
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", {
|
|
300
300
|
className: "font-medium text-text-secondary",
|
|
301
301
|
children: "Type"
|
|
302
|
-
}), /* @__PURE__ */
|
|
302
|
+
}), /* @__PURE__ */ y("dd", {
|
|
303
303
|
className: "mt-0.5 text-text-primary",
|
|
304
304
|
children: e.type
|
|
305
305
|
})] }),
|
|
306
|
-
e.nature && /* @__PURE__ */
|
|
306
|
+
e.nature && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", {
|
|
307
307
|
className: "font-medium text-text-secondary",
|
|
308
308
|
children: "Nature"
|
|
309
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ y("dd", {
|
|
310
310
|
className: "mt-0.5 text-text-primary",
|
|
311
311
|
children: e.nature
|
|
312
312
|
})] }),
|
|
313
|
-
e.category && /* @__PURE__ */
|
|
313
|
+
e.category && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", {
|
|
314
314
|
className: "font-medium text-text-secondary",
|
|
315
315
|
children: "Category"
|
|
316
|
-
}), /* @__PURE__ */
|
|
316
|
+
}), /* @__PURE__ */ y("dd", {
|
|
317
317
|
className: "mt-0.5 text-text-primary",
|
|
318
318
|
children: e.category
|
|
319
319
|
})] }),
|
|
320
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", {
|
|
321
321
|
className: "font-medium text-text-secondary",
|
|
322
322
|
children: "Pricing"
|
|
323
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ b("dd", {
|
|
324
324
|
className: "mt-0.5 text-text-primary",
|
|
325
325
|
children: [
|
|
326
326
|
t(e.price, e.currency, e.pricingModel),
|
|
327
327
|
" ",
|
|
328
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ b("span", {
|
|
329
329
|
className: "text-text-tertiary",
|
|
330
330
|
children: [
|
|
331
331
|
"(",
|
|
@@ -335,36 +335,36 @@ var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
335
335
|
})
|
|
336
336
|
]
|
|
337
337
|
})] }),
|
|
338
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", {
|
|
339
339
|
className: "font-medium text-text-secondary",
|
|
340
340
|
children: "Publisher"
|
|
341
|
-
}), /* @__PURE__ */
|
|
341
|
+
}), /* @__PURE__ */ b("dd", {
|
|
342
342
|
className: "mt-0.5 text-text-primary",
|
|
343
|
-
children: [e.publisher?.name ?? "—", e.publisher?.email && /* @__PURE__ */
|
|
343
|
+
children: [e.publisher?.name ?? "—", e.publisher?.email && /* @__PURE__ */ y("span", {
|
|
344
344
|
className: "block text-text-tertiary",
|
|
345
345
|
children: e.publisher.email
|
|
346
346
|
})]
|
|
347
347
|
})] }),
|
|
348
|
-
e.submittedBy && /* @__PURE__ */
|
|
348
|
+
e.submittedBy && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", {
|
|
349
349
|
className: "font-medium text-text-secondary",
|
|
350
350
|
children: "Submitted by"
|
|
351
|
-
}), /* @__PURE__ */
|
|
351
|
+
}), /* @__PURE__ */ y("dd", {
|
|
352
352
|
className: "mt-0.5 font-mono text-text-primary",
|
|
353
353
|
children: e.submittedBy
|
|
354
354
|
})] }),
|
|
355
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", {
|
|
356
356
|
className: "font-medium text-text-secondary",
|
|
357
357
|
children: "Submitted at"
|
|
358
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ y("dd", {
|
|
359
359
|
className: "mt-0.5 text-text-primary",
|
|
360
360
|
children: J(e.submittedAt)
|
|
361
361
|
})] }),
|
|
362
|
-
e.description && /* @__PURE__ */
|
|
362
|
+
e.description && /* @__PURE__ */ b("div", {
|
|
363
363
|
className: "col-span-2 sm:col-span-3",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
364
|
+
children: [/* @__PURE__ */ y("dt", {
|
|
365
365
|
className: "font-medium text-text-secondary",
|
|
366
366
|
children: "Description"
|
|
367
|
-
}), /* @__PURE__ */
|
|
367
|
+
}), /* @__PURE__ */ y("dd", {
|
|
368
368
|
className: "mt-0.5 text-text-primary",
|
|
369
369
|
children: e.description
|
|
370
370
|
})]
|
|
@@ -372,15 +372,15 @@ var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
372
372
|
]
|
|
373
373
|
})
|
|
374
374
|
}),
|
|
375
|
-
L === e.id && /* @__PURE__ */
|
|
375
|
+
L === e.id && /* @__PURE__ */ b("div", {
|
|
376
376
|
className: "border-t border-border-seam bg-surface-muted px-4 py-3",
|
|
377
377
|
children: [
|
|
378
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ y("label", {
|
|
379
379
|
htmlFor: `reject-reason-${e.id}`,
|
|
380
380
|
className: "block text-xs font-medium text-text-secondary",
|
|
381
381
|
children: "Rejection reason (required)"
|
|
382
382
|
}),
|
|
383
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ y("textarea", {
|
|
384
384
|
id: `reject-reason-${e.id}`,
|
|
385
385
|
"aria-label": "Rejection reason",
|
|
386
386
|
value: z,
|
|
@@ -389,16 +389,16 @@ var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
389
389
|
className: "mt-1 w-full rounded-md border border-border-default bg-surface-default px-3 py-2 text-sm text-text-primary focus:border-border-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
390
390
|
placeholder: "Explain why this submission is being rejected…"
|
|
391
391
|
}),
|
|
392
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ b("div", {
|
|
393
393
|
className: "mt-2 flex justify-end gap-2",
|
|
394
|
-
children: [/* @__PURE__ */
|
|
394
|
+
children: [/* @__PURE__ */ y("button", {
|
|
395
395
|
type: "button",
|
|
396
396
|
onClick: () => {
|
|
397
397
|
R(null), B("");
|
|
398
398
|
},
|
|
399
399
|
className: "rounded-md border border-border-default bg-surface-default px-3 py-1 text-xs text-text-primary hover:bg-surface-hover",
|
|
400
400
|
children: "Cancel"
|
|
401
|
-
}), /* @__PURE__ */
|
|
401
|
+
}), /* @__PURE__ */ y("button", {
|
|
402
402
|
type: "button",
|
|
403
403
|
onClick: () => void q(e.id),
|
|
404
404
|
disabled: !z.trim() || F === e.id,
|
|
@@ -412,93 +412,93 @@ var D = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
412
412
|
}, e.id))
|
|
413
413
|
})
|
|
414
414
|
] }),
|
|
415
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ b("section", { children: [/* @__PURE__ */ y("h2", {
|
|
416
416
|
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
417
417
|
children: "Recent Activity"
|
|
418
|
-
}), /* @__PURE__ */
|
|
418
|
+
}), /* @__PURE__ */ b("div", {
|
|
419
419
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
420
|
+
children: [/* @__PURE__ */ b(C, {
|
|
421
421
|
className: "overflow-hidden p-0",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
422
|
+
children: [/* @__PURE__ */ b("div", {
|
|
423
423
|
className: "flex items-center gap-2 border-b border-border-seam px-4 py-3",
|
|
424
|
-
children: [/* @__PURE__ */
|
|
424
|
+
children: [/* @__PURE__ */ y(o, { className: "size-4 text-text-success" }), /* @__PURE__ */ y("h3", {
|
|
425
425
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
426
426
|
children: "Recently Approved"
|
|
427
427
|
})]
|
|
428
|
-
}), N.loading ? /* @__PURE__ */
|
|
428
|
+
}), N.loading ? /* @__PURE__ */ y("p", {
|
|
429
429
|
className: "px-4 py-6 text-center text-sm text-text-secondary",
|
|
430
430
|
children: "Loading…"
|
|
431
|
-
}) : N.recentPublished.length === 0 ? /* @__PURE__ */
|
|
431
|
+
}) : N.recentPublished.length === 0 ? /* @__PURE__ */ y("p", {
|
|
432
432
|
className: "px-4 py-6 text-center text-sm text-text-secondary",
|
|
433
433
|
children: "No approved products yet."
|
|
434
|
-
}) : /* @__PURE__ */
|
|
434
|
+
}) : /* @__PURE__ */ y("ul", {
|
|
435
435
|
className: "divide-y divide-border-seam",
|
|
436
|
-
children: N.recentPublished.map((e) => /* @__PURE__ */
|
|
436
|
+
children: N.recentPublished.map((e) => /* @__PURE__ */ b("li", {
|
|
437
437
|
className: "flex items-center gap-3 px-4 py-3",
|
|
438
438
|
children: [
|
|
439
|
-
e.icon ? /* @__PURE__ */
|
|
439
|
+
e.icon ? /* @__PURE__ */ y("img", {
|
|
440
440
|
src: e.icon,
|
|
441
441
|
alt: "",
|
|
442
442
|
className: "size-8 flex-shrink-0 rounded-md object-cover"
|
|
443
|
-
}) : /* @__PURE__ */
|
|
443
|
+
}) : /* @__PURE__ */ y("div", {
|
|
444
444
|
className: "flex size-8 flex-shrink-0 items-center justify-center rounded-md bg-surface-muted text-xs text-text-secondary",
|
|
445
445
|
children: "?"
|
|
446
446
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ b("div", {
|
|
448
448
|
className: "min-w-0 flex-1",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
449
|
+
children: [/* @__PURE__ */ y("p", {
|
|
450
450
|
className: "truncate text-sm font-medium text-text-primary",
|
|
451
451
|
children: e.name
|
|
452
|
-
}), /* @__PURE__ */
|
|
452
|
+
}), /* @__PURE__ */ b("p", {
|
|
453
453
|
className: "text-xs text-text-secondary",
|
|
454
454
|
children: [e.reviewedBy ? `by ${e.reviewedBy} · ` : "", J(e.publishedAt)]
|
|
455
455
|
})]
|
|
456
456
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ y("span", {
|
|
458
458
|
className: "flex-shrink-0 rounded-full bg-surface-success-muted px-2 py-0.5 text-xs font-medium text-text-success",
|
|
459
459
|
children: "Published"
|
|
460
460
|
})
|
|
461
461
|
]
|
|
462
462
|
}, e.id))
|
|
463
463
|
})]
|
|
464
|
-
}), /* @__PURE__ */
|
|
464
|
+
}), /* @__PURE__ */ b(C, {
|
|
465
465
|
className: "overflow-hidden p-0",
|
|
466
|
-
children: [/* @__PURE__ */
|
|
466
|
+
children: [/* @__PURE__ */ b("div", {
|
|
467
467
|
className: "flex items-center gap-2 border-b border-border-seam px-4 py-3",
|
|
468
|
-
children: [/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ y(_, { className: "size-4 text-text-danger" }), /* @__PURE__ */ y("h3", {
|
|
469
469
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
470
470
|
children: "Recently Rejected"
|
|
471
471
|
})]
|
|
472
|
-
}), N.loading ? /* @__PURE__ */
|
|
472
|
+
}), N.loading ? /* @__PURE__ */ y("p", {
|
|
473
473
|
className: "px-4 py-6 text-center text-sm text-text-secondary",
|
|
474
474
|
children: "Loading…"
|
|
475
|
-
}) : N.recentRejected.length === 0 ? /* @__PURE__ */
|
|
475
|
+
}) : N.recentRejected.length === 0 ? /* @__PURE__ */ y("p", {
|
|
476
476
|
className: "px-4 py-6 text-center text-sm text-text-secondary",
|
|
477
477
|
children: "No rejected products yet."
|
|
478
|
-
}) : /* @__PURE__ */
|
|
478
|
+
}) : /* @__PURE__ */ y("ul", {
|
|
479
479
|
className: "divide-y divide-border-seam",
|
|
480
|
-
children: N.recentRejected.map((e) => /* @__PURE__ */
|
|
480
|
+
children: N.recentRejected.map((e) => /* @__PURE__ */ b("li", {
|
|
481
481
|
className: "flex items-center gap-3 px-4 py-3",
|
|
482
482
|
children: [
|
|
483
|
-
e.icon ? /* @__PURE__ */
|
|
483
|
+
e.icon ? /* @__PURE__ */ y("img", {
|
|
484
484
|
src: e.icon,
|
|
485
485
|
alt: "",
|
|
486
486
|
className: "size-8 flex-shrink-0 rounded-md object-cover"
|
|
487
|
-
}) : /* @__PURE__ */
|
|
487
|
+
}) : /* @__PURE__ */ y("div", {
|
|
488
488
|
className: "flex size-8 flex-shrink-0 items-center justify-center rounded-md bg-surface-muted text-xs text-text-secondary",
|
|
489
489
|
children: "?"
|
|
490
490
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ b("div", {
|
|
492
492
|
className: "min-w-0 flex-1",
|
|
493
|
-
children: [/* @__PURE__ */
|
|
493
|
+
children: [/* @__PURE__ */ y("p", {
|
|
494
494
|
className: "truncate text-sm font-medium text-text-primary",
|
|
495
495
|
children: e.name
|
|
496
|
-
}), /* @__PURE__ */
|
|
496
|
+
}), /* @__PURE__ */ b("p", {
|
|
497
497
|
className: "truncate text-xs text-text-secondary",
|
|
498
498
|
children: [e.rejectedReason ? `"${e.rejectedReason}" · ` : "", J(e.reviewedAt)]
|
|
499
499
|
})]
|
|
500
500
|
}),
|
|
501
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ y("span", {
|
|
502
502
|
className: "flex-shrink-0 rounded-full bg-surface-danger-muted px-2 py-0.5 text-xs font-medium text-text-danger",
|
|
503
503
|
children: "Rejected"
|
|
504
504
|
})
|