@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.
@@ -1,13 +1,13 @@
1
1
  import { useStore as e } from "../providers/StoreProvider.js";
2
2
  import { useEffect as t, useRef as n, useState as r } from "react";
3
3
  import { ArrowLeft as i, MessageSquareWarning as a, Search as o, X as s } from "lucide-react";
4
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
- import { useNavigate as u } from "react-router-dom";
6
- import { graphqlFetch as d } from "@burdenoff/fe-libs/shared/graphql";
4
+ import { graphqlFetch as c } from "@burdenoff/fe-libs/shared/graphql";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ import { useNavigate as d } from "react-router-dom";
7
7
  import { GlassCard as f, IllustratedEmptyState as p, PagePurpose as m } from "@burdenoff/fe-libs/ui";
8
8
  //#region src/pages/AdminReviewModerationPage.tsx
9
9
  var h = "query SearchProductsForModeration($query: String!) { searchProducts(query: $query, limit: 10) { id name slug } }", g = "query ProductReviewsForModeration($productId: String!) { productReviews(productId: $productId) { id userId rating title comment status helpful createdAt } }", _ = "mutation RejectReview($id: ID!) { rejectReview(id: $id) { id status } }", v = () => {
10
- let v = u(), { authToken: y } = e(), [b, x] = r(""), [S, C] = r([]), [w, T] = r(!1), [E, D] = r(!1), [O, k] = r(null), [A, j] = r([]), [M, N] = r(!1), [P, F] = r(null), [I, L] = r(null), R = n(null), z = n(null);
10
+ let v = d(), { authToken: y } = e(), [b, x] = r(""), [S, C] = r([]), [w, T] = r(!1), [E, D] = r(!1), [O, k] = r(null), [A, j] = r([]), [M, N] = r(!1), [P, F] = r(null), [I, L] = r(null), R = n(null), z = n(null);
11
11
  t(() => {
12
12
  let e = (e) => {
13
13
  z.current && !z.current.contains(e.target) && D(!1);
@@ -22,7 +22,7 @@ var h = "query SearchProductsForModeration($query: String!) { searchProducts(que
22
22
  R.current = setTimeout(async () => {
23
23
  T(!0);
24
24
  try {
25
- C((await d({
25
+ C((await c({
26
26
  gateway: "global",
27
27
  query: h,
28
28
  variables: { query: e },
@@ -39,7 +39,7 @@ var h = "query SearchProductsForModeration($query: String!) { searchProducts(que
39
39
  }, H = async (e) => {
40
40
  N(!0), F(null);
41
41
  try {
42
- let t = await d({
42
+ let t = await c({
43
43
  gateway: "global",
44
44
  query: g,
45
45
  variables: { productId: e },
@@ -55,7 +55,7 @@ var h = "query SearchProductsForModeration($query: String!) { searchProducts(que
55
55
  }, U = async (e) => {
56
56
  L(e), F(null);
57
57
  try {
58
- let t = await d({
58
+ let t = await c({
59
59
  gateway: "global",
60
60
  query: _,
61
61
  variables: { id: e },
@@ -69,56 +69,56 @@ var h = "query SearchProductsForModeration($query: String!) { searchProducts(que
69
69
  L(null);
70
70
  }
71
71
  };
72
- return /* @__PURE__ */ l("div", {
72
+ return /* @__PURE__ */ u("div", {
73
73
  className: "min-h-screen bg-surface-default",
74
- children: [/* @__PURE__ */ c("header", {
74
+ children: [/* @__PURE__ */ l("header", {
75
75
  className: "border-b border-border-seam bg-surface-raised",
76
- children: /* @__PURE__ */ l("div", {
76
+ children: /* @__PURE__ */ u("div", {
77
77
  className: "mx-auto max-w-7xl px-6 py-4",
78
- children: [/* @__PURE__ */ l("div", {
78
+ children: [/* @__PURE__ */ u("div", {
79
79
  className: "flex items-center gap-3",
80
- children: [/* @__PURE__ */ l("button", {
80
+ children: [/* @__PURE__ */ u("button", {
81
81
  type: "button",
82
82
  onClick: () => v(-1),
83
83
  "aria-label": "Go back",
84
84
  className: "inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-sm text-text-secondary hover:bg-surface-hover hover:text-text-primary",
85
- children: [/* @__PURE__ */ c(i, { className: "size-4" }), "Back"]
86
- }), /* @__PURE__ */ l("div", {
85
+ children: [/* @__PURE__ */ l(i, { className: "size-4" }), "Back"]
86
+ }), /* @__PURE__ */ u("div", {
87
87
  className: "flex items-center gap-2",
88
- children: [/* @__PURE__ */ c(a, { className: "size-5 text-text-primary" }), /* @__PURE__ */ c("h1", {
88
+ children: [/* @__PURE__ */ l(a, { className: "size-5 text-text-primary" }), /* @__PURE__ */ l("h1", {
89
89
  className: "text-xl font-semibold text-text-primary",
90
90
  children: "Review Moderation"
91
91
  })]
92
92
  })]
93
- }), /* @__PURE__ */ c("p", {
93
+ }), /* @__PURE__ */ l("p", {
94
94
  className: "mt-1 text-sm text-text-secondary",
95
95
  children: "Review published content by product and remove anything that violates guidelines"
96
96
  })]
97
97
  })
98
- }), /* @__PURE__ */ c("main", {
98
+ }), /* @__PURE__ */ l("main", {
99
99
  className: "mx-auto max-w-7xl p-6",
100
- children: /* @__PURE__ */ l("div", {
100
+ children: /* @__PURE__ */ u("div", {
101
101
  className: "space-y-4",
102
102
  children: [
103
- /* @__PURE__ */ c(m, { children: "Keep the marketplace trustworthy. Pick any product, read every review customers have left for it, and remove ones that break the content guidelines (spam, abuse, or off-topic posts). This is targeted clean-up — search the exact product you need to moderate rather than scrolling an endless global feed." }),
104
- /* @__PURE__ */ l(f, {
103
+ /* @__PURE__ */ l(m, { children: "Keep the marketplace trustworthy. Pick any product, read every review customers have left for it, and remove ones that break the content guidelines (spam, abuse, or off-topic posts). This is targeted clean-up — search the exact product you need to moderate rather than scrolling an endless global feed." }),
104
+ /* @__PURE__ */ u(f, {
105
105
  treatment: "glass",
106
106
  glow: !0,
107
107
  className: "p-4",
108
- children: [/* @__PURE__ */ l("div", {
108
+ children: [/* @__PURE__ */ u("div", {
109
109
  ref: z,
110
110
  className: "relative",
111
111
  children: [
112
- /* @__PURE__ */ c("label", {
112
+ /* @__PURE__ */ l("label", {
113
113
  htmlFor: "admin-review-product-search",
114
114
  className: "mb-1.5 block text-sm font-medium text-text-primary",
115
115
  children: "Search product by name"
116
116
  }),
117
- /* @__PURE__ */ l("div", {
117
+ /* @__PURE__ */ u("div", {
118
118
  className: "relative flex items-center",
119
119
  children: [
120
- /* @__PURE__ */ c(o, { className: "pointer-events-none absolute left-3 size-4 text-text-secondary" }),
121
- /* @__PURE__ */ c("input", {
120
+ /* @__PURE__ */ l(o, { className: "pointer-events-none absolute left-3 size-4 text-text-secondary" }),
121
+ /* @__PURE__ */ l("input", {
122
122
  id: "admin-review-product-search",
123
123
  "aria-label": "Search product by name",
124
124
  value: b,
@@ -128,28 +128,28 @@ var h = "query SearchProductsForModeration($query: String!) { searchProducts(que
128
128
  autoComplete: "off",
129
129
  className: "w-full rounded-md border border-border-default bg-surface-default py-2 pl-9 pr-3 text-sm text-text-primary outline-none focus:border-border-accent"
130
130
  }),
131
- w && /* @__PURE__ */ c("span", {
131
+ w && /* @__PURE__ */ l("span", {
132
132
  className: "absolute right-3 text-xs text-text-secondary",
133
133
  children: "Searching…"
134
134
  })
135
135
  ]
136
136
  }),
137
- E && S.length > 0 && /* @__PURE__ */ c("ul", {
137
+ E && S.length > 0 && /* @__PURE__ */ l("ul", {
138
138
  className: "absolute z-10 mt-1 w-full rounded-md border border-border-default bg-surface-raised shadow-lg",
139
- children: S.map((e) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ l("button", {
139
+ children: S.map((e) => /* @__PURE__ */ l("li", { children: /* @__PURE__ */ u("button", {
140
140
  type: "button",
141
141
  onClick: () => V(e),
142
142
  className: "w-full px-4 py-2.5 text-left text-sm hover:bg-surface-hover",
143
- children: [/* @__PURE__ */ c("span", {
143
+ children: [/* @__PURE__ */ l("span", {
144
144
  className: "font-medium text-text-primary",
145
145
  children: e.name
146
- }), /* @__PURE__ */ c("span", {
146
+ }), /* @__PURE__ */ l("span", {
147
147
  className: "ml-2 text-xs text-text-secondary",
148
148
  children: e.slug
149
149
  })]
150
150
  }) }, e.id))
151
151
  }),
152
- E && !w && S.length === 0 && b.trim() && /* @__PURE__ */ l("div", {
152
+ E && !w && S.length === 0 && b.trim() && /* @__PURE__ */ u("div", {
153
153
  className: "absolute z-10 mt-1 w-full rounded-md border border-border-default bg-surface-raised px-4 py-3 text-sm text-text-secondary shadow-lg",
154
154
  children: [
155
155
  "No products found for “",
@@ -158,16 +158,16 @@ var h = "query SearchProductsForModeration($query: String!) { searchProducts(que
158
158
  ]
159
159
  })
160
160
  ]
161
- }), O && /* @__PURE__ */ l("p", {
161
+ }), O && /* @__PURE__ */ u("p", {
162
162
  className: "mt-2 text-xs text-text-secondary",
163
163
  children: [
164
164
  "Moderating:",
165
165
  " ",
166
- /* @__PURE__ */ c("span", {
166
+ /* @__PURE__ */ l("span", {
167
167
  className: "font-medium text-text-primary",
168
168
  children: O.name
169
169
  }),
170
- /* @__PURE__ */ l("span", {
170
+ /* @__PURE__ */ u("span", {
171
171
  className: "ml-1 text-text-tertiary",
172
172
  children: [
173
173
  "(",
@@ -178,48 +178,48 @@ var h = "query SearchProductsForModeration($query: String!) { searchProducts(que
178
178
  ]
179
179
  })]
180
180
  }),
181
- P && /* @__PURE__ */ c("div", {
181
+ P && /* @__PURE__ */ l("div", {
182
182
  role: "alert",
183
183
  className: "rounded-md border border-border-danger bg-surface-danger-muted px-4 py-3 text-sm text-text-danger",
184
184
  children: P
185
185
  }),
186
- M && /* @__PURE__ */ c("div", {
186
+ M && /* @__PURE__ */ l("div", {
187
187
  className: "rounded-lg border border-border-default bg-surface-raised p-10 text-center",
188
- children: /* @__PURE__ */ c("p", {
188
+ children: /* @__PURE__ */ l("p", {
189
189
  className: "text-sm text-text-secondary",
190
190
  children: "Loading reviews…"
191
191
  })
192
192
  }),
193
- !M && !O ? /* @__PURE__ */ c(p, {
193
+ !M && !O ? /* @__PURE__ */ l(p, {
194
194
  illustration: "empty-search",
195
195
  title: "Search a product to moderate",
196
196
  description: "Use the search box above to find a product by name. Its reviews will load here so you can inspect and remove any that violate the guidelines."
197
- }) : !M && O && A.length === 0 ? /* @__PURE__ */ c(p, {
197
+ }) : !M && O && A.length === 0 ? /* @__PURE__ */ l(p, {
198
198
  illustration: "empty-notifications",
199
199
  title: "No reviews to moderate",
200
200
  description: "This product has no reviews right now. Nothing here needs your attention."
201
- }) : /* @__PURE__ */ c("ul", {
201
+ }) : /* @__PURE__ */ l("ul", {
202
202
  className: "space-y-3",
203
- children: A.map((e) => /* @__PURE__ */ c("li", {
203
+ children: A.map((e) => /* @__PURE__ */ l("li", {
204
204
  className: "rounded-lg border border-border-seam bg-surface-raised p-4 transition-[box-shadow,border-color] hover:border-border-strong hover:shadow-[var(--shadow-pop)]",
205
- children: /* @__PURE__ */ l("div", {
205
+ children: /* @__PURE__ */ u("div", {
206
206
  className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
207
- children: [/* @__PURE__ */ l("div", { children: [
208
- /* @__PURE__ */ l("div", {
207
+ children: [/* @__PURE__ */ u("div", { children: [
208
+ /* @__PURE__ */ u("div", {
209
209
  className: "flex items-center gap-2",
210
- children: [/* @__PURE__ */ c("p", {
210
+ children: [/* @__PURE__ */ l("p", {
211
211
  className: "font-medium text-text-primary",
212
212
  children: e.title || "Untitled review"
213
- }), /* @__PURE__ */ c("span", {
213
+ }), /* @__PURE__ */ l("span", {
214
214
  className: "rounded-full bg-surface-muted px-2 py-0.5 text-xs text-text-secondary",
215
215
  children: e.status
216
216
  })]
217
217
  }),
218
- /* @__PURE__ */ c("p", {
218
+ /* @__PURE__ */ l("p", {
219
219
  className: "mt-1 text-sm text-text-secondary",
220
220
  children: e.comment || "No comment provided."
221
221
  }),
222
- /* @__PURE__ */ l("p", {
222
+ /* @__PURE__ */ u("p", {
223
223
  className: "mt-2 text-xs text-text-secondary",
224
224
  children: [
225
225
  "User ",
@@ -230,14 +230,14 @@ var h = "query SearchProductsForModeration($query: String!) { searchProducts(que
230
230
  e.helpful
231
231
  ]
232
232
  })
233
- ] }), /* @__PURE__ */ c("div", {
233
+ ] }), /* @__PURE__ */ l("div", {
234
234
  className: "flex items-center gap-2",
235
- children: /* @__PURE__ */ l("button", {
235
+ children: /* @__PURE__ */ u("button", {
236
236
  type: "button",
237
237
  onClick: () => U(e.id),
238
238
  disabled: I === e.id,
239
239
  className: "inline-flex items-center gap-1.5 rounded-md border border-border-danger px-3 py-1.5 text-sm font-medium text-text-danger hover:bg-surface-danger-muted disabled:cursor-not-allowed disabled:opacity-60",
240
- children: [/* @__PURE__ */ c(s, { className: "size-4" }), " Remove"]
240
+ children: [/* @__PURE__ */ l(s, { className: "size-4" }), " Remove"]
241
241
  })
242
242
  })]
243
243
  })