@burdenoff/microfe-store 2026.525.3 → 2026.527.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/StoreAdminRoutes.js +10 -9
- package/dist/StoreAdminRoutes.js.map +1 -1
- package/dist/StoreRoutes.js +2 -1
- package/dist/StoreRoutes.js.map +1 -1
- package/dist/components/AccessDenied.js +23 -0
- package/dist/components/AccessDenied.js.map +1 -0
- package/dist/components/InstallAppModal.js +183 -129
- package/dist/components/InstallAppModal.js.map +1 -1
- package/dist/components/PermissionGuard.js +8 -0
- package/dist/components/PermissionGuard.js.map +1 -0
- package/dist/components/RouteGuards.js +7 -21
- package/dist/components/RouteGuards.js.map +1 -1
- package/dist/components/cart/CartDrawer.js +20 -14
- package/dist/components/cart/CartDrawer.js.map +1 -1
- package/dist/hooks/useStoreGraphQL.js +22 -20
- package/dist/hooks/useStoreGraphQL.js.map +1 -1
- package/dist/hooks/useStoreGraphQLWithContext.js.map +1 -1
- package/dist/hooks/useStorePermissions.js +4 -1
- package/dist/hooks/useStorePermissions.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/pages/AdminDashboardPage.js +182 -183
- package/dist/pages/AdminDashboardPage.js.map +1 -1
- package/dist/pages/AdminReviewModerationPage.js +7 -6
- package/dist/pages/AdminReviewModerationPage.js.map +1 -1
- package/dist/pages/AdminStoresPage.js +193 -185
- package/dist/pages/AdminStoresPage.js.map +1 -1
- package/dist/pages/AdminSubmissionsQueuePage.js +140 -142
- package/dist/pages/AdminSubmissionsQueuePage.js.map +1 -1
- package/dist/pages/AppDetailPage.js +6 -3
- package/dist/pages/AppDetailPage.js.map +1 -1
- package/dist/pages/AppSettingsPage.js +6 -3
- package/dist/pages/AppSettingsPage.js.map +1 -1
- package/dist/pages/CartPage.js +23 -15
- package/dist/pages/CartPage.js.map +1 -1
- package/dist/pages/InstalledAppsPage.js +26 -15
- package/dist/pages/InstalledAppsPage.js.map +1 -1
- package/dist/pages/MarketplaceHomePage.js +275 -247
- package/dist/pages/MarketplaceHomePage.js.map +1 -1
- package/dist/pages/MyLicensesPage.js +10 -8
- package/dist/pages/MyLicensesPage.js.map +1 -1
- package/dist/pages/OrderConfirmationPage.js +72 -75
- package/dist/pages/OrderConfirmationPage.js.map +1 -1
- package/dist/pages/OrdersPage.js +22 -20
- package/dist/pages/OrdersPage.js.map +1 -1
- package/dist/pages/ProductCategoryPage.js +3 -1
- package/dist/pages/ProductCategoryPage.js.map +1 -1
- package/dist/pages/ProductDetailPage.js +458 -443
- package/dist/pages/ProductDetailPage.js.map +1 -1
- package/dist/pages/ProductReviewsPage.js +4 -3
- package/dist/pages/ProductReviewsPage.js.map +1 -1
- package/dist/pages/PublisherDashboardPage.js +13 -7
- package/dist/pages/PublisherDashboardPage.js.map +1 -1
- package/dist/pages/PublisherRevenuePage.js +7 -5
- package/dist/pages/PublisherRevenuePage.js.map +1 -1
- package/dist/pages/PublisherSubmissionsPage.js +12 -7
- package/dist/pages/PublisherSubmissionsPage.js.map +1 -1
- package/dist/pages/PublisherSubmitPage.js +6 -0
- package/dist/pages/PublisherSubmitPage.js.map +1 -1
- package/dist/pages/SearchResultsPage.js +6 -3
- package/dist/pages/SearchResultsPage.js.map +1 -1
- package/dist/pages/StoresPage.js +73 -74
- package/dist/pages/StoresPage.js.map +1 -1
- package/dist/providers/StoreProvider.js +25 -25
- package/dist/providers/StoreProvider.js.map +1 -1
- package/dist/utils/index.js +29 -19
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/index.js +0 -3
- package/dist/components/marketplace/ProductCard.js +0 -2
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useStore as e } from "../providers/StoreProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { formatPriceForModel as t } from "../utils/index.js";
|
|
3
|
+
import { useCallback as n, useEffect as r, useState as i } from "react";
|
|
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 { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
6
|
+
import { useNavigate as b } from "react-router-dom";
|
|
7
|
+
import { graphqlFetch as x } from "@burdenoff/fe-libs/shared/graphql";
|
|
7
8
|
//#region src/pages/AdminDashboardPage.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
9
|
+
var S = "\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", C = "\n mutation ApproveProduct($id: ID!) {\n approveProduct(id: $id) {\n id\n status\n }\n }\n", w = "\n mutation RejectProduct($id: ID!, $reason: String!) {\n rejectProduct(id: $id, reason: $reason) {\n id\n status\n }\n }\n", T = () => {
|
|
10
|
+
let T = b(), { authToken: E, basePath: D } = e(), [O, k] = i({
|
|
10
11
|
pendingCount: 0,
|
|
11
12
|
totalStores: 0,
|
|
12
13
|
recentPending: [],
|
|
@@ -14,20 +15,20 @@ var b = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
14
15
|
recentRejected: [],
|
|
15
16
|
loading: !0,
|
|
16
17
|
error: null
|
|
17
|
-
}), [
|
|
18
|
-
|
|
18
|
+
}), [A, j] = i(null), [M, N] = i(null), [P, F] = i(""), [I, L] = i(null), [R, z] = i(null), B = n(async () => {
|
|
19
|
+
k((e) => ({
|
|
19
20
|
...e,
|
|
20
21
|
loading: !0,
|
|
21
22
|
error: null
|
|
22
23
|
}));
|
|
23
24
|
try {
|
|
24
|
-
let e = await
|
|
25
|
+
let e = await x({
|
|
25
26
|
gateway: "global",
|
|
26
|
-
query:
|
|
27
|
-
authToken:
|
|
27
|
+
query: S,
|
|
28
|
+
authToken: E || void 0
|
|
28
29
|
});
|
|
29
30
|
if (e.errors?.length) throw Error(e.errors[0]?.message ?? "Failed to load dashboard");
|
|
30
|
-
|
|
31
|
+
k({
|
|
31
32
|
pendingCount: e.data?.recentPending.totalCount ?? 0,
|
|
32
33
|
totalStores: e.data?.stores.length ?? 0,
|
|
33
34
|
recentPending: e.data?.recentPending.products ?? [],
|
|
@@ -37,270 +38,267 @@ var b = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
37
38
|
error: null
|
|
38
39
|
});
|
|
39
40
|
} catch (e) {
|
|
40
|
-
|
|
41
|
+
k((t) => ({
|
|
41
42
|
...t,
|
|
42
43
|
loading: !1,
|
|
43
44
|
error: e instanceof Error ? e.message : "Failed to load dashboard"
|
|
44
45
|
}));
|
|
45
46
|
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
let
|
|
51
|
-
|
|
47
|
+
}, [E]);
|
|
48
|
+
r(() => {
|
|
49
|
+
B();
|
|
50
|
+
}, [B]);
|
|
51
|
+
let V = async (e) => {
|
|
52
|
+
j(e), L(null);
|
|
52
53
|
try {
|
|
53
|
-
let t = await
|
|
54
|
+
let t = await x({
|
|
54
55
|
gateway: "global",
|
|
55
|
-
query:
|
|
56
|
+
query: C,
|
|
56
57
|
variables: { id: e },
|
|
57
|
-
authToken:
|
|
58
|
+
authToken: E || void 0
|
|
58
59
|
});
|
|
59
60
|
if (t.errors?.length) throw Error(t.errors[0]?.message ?? "Approval failed");
|
|
60
|
-
await
|
|
61
|
+
await B();
|
|
61
62
|
} catch (e) {
|
|
62
|
-
|
|
63
|
+
L(e instanceof Error ? e.message : "Approval failed");
|
|
63
64
|
} finally {
|
|
64
|
-
|
|
65
|
+
j(null);
|
|
65
66
|
}
|
|
66
|
-
},
|
|
67
|
-
if (
|
|
68
|
-
|
|
67
|
+
}, H = async (e) => {
|
|
68
|
+
if (P.trim()) {
|
|
69
|
+
j(e), L(null);
|
|
69
70
|
try {
|
|
70
|
-
let t = await
|
|
71
|
+
let t = await x({
|
|
71
72
|
gateway: "global",
|
|
72
|
-
query:
|
|
73
|
+
query: w,
|
|
73
74
|
variables: {
|
|
74
75
|
id: e,
|
|
75
|
-
reason:
|
|
76
|
+
reason: P.trim()
|
|
76
77
|
},
|
|
77
|
-
authToken:
|
|
78
|
+
authToken: E || void 0
|
|
78
79
|
});
|
|
79
80
|
if (t.errors?.length) throw Error(t.errors[0]?.message ?? "Rejection failed");
|
|
80
|
-
|
|
81
|
+
N(null), F(""), await B();
|
|
81
82
|
} catch (e) {
|
|
82
|
-
|
|
83
|
+
L(e instanceof Error ? e.message : "Rejection failed");
|
|
83
84
|
} finally {
|
|
84
|
-
|
|
85
|
+
j(null);
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
},
|
|
88
|
-
style: "currency",
|
|
89
|
-
currency: t || "USD"
|
|
90
|
-
}).format(e), H = (e) => e ? new Date(e).toLocaleDateString(void 0, {
|
|
88
|
+
}, U = (e) => e ? new Date(e).toLocaleDateString(void 0, {
|
|
91
89
|
month: "short",
|
|
92
90
|
day: "numeric",
|
|
93
91
|
year: "numeric"
|
|
94
|
-
}) : "—",
|
|
92
|
+
}) : "—", W = [
|
|
95
93
|
{
|
|
96
94
|
label: "Pending submissions",
|
|
97
|
-
value:
|
|
98
|
-
icon:
|
|
99
|
-
href: `${
|
|
95
|
+
value: O.pendingCount,
|
|
96
|
+
icon: f,
|
|
97
|
+
href: `${D}/submissions`
|
|
100
98
|
},
|
|
101
99
|
{
|
|
102
100
|
label: "Stores in registry",
|
|
103
|
-
value:
|
|
104
|
-
icon:
|
|
105
|
-
href: `${
|
|
101
|
+
value: O.totalStores,
|
|
102
|
+
icon: m,
|
|
103
|
+
href: `${D}/stores`
|
|
106
104
|
},
|
|
107
105
|
{
|
|
108
106
|
label: "Review queue",
|
|
109
107
|
value: "—",
|
|
110
|
-
icon:
|
|
111
|
-
href: `${
|
|
108
|
+
icon: d,
|
|
109
|
+
href: `${D}/reviews`
|
|
112
110
|
},
|
|
113
111
|
{
|
|
114
112
|
label: "Publishers",
|
|
115
113
|
value: "—",
|
|
116
|
-
icon:
|
|
117
|
-
href: `${
|
|
114
|
+
icon: h,
|
|
115
|
+
href: `${D}/dashboard`
|
|
118
116
|
}
|
|
119
117
|
];
|
|
120
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ y("div", {
|
|
121
119
|
className: "min-h-screen bg-surface-default",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ v("header", {
|
|
123
121
|
className: "border-b border-border-default bg-surface-raised",
|
|
124
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ y("div", {
|
|
125
123
|
className: "mx-auto max-w-7xl px-6 py-4",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ y("div", {
|
|
127
125
|
className: "flex items-center justify-between",
|
|
128
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ y("div", {
|
|
129
127
|
className: "flex items-center gap-2",
|
|
130
|
-
children: [/* @__PURE__ */
|
|
128
|
+
children: [/* @__PURE__ */ v(u, { className: "size-5 text-text-primary" }), /* @__PURE__ */ v("h1", {
|
|
131
129
|
className: "text-xl font-semibold text-text-primary",
|
|
132
130
|
children: "Store admin dashboard"
|
|
133
131
|
})]
|
|
134
|
-
}), /* @__PURE__ */
|
|
132
|
+
}), /* @__PURE__ */ y("button", {
|
|
135
133
|
type: "button",
|
|
136
|
-
onClick: () => void
|
|
137
|
-
disabled:
|
|
134
|
+
onClick: () => void B(),
|
|
135
|
+
disabled: O.loading,
|
|
138
136
|
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",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ v(p, { className: `size-4 ${O.loading ? "animate-spin" : ""}` }), "Refresh"]
|
|
140
138
|
})]
|
|
141
|
-
}), /* @__PURE__ */
|
|
139
|
+
}), /* @__PURE__ */ v("p", {
|
|
142
140
|
className: "mt-1 text-sm text-text-secondary",
|
|
143
141
|
children: "Manage store submissions, multi-store registry, and review moderation."
|
|
144
142
|
})]
|
|
145
143
|
})
|
|
146
|
-
}), /* @__PURE__ */
|
|
147
|
-
className: "mx-auto max-w-7xl space-y-6
|
|
144
|
+
}), /* @__PURE__ */ y("main", {
|
|
145
|
+
className: "mx-auto max-w-7xl space-y-6 p-6",
|
|
148
146
|
children: [
|
|
149
|
-
|
|
147
|
+
O.error && /* @__PURE__ */ v("div", {
|
|
150
148
|
role: "alert",
|
|
151
149
|
className: "rounded-md border border-border-danger bg-surface-danger-muted px-4 py-3 text-sm text-text-danger",
|
|
152
|
-
children:
|
|
150
|
+
children: O.error
|
|
153
151
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ v("div", {
|
|
155
153
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
156
|
-
children:
|
|
154
|
+
children: W.map((e) => {
|
|
157
155
|
let t = e.icon;
|
|
158
|
-
return /* @__PURE__ */
|
|
156
|
+
return /* @__PURE__ */ y("button", {
|
|
159
157
|
type: "button",
|
|
160
|
-
onClick: () =>
|
|
158
|
+
onClick: () => T(e.href),
|
|
161
159
|
className: "rounded-lg border border-border-default bg-surface-raised p-4 text-left transition-colors hover:bg-surface-hover",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ y("div", {
|
|
163
161
|
className: "flex items-center justify-between",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ v("span", {
|
|
165
163
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
166
164
|
children: e.label
|
|
167
|
-
}), /* @__PURE__ */
|
|
168
|
-
}), /* @__PURE__ */
|
|
165
|
+
}), /* @__PURE__ */ v(t, { className: "size-4 text-text-tertiary" })]
|
|
166
|
+
}), /* @__PURE__ */ v("div", {
|
|
169
167
|
className: "mt-2 text-3xl font-semibold text-text-primary",
|
|
170
|
-
children:
|
|
168
|
+
children: O.loading ? "…" : e.value
|
|
171
169
|
})]
|
|
172
170
|
}, e.label);
|
|
173
171
|
})
|
|
174
172
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ y("section", { children: [
|
|
174
|
+
/* @__PURE__ */ y("div", {
|
|
177
175
|
className: "mb-3 flex items-center justify-between",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ v("h2", {
|
|
179
177
|
className: "text-sm font-semibold text-text-primary",
|
|
180
178
|
children: "Recent Submissions"
|
|
181
|
-
}), /* @__PURE__ */
|
|
179
|
+
}), /* @__PURE__ */ y("button", {
|
|
182
180
|
type: "button",
|
|
183
|
-
onClick: () =>
|
|
181
|
+
onClick: () => T(`${D}/submissions`),
|
|
184
182
|
className: "inline-flex items-center gap-1 text-xs text-text-accent hover:underline",
|
|
185
|
-
children: ["View all", /* @__PURE__ */
|
|
183
|
+
children: ["View all", /* @__PURE__ */ v(l, { className: "size-3" })]
|
|
186
184
|
})]
|
|
187
185
|
}),
|
|
188
|
-
|
|
186
|
+
I && /* @__PURE__ */ v("div", {
|
|
189
187
|
role: "alert",
|
|
190
188
|
className: "mb-3 rounded-md border border-border-danger bg-surface-danger-muted px-4 py-2 text-sm text-text-danger",
|
|
191
|
-
children:
|
|
189
|
+
children: I
|
|
192
190
|
}),
|
|
193
|
-
|
|
191
|
+
O.loading ? /* @__PURE__ */ v("div", {
|
|
194
192
|
className: "rounded-lg border border-border-default bg-surface-raised py-10 text-center text-sm text-text-secondary",
|
|
195
193
|
children: "Loading…"
|
|
196
|
-
}) :
|
|
194
|
+
}) : O.recentPending.length === 0 ? /* @__PURE__ */ v("div", {
|
|
197
195
|
className: "rounded-lg border border-border-default bg-surface-raised py-10 text-center text-sm text-text-secondary",
|
|
198
196
|
children: "No pending submissions."
|
|
199
|
-
}) : /* @__PURE__ */
|
|
197
|
+
}) : /* @__PURE__ */ v("ul", {
|
|
200
198
|
className: "space-y-2",
|
|
201
|
-
children:
|
|
199
|
+
children: O.recentPending.map((e) => /* @__PURE__ */ y("li", {
|
|
202
200
|
className: "overflow-hidden rounded-lg border border-border-default bg-surface-raised",
|
|
203
201
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ y("div", {
|
|
205
203
|
className: "flex items-center gap-3 px-4 py-3",
|
|
206
204
|
children: [
|
|
207
|
-
e.icon ? /* @__PURE__ */
|
|
205
|
+
e.icon ? /* @__PURE__ */ v("img", {
|
|
208
206
|
src: e.icon,
|
|
209
207
|
alt: "",
|
|
210
|
-
className: "
|
|
211
|
-
}) : /* @__PURE__ */
|
|
212
|
-
className: "flex
|
|
208
|
+
className: "size-10 flex-shrink-0 rounded-md object-cover"
|
|
209
|
+
}) : /* @__PURE__ */ v("div", {
|
|
210
|
+
className: "flex size-10 flex-shrink-0 items-center justify-center rounded-md bg-surface-muted text-xs text-text-secondary",
|
|
213
211
|
children: e.type.slice(0, 2)
|
|
214
212
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ y("div", {
|
|
216
214
|
className: "min-w-0 flex-1",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
215
|
+
children: [/* @__PURE__ */ v("p", {
|
|
218
216
|
className: "truncate text-sm font-medium text-text-primary",
|
|
219
217
|
children: e.name
|
|
220
|
-
}), /* @__PURE__ */
|
|
218
|
+
}), /* @__PURE__ */ y("p", {
|
|
221
219
|
className: "text-xs text-text-secondary",
|
|
222
220
|
children: [
|
|
223
221
|
e.publisher?.name ?? "Unknown publisher",
|
|
224
222
|
" ·",
|
|
225
223
|
" ",
|
|
226
|
-
|
|
224
|
+
t(e.price, e.currency, e.pricingModel),
|
|
227
225
|
" ·",
|
|
228
226
|
" ",
|
|
229
|
-
|
|
227
|
+
U(e.submittedAt)
|
|
230
228
|
]
|
|
231
229
|
})]
|
|
232
230
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ y("div", {
|
|
234
232
|
className: "flex flex-shrink-0 items-center gap-2",
|
|
235
233
|
children: [
|
|
236
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ y("button", {
|
|
237
235
|
type: "button",
|
|
238
|
-
onClick: () =>
|
|
236
|
+
onClick: () => z(R === e.id ? null : e.id),
|
|
239
237
|
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",
|
|
240
|
-
children: [
|
|
238
|
+
children: [R === e.id ? /* @__PURE__ */ v(c, { className: "size-3.5" }) : /* @__PURE__ */ v(s, { className: "size-3.5" }), "Details"]
|
|
241
239
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ y("button", {
|
|
243
241
|
type: "button",
|
|
244
|
-
onClick: () => void
|
|
245
|
-
disabled:
|
|
242
|
+
onClick: () => void V(e.id),
|
|
243
|
+
disabled: A === e.id,
|
|
246
244
|
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",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
245
|
+
children: [/* @__PURE__ */ v(a, { className: "size-3.5" }), "Approve"]
|
|
248
246
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ y("button", {
|
|
250
248
|
type: "button",
|
|
251
249
|
onClick: () => {
|
|
252
|
-
|
|
250
|
+
N(e.id), F(""), L(null);
|
|
253
251
|
},
|
|
254
|
-
disabled:
|
|
252
|
+
disabled: A === e.id,
|
|
255
253
|
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",
|
|
256
|
-
children: [/* @__PURE__ */ g
|
|
254
|
+
children: [/* @__PURE__ */ v(g, { className: "size-3.5" }), "Reject"]
|
|
257
255
|
})
|
|
258
256
|
]
|
|
259
257
|
})
|
|
260
258
|
]
|
|
261
259
|
}),
|
|
262
|
-
|
|
263
|
-
className: "border-t border-border-default bg-surface-muted
|
|
264
|
-
children: /* @__PURE__ */
|
|
260
|
+
R === e.id && /* @__PURE__ */ v("div", {
|
|
261
|
+
className: "border-t border-border-default bg-surface-muted p-4",
|
|
262
|
+
children: /* @__PURE__ */ y("dl", {
|
|
265
263
|
className: "grid grid-cols-2 gap-x-6 gap-y-3 text-xs sm:grid-cols-3",
|
|
266
264
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
268
266
|
className: "font-medium text-text-secondary",
|
|
269
267
|
children: "Slug"
|
|
270
|
-
}), /* @__PURE__ */
|
|
268
|
+
}), /* @__PURE__ */ v("dd", {
|
|
271
269
|
className: "mt-0.5 font-mono text-text-primary",
|
|
272
270
|
children: e.slug
|
|
273
271
|
})] }),
|
|
274
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
275
273
|
className: "font-medium text-text-secondary",
|
|
276
274
|
children: "Type"
|
|
277
|
-
}), /* @__PURE__ */
|
|
275
|
+
}), /* @__PURE__ */ v("dd", {
|
|
278
276
|
className: "mt-0.5 text-text-primary",
|
|
279
277
|
children: e.type
|
|
280
278
|
})] }),
|
|
281
|
-
e.nature && /* @__PURE__ */
|
|
279
|
+
e.nature && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
282
280
|
className: "font-medium text-text-secondary",
|
|
283
281
|
children: "Nature"
|
|
284
|
-
}), /* @__PURE__ */
|
|
282
|
+
}), /* @__PURE__ */ v("dd", {
|
|
285
283
|
className: "mt-0.5 text-text-primary",
|
|
286
284
|
children: e.nature
|
|
287
285
|
})] }),
|
|
288
|
-
e.category && /* @__PURE__ */
|
|
286
|
+
e.category && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
289
287
|
className: "font-medium text-text-secondary",
|
|
290
288
|
children: "Category"
|
|
291
|
-
}), /* @__PURE__ */
|
|
289
|
+
}), /* @__PURE__ */ v("dd", {
|
|
292
290
|
className: "mt-0.5 text-text-primary",
|
|
293
291
|
children: e.category
|
|
294
292
|
})] }),
|
|
295
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
296
294
|
className: "font-medium text-text-secondary",
|
|
297
295
|
children: "Pricing"
|
|
298
|
-
}), /* @__PURE__ */
|
|
296
|
+
}), /* @__PURE__ */ y("dd", {
|
|
299
297
|
className: "mt-0.5 text-text-primary",
|
|
300
298
|
children: [
|
|
301
|
-
|
|
299
|
+
t(e.price, e.currency, e.pricingModel),
|
|
302
300
|
" ",
|
|
303
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ y("span", {
|
|
304
302
|
className: "text-text-tertiary",
|
|
305
303
|
children: [
|
|
306
304
|
"(",
|
|
@@ -310,36 +308,36 @@ var b = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
310
308
|
})
|
|
311
309
|
]
|
|
312
310
|
})] }),
|
|
313
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
314
312
|
className: "font-medium text-text-secondary",
|
|
315
313
|
children: "Publisher"
|
|
316
|
-
}), /* @__PURE__ */
|
|
314
|
+
}), /* @__PURE__ */ y("dd", {
|
|
317
315
|
className: "mt-0.5 text-text-primary",
|
|
318
|
-
children: [e.publisher?.name ?? "—", e.publisher?.email && /* @__PURE__ */
|
|
316
|
+
children: [e.publisher?.name ?? "—", e.publisher?.email && /* @__PURE__ */ v("span", {
|
|
319
317
|
className: "block text-text-tertiary",
|
|
320
318
|
children: e.publisher.email
|
|
321
319
|
})]
|
|
322
320
|
})] }),
|
|
323
|
-
e.submittedBy && /* @__PURE__ */
|
|
321
|
+
e.submittedBy && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
324
322
|
className: "font-medium text-text-secondary",
|
|
325
323
|
children: "Submitted by"
|
|
326
|
-
}), /* @__PURE__ */
|
|
324
|
+
}), /* @__PURE__ */ v("dd", {
|
|
327
325
|
className: "mt-0.5 font-mono text-text-primary",
|
|
328
326
|
children: e.submittedBy
|
|
329
327
|
})] }),
|
|
330
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("dt", {
|
|
331
329
|
className: "font-medium text-text-secondary",
|
|
332
330
|
children: "Submitted at"
|
|
333
|
-
}), /* @__PURE__ */
|
|
331
|
+
}), /* @__PURE__ */ v("dd", {
|
|
334
332
|
className: "mt-0.5 text-text-primary",
|
|
335
|
-
children:
|
|
333
|
+
children: U(e.submittedAt)
|
|
336
334
|
})] }),
|
|
337
|
-
e.description && /* @__PURE__ */
|
|
335
|
+
e.description && /* @__PURE__ */ y("div", {
|
|
338
336
|
className: "col-span-2 sm:col-span-3",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ v("dt", {
|
|
340
338
|
className: "font-medium text-text-secondary",
|
|
341
339
|
children: "Description"
|
|
342
|
-
}), /* @__PURE__ */
|
|
340
|
+
}), /* @__PURE__ */ v("dd", {
|
|
343
341
|
className: "mt-0.5 text-text-primary",
|
|
344
342
|
children: e.description
|
|
345
343
|
})]
|
|
@@ -347,35 +345,36 @@ var b = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
347
345
|
]
|
|
348
346
|
})
|
|
349
347
|
}),
|
|
350
|
-
|
|
348
|
+
M === e.id && /* @__PURE__ */ y("div", {
|
|
351
349
|
className: "border-t border-border-default bg-surface-muted px-4 py-3",
|
|
352
350
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ v("label", {
|
|
354
352
|
htmlFor: `reject-reason-${e.id}`,
|
|
355
353
|
className: "block text-xs font-medium text-text-secondary",
|
|
356
354
|
children: "Rejection reason (required)"
|
|
357
355
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ v("textarea", {
|
|
359
357
|
id: `reject-reason-${e.id}`,
|
|
360
|
-
|
|
361
|
-
|
|
358
|
+
"aria-label": "Rejection reason",
|
|
359
|
+
value: P,
|
|
360
|
+
onChange: (e) => F(e.target.value),
|
|
362
361
|
rows: 2,
|
|
363
362
|
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:outline-none",
|
|
364
363
|
placeholder: "Explain why this submission is being rejected…"
|
|
365
364
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ y("div", {
|
|
367
366
|
className: "mt-2 flex justify-end gap-2",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ v("button", {
|
|
369
368
|
type: "button",
|
|
370
369
|
onClick: () => {
|
|
371
|
-
|
|
370
|
+
N(null), F("");
|
|
372
371
|
},
|
|
373
372
|
className: "rounded-md border border-border-default bg-surface-default px-3 py-1 text-xs text-text-primary hover:bg-surface-hover",
|
|
374
373
|
children: "Cancel"
|
|
375
|
-
}), /* @__PURE__ */
|
|
374
|
+
}), /* @__PURE__ */ v("button", {
|
|
376
375
|
type: "button",
|
|
377
|
-
onClick: () => void
|
|
378
|
-
disabled: !
|
|
376
|
+
onClick: () => void H(e.id),
|
|
377
|
+
disabled: !P.trim() || A === e.id,
|
|
379
378
|
className: "rounded-md bg-surface-danger px-3 py-1 text-xs font-medium text-text-on-danger hover:bg-surface-danger-hover disabled:opacity-60",
|
|
380
379
|
children: "Submit rejection"
|
|
381
380
|
})]
|
|
@@ -386,93 +385,93 @@ var b = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
386
385
|
}, e.id))
|
|
387
386
|
})
|
|
388
387
|
] }),
|
|
389
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ y("section", { children: [/* @__PURE__ */ v("h2", {
|
|
390
389
|
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
391
390
|
children: "Recent Activity"
|
|
392
|
-
}), /* @__PURE__ */
|
|
391
|
+
}), /* @__PURE__ */ y("div", {
|
|
393
392
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
|
|
394
|
-
children: [/* @__PURE__ */
|
|
393
|
+
children: [/* @__PURE__ */ y("div", {
|
|
395
394
|
className: "rounded-lg border border-border-default bg-surface-raised",
|
|
396
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ y("div", {
|
|
397
396
|
className: "flex items-center gap-2 border-b border-border-default px-4 py-3",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
397
|
+
children: [/* @__PURE__ */ v(o, { className: "size-4 text-text-success" }), /* @__PURE__ */ v("h3", {
|
|
399
398
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
400
399
|
children: "Recently Approved"
|
|
401
400
|
})]
|
|
402
|
-
}),
|
|
401
|
+
}), O.loading ? /* @__PURE__ */ v("p", {
|
|
403
402
|
className: "px-4 py-6 text-center text-sm text-text-secondary",
|
|
404
403
|
children: "Loading…"
|
|
405
|
-
}) :
|
|
404
|
+
}) : O.recentPublished.length === 0 ? /* @__PURE__ */ v("p", {
|
|
406
405
|
className: "px-4 py-6 text-center text-sm text-text-secondary",
|
|
407
406
|
children: "No approved products yet."
|
|
408
|
-
}) : /* @__PURE__ */
|
|
407
|
+
}) : /* @__PURE__ */ v("ul", {
|
|
409
408
|
className: "divide-y divide-border-default",
|
|
410
|
-
children:
|
|
409
|
+
children: O.recentPublished.map((e) => /* @__PURE__ */ y("li", {
|
|
411
410
|
className: "flex items-center gap-3 px-4 py-3",
|
|
412
411
|
children: [
|
|
413
|
-
e.icon ? /* @__PURE__ */
|
|
412
|
+
e.icon ? /* @__PURE__ */ v("img", {
|
|
414
413
|
src: e.icon,
|
|
415
414
|
alt: "",
|
|
416
|
-
className: "
|
|
417
|
-
}) : /* @__PURE__ */
|
|
418
|
-
className: "flex
|
|
419
|
-
children: "
|
|
415
|
+
className: "size-8 flex-shrink-0 rounded-md object-cover"
|
|
416
|
+
}) : /* @__PURE__ */ v("div", {
|
|
417
|
+
className: "flex size-8 flex-shrink-0 items-center justify-center rounded-md bg-surface-muted text-xs text-text-secondary",
|
|
418
|
+
children: "?"
|
|
420
419
|
}),
|
|
421
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ y("div", {
|
|
422
421
|
className: "min-w-0 flex-1",
|
|
423
|
-
children: [/* @__PURE__ */
|
|
422
|
+
children: [/* @__PURE__ */ v("p", {
|
|
424
423
|
className: "truncate text-sm font-medium text-text-primary",
|
|
425
424
|
children: e.name
|
|
426
|
-
}), /* @__PURE__ */
|
|
425
|
+
}), /* @__PURE__ */ y("p", {
|
|
427
426
|
className: "text-xs text-text-secondary",
|
|
428
|
-
children: [e.reviewedBy ? `by ${e.reviewedBy} · ` : "",
|
|
427
|
+
children: [e.reviewedBy ? `by ${e.reviewedBy} · ` : "", U(e.publishedAt)]
|
|
429
428
|
})]
|
|
430
429
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ v("span", {
|
|
432
431
|
className: "flex-shrink-0 rounded-full bg-surface-success-muted px-2 py-0.5 text-xs font-medium text-text-success",
|
|
433
432
|
children: "Published"
|
|
434
433
|
})
|
|
435
434
|
]
|
|
436
435
|
}, e.id))
|
|
437
436
|
})]
|
|
438
|
-
}), /* @__PURE__ */
|
|
437
|
+
}), /* @__PURE__ */ y("div", {
|
|
439
438
|
className: "rounded-lg border border-border-default bg-surface-raised",
|
|
440
|
-
children: [/* @__PURE__ */
|
|
439
|
+
children: [/* @__PURE__ */ y("div", {
|
|
441
440
|
className: "flex items-center gap-2 border-b border-border-default px-4 py-3",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ v(_, { className: "size-4 text-text-danger" }), /* @__PURE__ */ v("h3", {
|
|
443
442
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
444
443
|
children: "Recently Rejected"
|
|
445
444
|
})]
|
|
446
|
-
}),
|
|
445
|
+
}), O.loading ? /* @__PURE__ */ v("p", {
|
|
447
446
|
className: "px-4 py-6 text-center text-sm text-text-secondary",
|
|
448
447
|
children: "Loading…"
|
|
449
|
-
}) :
|
|
448
|
+
}) : O.recentRejected.length === 0 ? /* @__PURE__ */ v("p", {
|
|
450
449
|
className: "px-4 py-6 text-center text-sm text-text-secondary",
|
|
451
450
|
children: "No rejected products yet."
|
|
452
|
-
}) : /* @__PURE__ */
|
|
451
|
+
}) : /* @__PURE__ */ v("ul", {
|
|
453
452
|
className: "divide-y divide-border-default",
|
|
454
|
-
children:
|
|
453
|
+
children: O.recentRejected.map((e) => /* @__PURE__ */ y("li", {
|
|
455
454
|
className: "flex items-center gap-3 px-4 py-3",
|
|
456
455
|
children: [
|
|
457
|
-
e.icon ? /* @__PURE__ */
|
|
456
|
+
e.icon ? /* @__PURE__ */ v("img", {
|
|
458
457
|
src: e.icon,
|
|
459
458
|
alt: "",
|
|
460
|
-
className: "
|
|
461
|
-
}) : /* @__PURE__ */
|
|
462
|
-
className: "flex
|
|
463
|
-
children: "
|
|
459
|
+
className: "size-8 flex-shrink-0 rounded-md object-cover"
|
|
460
|
+
}) : /* @__PURE__ */ v("div", {
|
|
461
|
+
className: "flex size-8 flex-shrink-0 items-center justify-center rounded-md bg-surface-muted text-xs text-text-secondary",
|
|
462
|
+
children: "?"
|
|
464
463
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ y("div", {
|
|
466
465
|
className: "min-w-0 flex-1",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
466
|
+
children: [/* @__PURE__ */ v("p", {
|
|
468
467
|
className: "truncate text-sm font-medium text-text-primary",
|
|
469
468
|
children: e.name
|
|
470
|
-
}), /* @__PURE__ */
|
|
469
|
+
}), /* @__PURE__ */ y("p", {
|
|
471
470
|
className: "truncate text-xs text-text-secondary",
|
|
472
|
-
children: [e.rejectedReason ? `"${e.rejectedReason}" · ` : "",
|
|
471
|
+
children: [e.rejectedReason ? `"${e.rejectedReason}" · ` : "", U(e.reviewedAt)]
|
|
473
472
|
})]
|
|
474
473
|
}),
|
|
475
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ v("span", {
|
|
476
475
|
className: "flex-shrink-0 rounded-full bg-surface-danger-muted px-2 py-0.5 text-xs font-medium text-text-danger",
|
|
477
476
|
children: "Rejected"
|
|
478
477
|
})
|
|
@@ -486,6 +485,6 @@ var b = "\n query AdminDashboardData {\n recentPending: pendingReviewProduct
|
|
|
486
485
|
});
|
|
487
486
|
};
|
|
488
487
|
//#endregion
|
|
489
|
-
export {
|
|
488
|
+
export { T as AdminDashboardPage };
|
|
490
489
|
|
|
491
490
|
//# sourceMappingURL=AdminDashboardPage.js.map
|