@burdenoff/microfe-coolandlovely 2026.1110.1 → 2026.1110.3
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/coolandlovely/CoolAndLovelyRoutes.js +9 -5
- package/dist/coolandlovely/hooks/useResaleModeration.d.ts +22 -0
- package/dist/coolandlovely/hooks/useResaleModeration.js +79 -0
- package/dist/coolandlovely/pages/resale/ResaleBrowsePage.js +89 -81
- package/dist/coolandlovely/pages/resale/ResaleModerationPage.d.ts +1 -0
- package/dist/coolandlovely/pages/resale/ResaleModerationPage.js +425 -0
- package/dist/generated/wspace-operations.js +11 -11
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { Suspense as n, lazy as r } from "react";
|
|
|
4
4
|
import { Navigate as i, Route as a, Routes as o, useLocation as s } from "react-router";
|
|
5
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
// src/coolandlovely/CoolAndLovelyRoutes.tsx
|
|
7
|
-
var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ default: e.BrandsListPage }))), d = r(() => import("./pages/brands/BrandDetailPage.js").then((e) => ({ default: e.BrandDetailPage }))), f = r(() => import("./pages/brands/BrandFormPage.js").then((e) => ({ default: e.BrandFormPage }))), p = r(() => import("./pages/brands/ImportCatalogPage.js").then((e) => ({ default: e.ImportCatalogPage }))), m = r(() => import("./pages/collections/CollectionsListPage.js").then((e) => ({ default: e.CollectionsListPage }))), h = r(() => import("./pages/collections/CollectionDetailPage.js").then((e) => ({ default: e.CollectionDetailPage }))), g = r(() => import("./pages/collections/CollectionFormPage.js").then((e) => ({ default: e.CollectionFormPage }))), _ = r(() => import("./pages/items/StyleItemsListPage.js").then((e) => ({ default: e.StyleItemsListPage }))), v = r(() => import("./pages/items/StyleItemDetailPage.js").then((e) => ({ default: e.StyleItemDetailPage }))), y = r(() => import("./pages/items/StyleItemFormPage.js").then((e) => ({ default: e.StyleItemFormPage }))), b = r(() => import("./pages/looks/LooksListPage.js").then((e) => ({ default: e.LooksListPage }))), x = r(() => import("./pages/looks/LookDetailPage.js").then((e) => ({ default: e.LookDetailPage }))), S = r(() => import("./pages/looks/LookFormPage.js").then((e) => ({ default: e.LookFormPage }))), C = r(() => import("./pages/collaborations/CollaborationsListPage.js").then((e) => ({ default: e.CollaborationsListPage }))), w = r(() => import("./pages/collaborations/CollaborationDetailPage.js").then((e) => ({ default: e.CollaborationDetailPage }))), T = r(() => import("./pages/collaborations/CollaborationFormPage.js").then((e) => ({ default: e.CollaborationFormPage }))), E = r(() => import("./pages/wardrobe/WardrobeListPage.js").then((e) => ({ default: e.WardrobeListPage }))), D = r(() => import("./pages/wardrobe/WardrobeFormPage.js").then((e) => ({ default: e.WardrobeFormPage }))), O = r(() => import("./pages/lookbooks/LookbooksListPage.js").then((e) => ({ default: e.LookbooksListPage }))), k = r(() => import("./pages/lookbooks/LookbookDetailPage.js").then((e) => ({ default: e.LookbookDetailPage }))), A = r(() => import("./pages/profile/StyleProfilePage.js").then((e) => ({ default: e.StyleProfilePage }))), j = r(() => import("./pages/discover/DiscoverPage.js").then((e) => ({ default: e.DiscoverPage }))), M = r(() => import("./pages/trends/TrendsPage.js").then((e) => ({ default: e.TrendsPage }))), N = r(() => import("./pages/editorial/EditorialPage.js").then((e) => ({ default: e.EditorialPage }))),
|
|
7
|
+
var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ default: e.BrandsListPage }))), d = r(() => import("./pages/brands/BrandDetailPage.js").then((e) => ({ default: e.BrandDetailPage }))), f = r(() => import("./pages/brands/BrandFormPage.js").then((e) => ({ default: e.BrandFormPage }))), p = r(() => import("./pages/brands/ImportCatalogPage.js").then((e) => ({ default: e.ImportCatalogPage }))), m = r(() => import("./pages/collections/CollectionsListPage.js").then((e) => ({ default: e.CollectionsListPage }))), h = r(() => import("./pages/collections/CollectionDetailPage.js").then((e) => ({ default: e.CollectionDetailPage }))), g = r(() => import("./pages/collections/CollectionFormPage.js").then((e) => ({ default: e.CollectionFormPage }))), _ = r(() => import("./pages/items/StyleItemsListPage.js").then((e) => ({ default: e.StyleItemsListPage }))), v = r(() => import("./pages/items/StyleItemDetailPage.js").then((e) => ({ default: e.StyleItemDetailPage }))), y = r(() => import("./pages/items/StyleItemFormPage.js").then((e) => ({ default: e.StyleItemFormPage }))), b = r(() => import("./pages/looks/LooksListPage.js").then((e) => ({ default: e.LooksListPage }))), x = r(() => import("./pages/looks/LookDetailPage.js").then((e) => ({ default: e.LookDetailPage }))), S = r(() => import("./pages/looks/LookFormPage.js").then((e) => ({ default: e.LookFormPage }))), C = r(() => import("./pages/collaborations/CollaborationsListPage.js").then((e) => ({ default: e.CollaborationsListPage }))), w = r(() => import("./pages/collaborations/CollaborationDetailPage.js").then((e) => ({ default: e.CollaborationDetailPage }))), T = r(() => import("./pages/collaborations/CollaborationFormPage.js").then((e) => ({ default: e.CollaborationFormPage }))), E = r(() => import("./pages/wardrobe/WardrobeListPage.js").then((e) => ({ default: e.WardrobeListPage }))), D = r(() => import("./pages/wardrobe/WardrobeFormPage.js").then((e) => ({ default: e.WardrobeFormPage }))), O = r(() => import("./pages/lookbooks/LookbooksListPage.js").then((e) => ({ default: e.LookbooksListPage }))), k = r(() => import("./pages/lookbooks/LookbookDetailPage.js").then((e) => ({ default: e.LookbookDetailPage }))), A = r(() => import("./pages/profile/StyleProfilePage.js").then((e) => ({ default: e.StyleProfilePage }))), j = r(() => import("./pages/discover/DiscoverPage.js").then((e) => ({ default: e.DiscoverPage }))), M = r(() => import("./pages/trends/TrendsPage.js").then((e) => ({ default: e.TrendsPage }))), N = r(() => import("./pages/editorial/EditorialPage.js").then((e) => ({ default: e.EditorialPage }))), ee = r(() => import("./pages/marketplace/CreatorMarketplacePage.js").then((e) => ({ default: e.CreatorMarketplacePage }))), P = r(() => import("./pages/resale/ResaleBrowsePage.js").then((e) => ({ default: e.ResaleBrowsePage }))), F = r(() => import("./pages/resale/ResaleListingPage.js").then((e) => ({ default: e.ResaleListingPage }))), I = r(() => import("./pages/resale/ResaleSellerPage.js").then((e) => ({ default: e.ResaleSellerPage }))), L = r(() => import("./pages/resale/ResaleReportsPage.js").then((e) => ({ default: e.ResaleReportsPage }))), R = r(() => import("./pages/resale/ResaleModerationPage.js").then((e) => ({ default: e.ResaleModerationPage }))), z = r(() => import("./pages/commerce/CartPage.js").then((e) => ({ default: e.CartPage }))), B = r(() => import("./pages/commerce/BrandOrdersPage.js").then((e) => ({ default: e.BrandOrdersPage }))), V = r(() => import("./pages/commerce/BrandOrdersPage.js").then((e) => ({ default: e.BrandOrderDetailPage }))), H = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrdersPage }))), U = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrderDetailPage }))), W = r(() => import("./pages/commerce/CreatorEarningsPage.js").then((e) => ({ default: e.CreatorEarningsPage }))), G = r(() => import("./pages/admin/AdminBrandsPage.js").then((e) => ({ default: e.AdminBrandsPage }))), K = r(() => import("./pages/admin/AdminCollaborationsPage.js").then((e) => ({ default: e.AdminCollaborationsPage }))), q = r(() => import("./pages/admin/AdminFeaturedItemsPage.js").then((e) => ({ default: e.AdminFeaturedItemsPage }))), J = () => /* @__PURE__ */ c("div", {
|
|
8
8
|
className: "flex min-h-[400px] items-center justify-center",
|
|
9
9
|
children: /* @__PURE__ */ c("div", { className: "h-8 w-8 animate-spin rounded-full border-b-2 border-primary" })
|
|
10
10
|
}), Y = () => {
|
|
@@ -152,22 +152,26 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
|
|
|
152
152
|
}),
|
|
153
153
|
/* @__PURE__ */ c(a, {
|
|
154
154
|
path: "creator-marketplace",
|
|
155
|
-
element: /* @__PURE__ */ c(
|
|
155
|
+
element: /* @__PURE__ */ c(ee, {})
|
|
156
156
|
}),
|
|
157
157
|
/* @__PURE__ */ c(a, {
|
|
158
158
|
path: "resale",
|
|
159
|
-
element: /* @__PURE__ */ c(
|
|
159
|
+
element: /* @__PURE__ */ c(P, {})
|
|
160
160
|
}),
|
|
161
161
|
/* @__PURE__ */ c(a, {
|
|
162
162
|
path: "resale/listings/:listingId",
|
|
163
|
-
element: /* @__PURE__ */ c(
|
|
163
|
+
element: /* @__PURE__ */ c(F, {})
|
|
164
164
|
}),
|
|
165
165
|
/* @__PURE__ */ c(a, {
|
|
166
166
|
path: "resale/seller",
|
|
167
|
-
element: /* @__PURE__ */ c(
|
|
167
|
+
element: /* @__PURE__ */ c(I, {})
|
|
168
168
|
}),
|
|
169
169
|
/* @__PURE__ */ c(a, {
|
|
170
170
|
path: "resale/reports",
|
|
171
|
+
element: /* @__PURE__ */ c(L, {})
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ c(a, {
|
|
174
|
+
path: "resale/moderation",
|
|
171
175
|
element: /* @__PURE__ */ c(R, {})
|
|
172
176
|
}),
|
|
173
177
|
/* @__PURE__ */ c(a, {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CooResaleReviewShopsQuery, CooResaleReviewListingsQuery, CooResaleReviewReportsQuery } from '../../generated/wspace-operations';
|
|
2
|
+
export type ResaleReviewKind = 'shops' | 'listings' | 'reports';
|
|
3
|
+
export interface ResaleReviewIdentity {
|
|
4
|
+
id: string;
|
|
5
|
+
version: number;
|
|
6
|
+
}
|
|
7
|
+
type ReviewPhase = 'idle' | 'pending' | 'saved' | 'unconfirmed';
|
|
8
|
+
/** Nonsecret, scope-local intent metadata survives tab and error-view remounts. */
|
|
9
|
+
export declare function useResaleReviewIntent(kind: ResaleReviewKind, id: string, version: number): {
|
|
10
|
+
phase: ReviewPhase | undefined;
|
|
11
|
+
begin: () => boolean;
|
|
12
|
+
finish: (value: "saved" | "unconfirmed") => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function useResetResaleReviewIntents(kind: ResaleReviewKind): (identities: readonly ResaleReviewIdentity[]) => void;
|
|
15
|
+
export declare function useResaleModerationAccess(): {
|
|
16
|
+
loading: boolean;
|
|
17
|
+
allowed: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function useResaleReviewShops(page: number, active: boolean): import('@tanstack/react-query').UseQueryResult<CooResaleReviewShopsQuery, Error>;
|
|
20
|
+
export declare function useResaleReviewListings(page: number, active: boolean): import('@tanstack/react-query').UseQueryResult<CooResaleReviewListingsQuery, Error>;
|
|
21
|
+
export declare function useResaleReviewReports(page: number, active: boolean): import('@tanstack/react-query').UseQueryResult<CooResaleReviewReportsQuery, Error>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { CooResaleReviewListingsDocument as e, CooResaleReviewReportsDocument as t, CooResaleReviewShopsDocument as n } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { useResaleClient as r } from "./useResale.js";
|
|
3
|
+
import { skipToken as i, useQuery as a, useQueryClient as o } from "@tanstack/react-query";
|
|
4
|
+
import { useSafePermissions as s } from "@burdenoff/fe-libs/shared/providers/shell/PermissionProvider";
|
|
5
|
+
// src/coolandlovely/hooks/useResaleModeration.ts
|
|
6
|
+
function c(e, t, n) {
|
|
7
|
+
let s = o(), { key: c } = r(), l = [
|
|
8
|
+
...c,
|
|
9
|
+
"moderation-intent",
|
|
10
|
+
e,
|
|
11
|
+
t,
|
|
12
|
+
n
|
|
13
|
+
];
|
|
14
|
+
return {
|
|
15
|
+
phase: a({
|
|
16
|
+
queryKey: l,
|
|
17
|
+
queryFn: i,
|
|
18
|
+
initialData: "idle",
|
|
19
|
+
staleTime: Infinity,
|
|
20
|
+
gcTime: Infinity
|
|
21
|
+
}).data,
|
|
22
|
+
begin: () => s.getQueryData(l) !== "idle" || s.isFetching({ queryKey: [
|
|
23
|
+
...c,
|
|
24
|
+
"moderation",
|
|
25
|
+
e
|
|
26
|
+
] }) > 0 ? !1 : (s.setQueryData(l, "pending"), !0),
|
|
27
|
+
finish: (e) => {
|
|
28
|
+
s.setQueryData(l, e);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function l(e) {
|
|
33
|
+
let t = o(), { key: n } = r();
|
|
34
|
+
return (r) => {
|
|
35
|
+
for (let { id: i, version: a } of r) {
|
|
36
|
+
let r = [
|
|
37
|
+
...n,
|
|
38
|
+
"moderation-intent",
|
|
39
|
+
e,
|
|
40
|
+
i,
|
|
41
|
+
a
|
|
42
|
+
], o = t.getQueryData(r);
|
|
43
|
+
o !== void 0 && o !== "pending" && t.setQueryData(r, "idle");
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function u() {
|
|
48
|
+
let e = s();
|
|
49
|
+
return {
|
|
50
|
+
loading: e?.isLoading ?? !1,
|
|
51
|
+
allowed: e?.isSuperAdmin === !0
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function d(e, t, n, i) {
|
|
55
|
+
let { request: o, ready: s, key: c } = r(), { allowed: l } = u();
|
|
56
|
+
return a({
|
|
57
|
+
queryKey: [
|
|
58
|
+
...c,
|
|
59
|
+
"moderation",
|
|
60
|
+
t,
|
|
61
|
+
n
|
|
62
|
+
],
|
|
63
|
+
enabled: s && l && i,
|
|
64
|
+
queryFn: ({ signal: t }) => o(e, { pagination: {
|
|
65
|
+
limit: 20,
|
|
66
|
+
offset: n * 20
|
|
67
|
+
} }, t)
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function f(e, t) {
|
|
71
|
+
return d(n, "shops", e, t);
|
|
72
|
+
}
|
|
73
|
+
function p(t, n) {
|
|
74
|
+
return d(e, "listings", t, n);
|
|
75
|
+
}
|
|
76
|
+
function m(e, n) {
|
|
77
|
+
return d(t, "reports", e, n);
|
|
78
|
+
}
|
|
79
|
+
export { u as useResaleModerationAccess, c as useResaleReviewIntent, p as useResaleReviewListings, m as useResaleReviewReports, f as useResaleReviewShops, l as useResetResaleReviewIntents };
|
|
@@ -3,140 +3,148 @@ import { ErrorView as t, LoadingView as n } from "../../components/StateViews.js
|
|
|
3
3
|
import { useContextNavigation as r } from "../../hooks/useContextNavigation.js";
|
|
4
4
|
import { refreshResaleRead as i, useResaleBrowse as a } from "../../hooks/useResale.js";
|
|
5
5
|
import { useTr as o } from "../../hooks/useTr.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { useResaleModerationAccess as s } from "../../hooks/useResaleModeration.js";
|
|
7
|
+
import { RESALE_CATEGORIES as c, RESALE_CONDITIONS as l, formatResalePrice as u } from "../../utils/resalePresentation.js";
|
|
8
|
+
import { titleCase as d } from "../../utils/formatters.js";
|
|
9
|
+
import { useState as f } from "react";
|
|
10
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
|
+
import { Button as h, GlassCard as g, Pagination as _ } from "@burdenoff/fe-libs/ui";
|
|
11
12
|
// src/coolandlovely/pages/resale/ResaleBrowsePage.tsx
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
let
|
|
13
|
+
var v = "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-text-primary";
|
|
14
|
+
function y() {
|
|
15
|
+
let y = o(), b = r(), { allowed: x } = s(), [S, C] = f(""), [w, T] = f(""), [E, D] = f(""), [O, k] = f({
|
|
15
16
|
search: "",
|
|
16
17
|
category: "",
|
|
17
18
|
condition: ""
|
|
18
|
-
}), [
|
|
19
|
-
search:
|
|
20
|
-
category:
|
|
21
|
-
condition:
|
|
19
|
+
}), [A, j] = f(0), M = a({
|
|
20
|
+
search: O.search || void 0,
|
|
21
|
+
category: O.category || void 0,
|
|
22
|
+
condition: O.condition || void 0,
|
|
22
23
|
pagination: {
|
|
23
24
|
limit: 20,
|
|
24
|
-
offset:
|
|
25
|
+
offset: A * 20
|
|
25
26
|
}
|
|
26
|
-
}),
|
|
27
|
-
e.preventDefault(),
|
|
28
|
-
search:
|
|
29
|
-
category:
|
|
30
|
-
condition:
|
|
31
|
-
}),
|
|
32
|
-
},
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
title:
|
|
35
|
-
description:
|
|
36
|
-
actions: /* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
}), N = (e) => {
|
|
28
|
+
e.preventDefault(), k({
|
|
29
|
+
search: S.trim(),
|
|
30
|
+
category: w,
|
|
31
|
+
condition: E
|
|
32
|
+
}), j(0);
|
|
33
|
+
}, P = M.data?.cooResaleListings.items ?? [];
|
|
34
|
+
return /* @__PURE__ */ p(e, {
|
|
35
|
+
title: y("coolandlovely.resale.title", "Pre-loved marketplace"),
|
|
36
|
+
description: y("coolandlovely.resale.description", "Browse reviewed listings from approved seller shops."),
|
|
37
|
+
actions: /* @__PURE__ */ m("div", {
|
|
38
|
+
className: "flex flex-wrap gap-2",
|
|
39
|
+
children: [/* @__PURE__ */ p(h, {
|
|
40
|
+
variant: "outline",
|
|
41
|
+
onClick: () => b("resale/seller"),
|
|
42
|
+
children: y("coolandlovely.resale.myShop", "My resale shop")
|
|
43
|
+
}), x && /* @__PURE__ */ p(h, {
|
|
44
|
+
variant: "outline",
|
|
45
|
+
onClick: () => b("resale/moderation"),
|
|
46
|
+
children: y("coolandlovely.resale.moderation", "Resale moderation")
|
|
47
|
+
})]
|
|
40
48
|
}),
|
|
41
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ m("div", {
|
|
42
50
|
className: "space-y-6",
|
|
43
51
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
onSubmit:
|
|
52
|
+
/* @__PURE__ */ m("form", {
|
|
53
|
+
onSubmit: N,
|
|
46
54
|
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
47
55
|
"aria-label": "Filter resale listings",
|
|
48
56
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ m("label", {
|
|
50
58
|
className: "grid gap-1 text-sm text-text-secondary",
|
|
51
|
-
children: [
|
|
52
|
-
value:
|
|
53
|
-
onChange: (e) =>
|
|
59
|
+
children: [y("coolandlovely.resale.search", "Search listings"), /* @__PURE__ */ p("input", {
|
|
60
|
+
value: S,
|
|
61
|
+
onChange: (e) => C(e.target.value),
|
|
54
62
|
maxLength: 160,
|
|
55
|
-
className:
|
|
63
|
+
className: v
|
|
56
64
|
})]
|
|
57
65
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ m("label", {
|
|
59
67
|
className: "grid gap-1 text-sm text-text-secondary",
|
|
60
|
-
children: [
|
|
61
|
-
value:
|
|
62
|
-
onChange: (e) =>
|
|
63
|
-
className:
|
|
64
|
-
children: [/* @__PURE__ */
|
|
68
|
+
children: [y("coolandlovely.resale.category", "Category"), /* @__PURE__ */ m("select", {
|
|
69
|
+
value: w,
|
|
70
|
+
onChange: (e) => T(e.target.value),
|
|
71
|
+
className: v,
|
|
72
|
+
children: [/* @__PURE__ */ p("option", {
|
|
65
73
|
value: "",
|
|
66
|
-
children:
|
|
67
|
-
}),
|
|
74
|
+
children: y("coolandlovely.resale.allCategories", "All categories")
|
|
75
|
+
}), c.map((e) => /* @__PURE__ */ p("option", {
|
|
68
76
|
value: e,
|
|
69
|
-
children:
|
|
77
|
+
children: d(e)
|
|
70
78
|
}, e))]
|
|
71
79
|
})]
|
|
72
80
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ m("label", {
|
|
74
82
|
className: "grid gap-1 text-sm text-text-secondary",
|
|
75
|
-
children: [
|
|
76
|
-
value:
|
|
77
|
-
onChange: (e) =>
|
|
78
|
-
className:
|
|
79
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [y("coolandlovely.resale.condition", "Condition"), /* @__PURE__ */ m("select", {
|
|
84
|
+
value: E,
|
|
85
|
+
onChange: (e) => D(e.target.value),
|
|
86
|
+
className: v,
|
|
87
|
+
children: [/* @__PURE__ */ p("option", {
|
|
80
88
|
value: "",
|
|
81
|
-
children:
|
|
82
|
-
}),
|
|
89
|
+
children: y("coolandlovely.resale.allConditions", "All conditions")
|
|
90
|
+
}), l.map((e) => /* @__PURE__ */ p("option", {
|
|
83
91
|
value: e,
|
|
84
|
-
children:
|
|
92
|
+
children: d(e)
|
|
85
93
|
}, e))]
|
|
86
94
|
})]
|
|
87
95
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ p("div", {
|
|
89
97
|
className: "flex items-end",
|
|
90
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ p(h, {
|
|
91
99
|
type: "submit",
|
|
92
|
-
children:
|
|
100
|
+
children: y("coolandlovely.resale.applyFilters", "Apply filters")
|
|
93
101
|
})
|
|
94
102
|
})
|
|
95
103
|
]
|
|
96
104
|
}),
|
|
97
|
-
|
|
98
|
-
message:
|
|
99
|
-
onRetry: () => i(
|
|
100
|
-
}) :
|
|
105
|
+
M.isPending ? /* @__PURE__ */ p(n, {}) : M.isError ? /* @__PURE__ */ p(t, {
|
|
106
|
+
message: y("coolandlovely.resale.loadError", "Listings could not be loaded. Your filters are preserved."),
|
|
107
|
+
onRetry: () => i(M.refetch)
|
|
108
|
+
}) : P.length === 0 ? /* @__PURE__ */ p("p", {
|
|
101
109
|
role: "status",
|
|
102
110
|
className: "rounded-xl border border-border-seam p-6 text-text-secondary",
|
|
103
|
-
children:
|
|
104
|
-
}) : /* @__PURE__ */
|
|
111
|
+
children: y("coolandlovely.resale.empty", "No reviewed listings match these filters.")
|
|
112
|
+
}) : /* @__PURE__ */ p("ul", {
|
|
105
113
|
className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-3",
|
|
106
114
|
"aria-label": "Resale listings",
|
|
107
|
-
children:
|
|
115
|
+
children: P.map((e) => /* @__PURE__ */ p("li", {
|
|
108
116
|
className: "min-w-0",
|
|
109
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ p(g, {
|
|
110
118
|
className: "h-full overflow-hidden p-0",
|
|
111
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ m("button", {
|
|
112
120
|
type: "button",
|
|
113
121
|
className: "flex h-full w-full flex-col text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary",
|
|
114
|
-
onClick: () =>
|
|
115
|
-
children: [e.photoUrls[0] && /* @__PURE__ */
|
|
122
|
+
onClick: () => b(`resale/listings/${e.id}`),
|
|
123
|
+
children: [e.photoUrls[0] && /* @__PURE__ */ p("img", {
|
|
116
124
|
src: e.photoUrls[0],
|
|
117
125
|
alt: e.title,
|
|
118
126
|
loading: "lazy",
|
|
119
127
|
className: "aspect-square w-full object-cover"
|
|
120
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ m("div", {
|
|
121
129
|
className: "grid w-full gap-2 p-4",
|
|
122
130
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ p("h2", {
|
|
124
132
|
className: "break-words text-lg font-semibold text-text-primary",
|
|
125
133
|
children: e.title
|
|
126
134
|
}),
|
|
127
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ p("p", {
|
|
128
136
|
className: "font-semibold text-text-primary",
|
|
129
|
-
children:
|
|
137
|
+
children: u(e.priceMinor, e.currency)
|
|
130
138
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ m("p", {
|
|
132
140
|
className: "text-sm text-text-secondary",
|
|
133
141
|
children: [
|
|
134
|
-
|
|
142
|
+
d(e.condition),
|
|
135
143
|
" · ",
|
|
136
144
|
e.size
|
|
137
145
|
]
|
|
138
146
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ p("p", {
|
|
140
148
|
className: "break-words text-sm text-text-secondary",
|
|
141
149
|
children: e.shop.name
|
|
142
150
|
})
|
|
@@ -146,16 +154,16 @@ function v() {
|
|
|
146
154
|
})
|
|
147
155
|
}, e.id))
|
|
148
156
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
page:
|
|
157
|
+
/* @__PURE__ */ p(_, {
|
|
158
|
+
page: A + 1,
|
|
151
159
|
pageSize: 20,
|
|
152
|
-
hasNextPage:
|
|
153
|
-
hasPreviousPage:
|
|
154
|
-
loading:
|
|
155
|
-
onPageChange: (e) =>
|
|
160
|
+
hasNextPage: M.data?.cooResaleListings.pageInfo.hasMore ?? !1,
|
|
161
|
+
hasPreviousPage: A > 0,
|
|
162
|
+
loading: M.isFetching,
|
|
163
|
+
onPageChange: (e) => j(e - 1)
|
|
156
164
|
})
|
|
157
165
|
]
|
|
158
166
|
})
|
|
159
167
|
});
|
|
160
168
|
}
|
|
161
|
-
export {
|
|
169
|
+
export { y as ResaleBrowsePage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ResaleModerationPage(): import('react').JSX.Element;
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import { CooResaleResolveReportDocument as e, CooResaleReviewListingDocument as t, CooResaleReviewShopDocument as n } from "../../../generated/wspace-operations.js";
|
|
2
|
+
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
3
|
+
import { ErrorView as i, LoadingView as a } from "../../components/StateViews.js";
|
|
4
|
+
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
5
|
+
import { useContextNavigation as s } from "../../hooks/useContextNavigation.js";
|
|
6
|
+
import { refreshResaleRead as c, useResaleMutation as l } from "../../hooks/useResale.js";
|
|
7
|
+
import { useResaleModerationAccess as u, useResaleReviewIntent as d, useResaleReviewListings as f, useResaleReviewReports as p, useResaleReviewShops as m, useResetResaleReviewIntents as h } from "../../hooks/useResaleModeration.js";
|
|
8
|
+
import { useTr as g } from "../../hooks/useTr.js";
|
|
9
|
+
import { titleCase as _ } from "../../utils/formatters.js";
|
|
10
|
+
import { formatResalePrice as v } from "../../utils/resalePresentation.js";
|
|
11
|
+
import { useRef as y, useState as b } from "react";
|
|
12
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
13
|
+
import { useIsMutating as C, useQueryClient as w } from "@tanstack/react-query";
|
|
14
|
+
import { Button as T, GlassCard as E, Pagination as D } from "@burdenoff/fe-libs/ui";
|
|
15
|
+
// src/coolandlovely/pages/resale/ResaleModerationPage.tsx
|
|
16
|
+
var O = "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-text-primary";
|
|
17
|
+
function k({ label: e, approveLabel: t, rejectLabel: n, help: r, decide: i, kind: a, id: o, version: s }) {
|
|
18
|
+
let c = g(), [l, u] = b(""), [f, p] = b(""), { phase: m, begin: h, finish: _ } = d(a, o, s), [v, C] = b(""), w = y(!1), E = async (e) => {
|
|
19
|
+
if (e.preventDefault(), !(m !== "idle" || w.current)) {
|
|
20
|
+
if (!["approve", "reject"].includes(l) || !f.trim()) C(c("coolandlovely.resale.reviewRequired", "Choose a decision and enter review notes."));
|
|
21
|
+
else if (C(""), h()) {
|
|
22
|
+
w.current = !0;
|
|
23
|
+
try {
|
|
24
|
+
await i(l === "approve", f.trim()), _("saved");
|
|
25
|
+
} catch {
|
|
26
|
+
_("unconfirmed");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ S("form", {
|
|
32
|
+
"aria-label": e,
|
|
33
|
+
onSubmit: (e) => void E(e),
|
|
34
|
+
className: "space-y-3",
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ S("fieldset", {
|
|
37
|
+
disabled: m !== "idle",
|
|
38
|
+
className: "min-w-0 space-y-3",
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ x("legend", {
|
|
41
|
+
className: "font-medium text-text-primary",
|
|
42
|
+
children: e
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ x("p", {
|
|
45
|
+
className: "text-sm text-text-secondary",
|
|
46
|
+
children: r
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ S("label", {
|
|
49
|
+
className: "grid gap-1 text-sm text-text-secondary",
|
|
50
|
+
children: [c("coolandlovely.resale.reviewDecision", "Decision"), /* @__PURE__ */ S("select", {
|
|
51
|
+
required: !0,
|
|
52
|
+
value: l,
|
|
53
|
+
onChange: (e) => u(e.target.value),
|
|
54
|
+
className: O,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ x("option", {
|
|
57
|
+
value: "",
|
|
58
|
+
children: c("coolandlovely.resale.chooseDecision", "Choose a decision")
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ x("option", {
|
|
61
|
+
value: "approve",
|
|
62
|
+
children: t
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ x("option", {
|
|
65
|
+
value: "reject",
|
|
66
|
+
children: n
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
})]
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ S("label", {
|
|
72
|
+
className: "grid gap-1 text-sm text-text-secondary",
|
|
73
|
+
children: [c("coolandlovely.resale.reviewNotes", "Review notes"), /* @__PURE__ */ x("textarea", {
|
|
74
|
+
required: !0,
|
|
75
|
+
maxLength: 2e3,
|
|
76
|
+
value: f,
|
|
77
|
+
onChange: (e) => p(e.target.value),
|
|
78
|
+
className: `${O} min-h-24`
|
|
79
|
+
})]
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ x(T, {
|
|
82
|
+
type: "submit",
|
|
83
|
+
children: c("coolandlovely.resale.saveDecision", "Save decision")
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
}),
|
|
87
|
+
v && /* @__PURE__ */ x("p", {
|
|
88
|
+
role: "alert",
|
|
89
|
+
className: "text-status-error-text",
|
|
90
|
+
children: v
|
|
91
|
+
}),
|
|
92
|
+
m === "pending" && /* @__PURE__ */ x("p", {
|
|
93
|
+
role: "status",
|
|
94
|
+
children: c("coolandlovely.resale.savingDecision", "Saving decision…")
|
|
95
|
+
}),
|
|
96
|
+
m === "saved" && /* @__PURE__ */ x("p", {
|
|
97
|
+
role: "status",
|
|
98
|
+
children: c("coolandlovely.resale.decisionSaved", "Decision saved. Refreshing the queue.")
|
|
99
|
+
}),
|
|
100
|
+
m === "unconfirmed" && /* @__PURE__ */ x("p", {
|
|
101
|
+
role: "alert",
|
|
102
|
+
className: "text-status-error-text",
|
|
103
|
+
children: c("coolandlovely.resale.reviewUnconfirmed", "The decision could not be confirmed. Refresh this queue and inspect its current state before another review.")
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function A({ shop: e }) {
|
|
109
|
+
let t = g(), r = l(n);
|
|
110
|
+
return /* @__PURE__ */ S(E, {
|
|
111
|
+
className: "min-w-0 space-y-4 p-4",
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ S("h2", {
|
|
114
|
+
className: "break-words text-lg font-semibold text-text-primary",
|
|
115
|
+
children: [
|
|
116
|
+
e.name,
|
|
117
|
+
" · @",
|
|
118
|
+
e.handle
|
|
119
|
+
]
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ x(o, { status: e.reviewStatus }),
|
|
122
|
+
/* @__PURE__ */ x("p", {
|
|
123
|
+
className: "whitespace-pre-wrap break-words text-text-secondary",
|
|
124
|
+
children: e.description
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ S("p", {
|
|
127
|
+
className: "text-sm text-text-secondary",
|
|
128
|
+
children: [
|
|
129
|
+
t("coolandlovely.resale.acceptedPolicy", "Accepted policy"),
|
|
130
|
+
" · ",
|
|
131
|
+
e.policyVersion ?? "—"
|
|
132
|
+
]
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ x(k, {
|
|
135
|
+
kind: "shops",
|
|
136
|
+
id: e.id,
|
|
137
|
+
version: e.version,
|
|
138
|
+
label: t("coolandlovely.resale.reviewShop", "Review shop"),
|
|
139
|
+
approveLabel: t("coolandlovely.resale.approveShop", "Approve shop"),
|
|
140
|
+
rejectLabel: t("coolandlovely.resale.rejectShop", "Reject shop"),
|
|
141
|
+
help: t("coolandlovely.resale.shopApprovalHelp", "Approval applies only to this shop revision. Listings still require their own review before the seller can publish them."),
|
|
142
|
+
decide: async (t, n) => {
|
|
143
|
+
if ((await r.mutateAsync({
|
|
144
|
+
id: e.id,
|
|
145
|
+
version: e.version,
|
|
146
|
+
approved: t,
|
|
147
|
+
notes: n
|
|
148
|
+
})).cooReviewResaleShop !== !0) throw Error("Review was not acknowledged.");
|
|
149
|
+
}
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function j({ item: e }) {
|
|
155
|
+
let n = g(), { listing: r, shop: i } = e, a = l(t);
|
|
156
|
+
return /* @__PURE__ */ S(E, {
|
|
157
|
+
className: "min-w-0 space-y-4 p-4",
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ x("h2", {
|
|
160
|
+
className: "break-words text-lg font-semibold text-text-primary",
|
|
161
|
+
children: r.title
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ S("p", {
|
|
164
|
+
className: "text-text-secondary",
|
|
165
|
+
children: [
|
|
166
|
+
i.name,
|
|
167
|
+
" · @",
|
|
168
|
+
i.handle
|
|
169
|
+
]
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ S("div", {
|
|
172
|
+
className: "flex flex-wrap gap-2",
|
|
173
|
+
children: [/* @__PURE__ */ x(o, { status: r.status }), /* @__PURE__ */ x(o, { status: i.reviewStatus })]
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ x("p", {
|
|
176
|
+
className: "whitespace-pre-wrap break-words text-text-secondary",
|
|
177
|
+
children: r.description
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ S("p", {
|
|
180
|
+
className: "text-text-secondary",
|
|
181
|
+
children: [
|
|
182
|
+
_(r.category),
|
|
183
|
+
" · ",
|
|
184
|
+
_(r.condition),
|
|
185
|
+
" · ",
|
|
186
|
+
r.size
|
|
187
|
+
]
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ x("p", {
|
|
190
|
+
className: "font-medium text-text-primary",
|
|
191
|
+
children: v(r.priceMinor, r.currency)
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ x("div", {
|
|
194
|
+
className: "grid grid-cols-2 gap-3 sm:grid-cols-3",
|
|
195
|
+
children: Array.from(new Set(r.photoUrls)).map((e, t) => /* @__PURE__ */ x("img", {
|
|
196
|
+
src: e,
|
|
197
|
+
alt: `${r.title}, ${t + 1}`,
|
|
198
|
+
loading: "lazy",
|
|
199
|
+
referrerPolicy: "no-referrer",
|
|
200
|
+
width: 240,
|
|
201
|
+
height: 240,
|
|
202
|
+
className: "aspect-square w-full rounded-lg border border-border-seam object-cover"
|
|
203
|
+
}, e))
|
|
204
|
+
}),
|
|
205
|
+
/* @__PURE__ */ x(k, {
|
|
206
|
+
kind: "listings",
|
|
207
|
+
id: r.id,
|
|
208
|
+
version: r.version,
|
|
209
|
+
label: n("coolandlovely.resale.reviewListing", "Review listing"),
|
|
210
|
+
approveLabel: n("coolandlovely.resale.approveListing", "Approve listing"),
|
|
211
|
+
rejectLabel: n("coolandlovely.resale.rejectListing", "Reject listing"),
|
|
212
|
+
help: n("coolandlovely.resale.listingApprovalHelp", "This decision reviews the displayed revision. Approval returns the item to the seller as a draft; it does not publish it or approve the shop."),
|
|
213
|
+
decide: async (e, t) => {
|
|
214
|
+
if ((await a.mutateAsync({
|
|
215
|
+
id: r.id,
|
|
216
|
+
version: r.version,
|
|
217
|
+
approved: e,
|
|
218
|
+
notes: t
|
|
219
|
+
})).cooReviewResaleListing !== !0) throw Error("Review was not acknowledged.");
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
]
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function M(e, t) {
|
|
226
|
+
if (typeof e == "object" && e && !Array.isArray(e) && Object.hasOwn(e, t)) {
|
|
227
|
+
if (t === "title" && "title" in e && typeof e.title == "string") return e.title;
|
|
228
|
+
if (t === "description" && "description" in e && typeof e.description == "string") return e.description;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
function N({ report: t }) {
|
|
232
|
+
let n = g(), r = l(e);
|
|
233
|
+
return /* @__PURE__ */ S(E, {
|
|
234
|
+
className: "min-w-0 space-y-4 p-4",
|
|
235
|
+
children: [
|
|
236
|
+
/* @__PURE__ */ x("h2", {
|
|
237
|
+
className: "break-words text-lg font-semibold text-text-primary",
|
|
238
|
+
children: M(t.snapshot, "title") ?? n("coolandlovely.resale.reportedListing", "Reported listing")
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ x(o, { status: t.status }),
|
|
241
|
+
/* @__PURE__ */ x("p", {
|
|
242
|
+
className: "text-text-secondary",
|
|
243
|
+
children: _(t.reason)
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ x("p", {
|
|
246
|
+
className: "whitespace-pre-wrap break-words text-text-secondary",
|
|
247
|
+
children: t.details
|
|
248
|
+
}),
|
|
249
|
+
/* @__PURE__ */ x("blockquote", {
|
|
250
|
+
className: "whitespace-pre-wrap break-words border-l-2 border-border-seam pl-3 text-text-secondary",
|
|
251
|
+
children: M(t.snapshot, "description")
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ x("p", {
|
|
254
|
+
className: "text-sm text-text-secondary",
|
|
255
|
+
children: n("coolandlovely.resale.reportSnapshotHelp", "The title and description above are the buyer-visible snapshot reported at this revision. Removal is refused if the listing has changed.")
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ x(k, {
|
|
258
|
+
kind: "reports",
|
|
259
|
+
id: t.id,
|
|
260
|
+
version: t.listingVersion,
|
|
261
|
+
label: n("coolandlovely.resale.resolveReport", "Resolve report"),
|
|
262
|
+
approveLabel: n("coolandlovely.resale.upholdReport", "Uphold report and remove listing"),
|
|
263
|
+
rejectLabel: n("coolandlovely.resale.dismissReport", "Dismiss report without removing listing"),
|
|
264
|
+
help: n("coolandlovely.resale.reportDecisionHelp", "Upholding archives the exact reported public revision and withdraws its availability. The report and moderation history remain available for audit. Review notes are private to operators."),
|
|
265
|
+
decide: async (e, n) => {
|
|
266
|
+
if ((await r.mutateAsync({
|
|
267
|
+
id: t.id,
|
|
268
|
+
removeListing: e,
|
|
269
|
+
notes: n
|
|
270
|
+
})).cooResolveResaleReport !== !0) throw Error("Review was not acknowledged.");
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
]
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
function P({ query: e, hasItems: t, hasMore: n, page: r, onPageChange: o, children: s, kind: c, refetchIdentities: l }) {
|
|
277
|
+
let u = g(), [d, f] = b(0), p = h(c), m = w(), _ = C(), v = async () => {
|
|
278
|
+
if (!(m.isMutating() > 0)) try {
|
|
279
|
+
let e = await l();
|
|
280
|
+
p(e), f((e) => e + 1);
|
|
281
|
+
} catch {}
|
|
282
|
+
}, y;
|
|
283
|
+
return y = e.isPending ? /* @__PURE__ */ x(a, {}) : e.isError ? /* @__PURE__ */ x(i, { onRetry: () => void v() }) : t ? /* @__PURE__ */ S("fieldset", {
|
|
284
|
+
disabled: e.isFetching,
|
|
285
|
+
className: "min-w-0",
|
|
286
|
+
children: [/* @__PURE__ */ x("legend", {
|
|
287
|
+
className: "sr-only",
|
|
288
|
+
children: u("coolandlovely.resale.pendingReviews", "Pending resale reviews")
|
|
289
|
+
}), /* @__PURE__ */ x("ul", {
|
|
290
|
+
"aria-label": "Pending resale reviews",
|
|
291
|
+
className: "space-y-4",
|
|
292
|
+
children: s
|
|
293
|
+
}, d)]
|
|
294
|
+
}) : /* @__PURE__ */ x("p", {
|
|
295
|
+
role: "status",
|
|
296
|
+
className: "text-text-secondary",
|
|
297
|
+
children: u("coolandlovely.resale.noPendingReviews", "No pending items in this queue and workspace.")
|
|
298
|
+
}), /* @__PURE__ */ S("div", {
|
|
299
|
+
className: "space-y-4",
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ x(T, {
|
|
302
|
+
variant: "outline",
|
|
303
|
+
onClick: () => void v(),
|
|
304
|
+
disabled: e.isFetching || _ > 0,
|
|
305
|
+
children: u("coolandlovely.resale.refreshReviewQueue", "Refresh review queue")
|
|
306
|
+
}),
|
|
307
|
+
y,
|
|
308
|
+
/* @__PURE__ */ x(D, {
|
|
309
|
+
page: r + 1,
|
|
310
|
+
pageSize: 20,
|
|
311
|
+
hasNextPage: n,
|
|
312
|
+
hasPreviousPage: r > 0,
|
|
313
|
+
loading: e.isFetching,
|
|
314
|
+
onPageChange: (e) => o(e - 1)
|
|
315
|
+
})
|
|
316
|
+
]
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
function F(e) {
|
|
320
|
+
let t = m(e.page, !0), n = t.data?.cooResaleShopReviewQueue, r = async () => (await c(() => t.refetch({ throwOnError: !0 }))).data?.cooResaleShopReviewQueue.items.map(({ id: e, version: t }) => ({
|
|
321
|
+
id: e,
|
|
322
|
+
version: t
|
|
323
|
+
})) ?? [];
|
|
324
|
+
return /* @__PURE__ */ x(P, {
|
|
325
|
+
...e,
|
|
326
|
+
kind: "shops",
|
|
327
|
+
refetchIdentities: r,
|
|
328
|
+
query: t,
|
|
329
|
+
hasItems: !!n?.items.length,
|
|
330
|
+
hasMore: n?.pageInfo.hasMore ?? !1,
|
|
331
|
+
children: n?.items.map((e) => /* @__PURE__ */ x("li", {
|
|
332
|
+
"data-resale-review-id": e.id,
|
|
333
|
+
children: /* @__PURE__ */ x(A, { shop: e })
|
|
334
|
+
}, `${e.id}:${e.version}`))
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
function I(e) {
|
|
338
|
+
let t = f(e.page, !0), n = t.data?.cooResaleListingReviewQueue, r = async () => (await c(() => t.refetch({ throwOnError: !0 }))).data?.cooResaleListingReviewQueue.items.map(({ listing: e }) => ({
|
|
339
|
+
id: e.id,
|
|
340
|
+
version: e.version
|
|
341
|
+
})) ?? [];
|
|
342
|
+
return /* @__PURE__ */ x(P, {
|
|
343
|
+
...e,
|
|
344
|
+
kind: "listings",
|
|
345
|
+
refetchIdentities: r,
|
|
346
|
+
query: t,
|
|
347
|
+
hasItems: !!n?.items.length,
|
|
348
|
+
hasMore: n?.pageInfo.hasMore ?? !1,
|
|
349
|
+
children: n?.items.map((e) => /* @__PURE__ */ x("li", {
|
|
350
|
+
"data-resale-review-id": e.listing.id,
|
|
351
|
+
children: /* @__PURE__ */ x(j, { item: e })
|
|
352
|
+
}, `${e.listing.id}:${e.listing.version}`))
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
function L(e) {
|
|
356
|
+
let t = p(e.page, !0), n = t.data?.cooResaleReportQueue, r = async () => (await c(() => t.refetch({ throwOnError: !0 }))).data?.cooResaleReportQueue.items.map(({ id: e, listingVersion: t }) => ({
|
|
357
|
+
id: e,
|
|
358
|
+
version: t
|
|
359
|
+
})) ?? [];
|
|
360
|
+
return /* @__PURE__ */ x(P, {
|
|
361
|
+
...e,
|
|
362
|
+
kind: "reports",
|
|
363
|
+
refetchIdentities: r,
|
|
364
|
+
query: t,
|
|
365
|
+
hasItems: !!n?.items.length,
|
|
366
|
+
hasMore: n?.pageInfo.hasMore ?? !1,
|
|
367
|
+
children: n?.items.map((e) => /* @__PURE__ */ x("li", {
|
|
368
|
+
"data-resale-review-id": e.id,
|
|
369
|
+
children: /* @__PURE__ */ x(N, { report: e })
|
|
370
|
+
}, e.id))
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
var R = {
|
|
374
|
+
shops: F,
|
|
375
|
+
listings: I,
|
|
376
|
+
reports: L
|
|
377
|
+
}, z = {
|
|
378
|
+
shops: "Shops",
|
|
379
|
+
listings: "Listings",
|
|
380
|
+
reports: "Reports"
|
|
381
|
+
};
|
|
382
|
+
function B() {
|
|
383
|
+
let e = g(), [t, n] = b("shops"), [r, i] = b(0), a = R[t];
|
|
384
|
+
return /* @__PURE__ */ S("div", {
|
|
385
|
+
className: "space-y-4",
|
|
386
|
+
children: [/* @__PURE__ */ x("div", {
|
|
387
|
+
role: "group",
|
|
388
|
+
"aria-label": "Resale moderation queues",
|
|
389
|
+
className: "flex flex-wrap gap-2",
|
|
390
|
+
children: [
|
|
391
|
+
"shops",
|
|
392
|
+
"listings",
|
|
393
|
+
"reports"
|
|
394
|
+
].map((r) => /* @__PURE__ */ x(T, {
|
|
395
|
+
variant: t === r ? "default" : "outline",
|
|
396
|
+
"aria-pressed": t === r,
|
|
397
|
+
onClick: () => {
|
|
398
|
+
n(r), i(0);
|
|
399
|
+
},
|
|
400
|
+
children: e(`coolandlovely.resale.reviewQueue.${r}`, z[r])
|
|
401
|
+
}, r))
|
|
402
|
+
}), /* @__PURE__ */ x(a, {
|
|
403
|
+
page: r,
|
|
404
|
+
onPageChange: i
|
|
405
|
+
}, t)]
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
function V() {
|
|
409
|
+
let e = g(), t = s(), { allowed: n, loading: i } = u();
|
|
410
|
+
return /* @__PURE__ */ x(r, {
|
|
411
|
+
title: e("coolandlovely.resale.moderation", "Resale moderation"),
|
|
412
|
+
description: e("coolandlovely.resale.moderationDescription", "Review seller shops, listing revisions and buyer reports in the selected workspace."),
|
|
413
|
+
actions: /* @__PURE__ */ x(T, {
|
|
414
|
+
variant: "outline",
|
|
415
|
+
onClick: () => t("resale"),
|
|
416
|
+
children: e("coolandlovely.resale.back", "Back to marketplace")
|
|
417
|
+
}),
|
|
418
|
+
children: i && !n ? /* @__PURE__ */ x(a, {}) : n ? /* @__PURE__ */ x(B, {}) : /* @__PURE__ */ x("p", {
|
|
419
|
+
role: "alert",
|
|
420
|
+
className: "text-text-secondary",
|
|
421
|
+
children: e("coolandlovely.resale.operatorRequired", "A signed-in platform operator is required to review resale items.")
|
|
422
|
+
})
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
export { V as ResaleModerationPage };
|
|
@@ -387,8 +387,7 @@ var k = e`
|
|
|
387
387
|
status
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
|
|
391
|
-
e`
|
|
390
|
+
`, P = e`
|
|
392
391
|
query CooResaleReviewShops($pagination: PaginationInput) {
|
|
393
392
|
cooResaleShopReviewQueue(pagination: $pagination) {
|
|
394
393
|
items {
|
|
@@ -400,7 +399,7 @@ e`
|
|
|
400
399
|
}
|
|
401
400
|
}
|
|
402
401
|
}
|
|
403
|
-
${r}`, e`
|
|
402
|
+
${r}`, F = e`
|
|
404
403
|
query CooResaleReviewListings($pagination: PaginationInput) {
|
|
405
404
|
cooResaleListingReviewQueue(pagination: $pagination) {
|
|
406
405
|
items {
|
|
@@ -418,7 +417,7 @@ e`
|
|
|
418
417
|
}
|
|
419
418
|
}
|
|
420
419
|
${i}
|
|
421
|
-
${r}`, e`
|
|
420
|
+
${r}`, I = e`
|
|
422
421
|
query CooResaleReviewReports($pagination: PaginationInput) {
|
|
423
422
|
cooResaleReportQueue(pagination: $pagination) {
|
|
424
423
|
items {
|
|
@@ -437,7 +436,7 @@ ${r}`, e`
|
|
|
437
436
|
}
|
|
438
437
|
}
|
|
439
438
|
}
|
|
440
|
-
`, e`
|
|
439
|
+
`, L = e`
|
|
441
440
|
mutation CooResaleReviewShop($id: ID!, $version: Int!, $approved: Boolean!, $notes: String!) {
|
|
442
441
|
cooReviewResaleShop(
|
|
443
442
|
id: $id
|
|
@@ -446,7 +445,7 @@ ${r}`, e`
|
|
|
446
445
|
notes: $notes
|
|
447
446
|
)
|
|
448
447
|
}
|
|
449
|
-
`, e`
|
|
448
|
+
`, R = e`
|
|
450
449
|
mutation CooResaleReviewListing($id: ID!, $version: Int!, $approved: Boolean!, $notes: String!) {
|
|
451
450
|
cooReviewResaleListing(
|
|
452
451
|
id: $id
|
|
@@ -455,18 +454,19 @@ ${r}`, e`
|
|
|
455
454
|
notes: $notes
|
|
456
455
|
)
|
|
457
456
|
}
|
|
458
|
-
`, e`
|
|
457
|
+
`, z = e`
|
|
459
458
|
mutation CooResaleResolveReport($id: ID!, $removeListing: Boolean!, $notes: String!) {
|
|
460
459
|
cooResolveResaleReport(id: $id, removeListing: $removeListing, notes: $notes)
|
|
461
460
|
}
|
|
462
|
-
|
|
461
|
+
`;
|
|
462
|
+
e`
|
|
463
463
|
query CooResaleListingByRequest($requestId: ID!) {
|
|
464
464
|
cooMyResaleListingByRequest(requestId: $requestId) {
|
|
465
465
|
...CooResaleOwnListingFields
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
${i}`;
|
|
469
|
-
var
|
|
469
|
+
var B = e`
|
|
470
470
|
mutation CooResaleResolveCreateRequest($requestId: ID!) {
|
|
471
471
|
cooResolveResaleCreateRequest(requestId: $requestId) {
|
|
472
472
|
withdrawn
|
|
@@ -475,7 +475,7 @@ var P = e`
|
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
${i}`,
|
|
478
|
+
${i}`, V = e`
|
|
479
479
|
query CooResaleOwnedPhotos($actorId: ID!, $folderId: ID, $pagination: PaginationInput!, $folderPagination: PaginationInput!) {
|
|
480
480
|
getFiles(
|
|
481
481
|
folderId: $folderId
|
|
@@ -507,4 +507,4 @@ var P = e`
|
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
509
|
`;
|
|
510
|
-
export { v as CooBestPricesDocument, h as CooMarketplaceArchiveOfferDocument, f as CooMarketplaceCreateOfferDocument, d as CooMarketplaceInboxDocument, s as CooMarketplaceMyOffersDocument, l as CooMarketplaceOfferDocument, u as CooMarketplaceProposalBrandsDocument, n as CooMarketplaceProposalFragmentDoc, g as CooMarketplaceProposeOfferDocument, m as CooMarketplacePublishOfferDocument, c as CooMarketplacePublishedOffersDocument, t as CooMarketplaceRateCardFragmentDoc, _ as CooMarketplaceRespondDocument, p as CooMarketplaceUpdateOfferDocument, o as CooMyCreatorAnalyticsDocument, x as CooMyPriceWatchDeliveriesDocument, b as CooMyPriceWatchesDocument, y as CooPriceDetailDocument, C as CooRemovePriceWatchDocument, M as CooResaleArchiveListingDocument, w as CooResaleBrowseDocument, i as CooResaleOwnListingFieldsFragmentDoc, D as CooResaleOwnReportsDocument,
|
|
510
|
+
export { v as CooBestPricesDocument, h as CooMarketplaceArchiveOfferDocument, f as CooMarketplaceCreateOfferDocument, d as CooMarketplaceInboxDocument, s as CooMarketplaceMyOffersDocument, l as CooMarketplaceOfferDocument, u as CooMarketplaceProposalBrandsDocument, n as CooMarketplaceProposalFragmentDoc, g as CooMarketplaceProposeOfferDocument, m as CooMarketplacePublishOfferDocument, c as CooMarketplacePublishedOffersDocument, t as CooMarketplaceRateCardFragmentDoc, _ as CooMarketplaceRespondDocument, p as CooMarketplaceUpdateOfferDocument, o as CooMyCreatorAnalyticsDocument, x as CooMyPriceWatchDeliveriesDocument, b as CooMyPriceWatchesDocument, y as CooPriceDetailDocument, C as CooRemovePriceWatchDocument, M as CooResaleArchiveListingDocument, w as CooResaleBrowseDocument, i as CooResaleOwnListingFieldsFragmentDoc, D as CooResaleOwnReportsDocument, V as CooResaleOwnedPhotosDocument, T as CooResalePublicDetailDocument, a as CooResalePublicFieldsFragmentDoc, j as CooResalePublishListingDocument, N as CooResaleReportListingDocument, B as CooResaleResolveCreateRequestDocument, z as CooResaleResolveReportDocument, R as CooResaleReviewListingDocument, F as CooResaleReviewListingsDocument, I as CooResaleReviewReportsDocument, L as CooResaleReviewShopDocument, P as CooResaleReviewShopsDocument, k as CooResaleSaveListingDocument, O as CooResaleSaveShopDocument, E as CooResaleSellerDocument, r as CooResaleShopFieldsFragmentDoc, A as CooResaleSubmitListingDocument, S as CooSavePriceWatchDocument };
|