@burdenoff/microfe-atheletebridge 2026.1114.1 → 2026.1123.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/atheletebridge/AthleteBridgeRoot.js +71 -55
- package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.js +30 -6
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/components/MatchupRow.js +11 -2
- package/dist/atheletebridge/components/MatchupRow.js.map +1 -1
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.d.ts +5 -0
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.js +617 -0
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.js.map +1 -0
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.d.ts +5 -0
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js +453 -0
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js.map +1 -0
- package/dist/atheletebridge/hooks/index.d.ts +2 -0
- package/dist/atheletebridge/hooks/index.js +1 -0
- package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.d.ts +62 -0
- package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.js +362 -0
- package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.js.map +1 -0
- package/dist/atheletebridge/pages/DashboardPage.js +71 -1
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts +3 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js +346 -317
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +171 -159
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
- package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.d.ts +1 -0
- package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.js +14 -0
- package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.js.map +1 -0
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.d.ts +1 -0
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.js +756 -0
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.js.map +1 -0
- package/dist/atheletebridge/pages/performance/PerformancePage.js +296 -277
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +279 -147
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
- package/dist/atheletebridge/types/index.d.ts +1 -0
- package/dist/atheletebridge/types/insights.d.ts +270 -0
- package/package.json +13 -9
|
@@ -0,0 +1,756 @@
|
|
|
1
|
+
import { PageLayout as e } from "../../components/PageLayout.js";
|
|
2
|
+
import { EmptyState as t } from "../../components/EmptyState.js";
|
|
3
|
+
import { RatingStars as n } from "../../components/viz/RatingStars.js";
|
|
4
|
+
import { ErrorState as ee, LoadingState as r } from "../../components/LoadingState.js";
|
|
5
|
+
import { FormField as i, fieldInputClass as a } from "../../components/form.js";
|
|
6
|
+
import "../../components/viz/index.js";
|
|
7
|
+
import { PROGRAM_LEVEL_LABELS as o, SPORT_ICONS as te, SPORT_LABELS as s } from "../../components/domain.js";
|
|
8
|
+
import { useAthleteBridge as ne } from "../../context/AthleteBridgeContext.js";
|
|
9
|
+
import { usePrograms as re, useTeams as ie } from "../../hooks/useAthleteBridgeApi.js";
|
|
10
|
+
import { useAcquireFreeMarketplacePlan as ae, useConfirmMarketplaceCheckout as oe, useImportMarketplacePlan as se, useMarketplaceListings as ce, useMarketplaceReviews as le, useMyMarketplacePurchases as ue, useMyPublishedMarketplaceListings as de, usePublishMarketplaceListing as fe, useStartMarketplaceCheckout as pe, useSubmitMarketplaceReview as me, useUpdateMarketplaceListing as he } from "../../hooks/useInsightsWearablesMarketplaceApi.js";
|
|
11
|
+
import { formatDate as c } from "../../utils/formatters.js";
|
|
12
|
+
import { safeExternalHref as ge } from "../../utils/url.js";
|
|
13
|
+
import { useEffect as _e, useMemo as ve, useRef as ye, useState as l } from "react";
|
|
14
|
+
import { CheckCircle2 as be, Download as xe, ExternalLink as Se, Loader2 as u, Plus as d, Search as Ce, ShoppingBag as we, Sparkles as Te, Star as Ee, Store as De } from "lucide-react";
|
|
15
|
+
import { Fragment as Oe, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
16
|
+
import { Badge as m, GlassCard as h, GradientText as ke, ResponsiveDialog as g, ResponsiveDialogContent as _, ResponsiveDialogFooter as v, ResponsiveDialogHeader as y, ResponsiveDialogTitle as b, Tabs as Ae, TabsContent as x, TabsList as je, TabsTrigger as S } from "@burdenoff/fe-libs/ui";
|
|
17
|
+
// src/atheletebridge/pages/marketplace/MarketplacePage.tsx
|
|
18
|
+
var Me = Object.keys(s), Ne = Object.keys(o);
|
|
19
|
+
function C(e, t) {
|
|
20
|
+
if (e <= 0) return "Free";
|
|
21
|
+
try {
|
|
22
|
+
return new Intl.NumberFormat(void 0, {
|
|
23
|
+
style: "currency",
|
|
24
|
+
currency: t || "USD"
|
|
25
|
+
}).format(e / 100);
|
|
26
|
+
} catch {
|
|
27
|
+
return `${(e / 100).toFixed(2)} ${t}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function w() {
|
|
31
|
+
let { navigateTo: w, currentUser: T } = ne(), [E, Pe] = l(""), [D, Fe] = l(""), [O, Ie] = l(""), [k, Le] = l(!1), A = ce({
|
|
32
|
+
search: E || void 0,
|
|
33
|
+
sport: D || void 0,
|
|
34
|
+
level: O || void 0,
|
|
35
|
+
freeOnly: k || void 0
|
|
36
|
+
}), j = de(), M = ue(), Re = re({ pagination: { limit: 50 } }), ze = ie({ pagination: { limit: 50 } }), N = ae(), Be = pe(), Ve = oe(), P = se(), F = fe(), I = he(), L = me(), [He, R] = l(null), Ue = ye(!1), { mutateAsync: We } = Ve;
|
|
37
|
+
_e(() => {
|
|
38
|
+
if (Ue.current) return;
|
|
39
|
+
let e = new URLSearchParams(window.location.search), t = e.get("athMarketplacePurchase"), n = e.get("status");
|
|
40
|
+
t && n === "success" && (Ue.current = !0, We(t).then(() => {
|
|
41
|
+
R("Purchase confirmed! Your immutable training plan snapshot is in My Library.");
|
|
42
|
+
}).catch(() => {
|
|
43
|
+
R("Checking payment status — refresh My Library in a moment.");
|
|
44
|
+
}));
|
|
45
|
+
}, [We]);
|
|
46
|
+
let [Ge, z] = l(!1), [B, Ke] = l(""), [qe, Je] = l(""), [Ye, Xe] = l(""), [Ze, Qe] = l(T?.name || T?.firstName || "Head Coach"), [$e, et] = l("0"), [tt, nt] = l("USD"), [rt, it] = l(!0), [at, V] = l(null), [H, U] = l(null), [ot, st] = l(""), [ct, lt] = l(""), [ut, W] = l(null), [G, K] = l(null), [q, dt] = l(5), [ft, J] = l(""), [pt, Y] = l(null), [X, Z] = l(null), Q = le(X?.id), [mt, $] = l(null), ht = ve(() => new Set((M.data ?? []).filter((e) => e.status === "COMPLETED").map((e) => e.listingId)), [M.data]), gt = async (e) => {
|
|
47
|
+
$(null);
|
|
48
|
+
try {
|
|
49
|
+
if (e.priceCents <= 0) await N.mutateAsync(e.id), R(`Acquired "${e.title}" — open My Library to import it into your workspace.`);
|
|
50
|
+
else {
|
|
51
|
+
let t = await Be.mutateAsync({
|
|
52
|
+
listingId: e.id,
|
|
53
|
+
returnUrl: window.location.href.split("?")[0]
|
|
54
|
+
}), n = ge(t.checkoutUrl);
|
|
55
|
+
n && window.location.assign(n);
|
|
56
|
+
}
|
|
57
|
+
} catch (e) {
|
|
58
|
+
$(e instanceof Error ? e.message : "Unable to acquire training plan.");
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
return /* @__PURE__ */ p(e, {
|
|
62
|
+
title: /* @__PURE__ */ p("span", {
|
|
63
|
+
className: "flex items-center gap-2",
|
|
64
|
+
children: [/* @__PURE__ */ f(ke, { children: "Training Plan Marketplace" }), /* @__PURE__ */ f(m, {
|
|
65
|
+
variant: "outline",
|
|
66
|
+
children: "Beta"
|
|
67
|
+
})]
|
|
68
|
+
}),
|
|
69
|
+
description: "Discover coach-authored training plans, acquire immutable plan snapshots, and import them straight into your workspace.",
|
|
70
|
+
actions: /* @__PURE__ */ p("button", {
|
|
71
|
+
type: "button",
|
|
72
|
+
onClick: () => {
|
|
73
|
+
V(null), z(!0);
|
|
74
|
+
},
|
|
75
|
+
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
76
|
+
children: [/* @__PURE__ */ f(d, { className: "h-4 w-4" }), " Publish a plan"]
|
|
77
|
+
}),
|
|
78
|
+
children: [
|
|
79
|
+
He ? /* @__PURE__ */ p("div", {
|
|
80
|
+
className: "mb-6 flex items-center gap-2 rounded-xl border border-status-success-border bg-status-success-bg-subtle p-4 text-sm text-status-success-text",
|
|
81
|
+
children: [/* @__PURE__ */ f(be, { className: "h-4 w-4 shrink-0" }), /* @__PURE__ */ f("span", { children: He })]
|
|
82
|
+
}) : null,
|
|
83
|
+
mt ? /* @__PURE__ */ f("div", {
|
|
84
|
+
className: "mb-6 rounded-xl border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
85
|
+
children: mt
|
|
86
|
+
}) : null,
|
|
87
|
+
/* @__PURE__ */ p(Ae, {
|
|
88
|
+
defaultValue: "discover",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ p(je, {
|
|
91
|
+
className: "mb-6 flex-wrap",
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ p(S, {
|
|
94
|
+
value: "discover",
|
|
95
|
+
children: [/* @__PURE__ */ f(De, { className: "mr-1.5 h-4 w-4" }), " Discover Plans"]
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ p(S, {
|
|
98
|
+
value: "library",
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ f(we, { className: "mr-1.5 h-4 w-4" }),
|
|
101
|
+
" My Library (",
|
|
102
|
+
(M.data ?? []).length,
|
|
103
|
+
")"
|
|
104
|
+
]
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ p(S, {
|
|
107
|
+
value: "studio",
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ f(Te, { className: "mr-1.5 h-4 w-4" }),
|
|
110
|
+
" Coach Studio (",
|
|
111
|
+
j.data?.items.length ?? 0,
|
|
112
|
+
")"
|
|
113
|
+
]
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ p(x, {
|
|
118
|
+
value: "discover",
|
|
119
|
+
className: "space-y-6",
|
|
120
|
+
children: [/* @__PURE__ */ p(h, {
|
|
121
|
+
treatment: "metric",
|
|
122
|
+
className: "grid grid-cols-1 gap-3 p-4 sm:grid-cols-4",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ p("div", {
|
|
125
|
+
className: "relative sm:col-span-2",
|
|
126
|
+
children: [/* @__PURE__ */ f(Ce, { className: "pointer-events-none absolute left-3 top-2.5 h-4 w-4 text-text-muted" }), /* @__PURE__ */ f("input", {
|
|
127
|
+
type: "search",
|
|
128
|
+
"aria-label": "Search marketplace training plans",
|
|
129
|
+
placeholder: "Search plans, coaches, sports…",
|
|
130
|
+
value: E,
|
|
131
|
+
onChange: (e) => Pe(e.target.value),
|
|
132
|
+
className: `${a} pl-9`
|
|
133
|
+
})]
|
|
134
|
+
}),
|
|
135
|
+
/* @__PURE__ */ p("select", {
|
|
136
|
+
"aria-label": "Filter by sport",
|
|
137
|
+
value: D,
|
|
138
|
+
onChange: (e) => Fe(e.target.value),
|
|
139
|
+
className: a,
|
|
140
|
+
children: [/* @__PURE__ */ f("option", {
|
|
141
|
+
value: "",
|
|
142
|
+
children: "All sports"
|
|
143
|
+
}), Me.map((e) => /* @__PURE__ */ f("option", {
|
|
144
|
+
value: e,
|
|
145
|
+
children: s[e]
|
|
146
|
+
}, e))]
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ p("div", {
|
|
149
|
+
className: "flex items-center gap-2",
|
|
150
|
+
children: [/* @__PURE__ */ p("select", {
|
|
151
|
+
"aria-label": "Filter by level",
|
|
152
|
+
value: O,
|
|
153
|
+
onChange: (e) => Ie(e.target.value),
|
|
154
|
+
className: a,
|
|
155
|
+
children: [/* @__PURE__ */ f("option", {
|
|
156
|
+
value: "",
|
|
157
|
+
children: "All levels"
|
|
158
|
+
}), Ne.map((e) => /* @__PURE__ */ f("option", {
|
|
159
|
+
value: e,
|
|
160
|
+
children: o[e]
|
|
161
|
+
}, e))]
|
|
162
|
+
}), /* @__PURE__ */ p("label", {
|
|
163
|
+
className: "flex shrink-0 items-center gap-1.5 text-xs text-text-secondary",
|
|
164
|
+
children: [/* @__PURE__ */ f("input", {
|
|
165
|
+
type: "checkbox",
|
|
166
|
+
checked: k,
|
|
167
|
+
onChange: (e) => Le(e.target.checked)
|
|
168
|
+
}), "Free"]
|
|
169
|
+
})]
|
|
170
|
+
})
|
|
171
|
+
]
|
|
172
|
+
}), A.isLoading ? /* @__PURE__ */ f(r, { label: "Loading marketplace training plans…" }) : A.isError ? /* @__PURE__ */ f(ee, {
|
|
173
|
+
title: "Marketplace unavailable",
|
|
174
|
+
message: "Could not load training plan listings.",
|
|
175
|
+
onRetry: () => void A.refetch()
|
|
176
|
+
}) : (A.data?.items ?? []).length === 0 ? /* @__PURE__ */ f(t, {
|
|
177
|
+
illustration: "empty-data",
|
|
178
|
+
icon: /* @__PURE__ */ f(De, { className: "h-10 w-10" }),
|
|
179
|
+
title: "No training plans published yet",
|
|
180
|
+
description: "Publish one of your workspace training programs to be the first coach on the AthleteBridge marketplace.",
|
|
181
|
+
action: /* @__PURE__ */ p("button", {
|
|
182
|
+
type: "button",
|
|
183
|
+
onClick: () => z(!0),
|
|
184
|
+
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text",
|
|
185
|
+
children: [/* @__PURE__ */ f(d, { className: "h-4 w-4" }), " Publish a plan"]
|
|
186
|
+
})
|
|
187
|
+
}) : /* @__PURE__ */ f("div", {
|
|
188
|
+
className: "grid grid-cols-1 gap-5 md:grid-cols-2 lg:grid-cols-3",
|
|
189
|
+
children: (A.data?.items ?? []).map((e) => {
|
|
190
|
+
let t = te[e.sport], n = ht.has(e.id);
|
|
191
|
+
return /* @__PURE__ */ p(h, {
|
|
192
|
+
treatment: "insight",
|
|
193
|
+
className: "flex flex-col gap-4 p-5",
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ p("div", {
|
|
196
|
+
className: "flex items-start justify-between gap-2",
|
|
197
|
+
children: [/* @__PURE__ */ p("div", {
|
|
198
|
+
className: "flex items-center gap-2",
|
|
199
|
+
children: [/* @__PURE__ */ f("span", {
|
|
200
|
+
className: "flex h-9 w-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-[var(--color-accent-teal)]",
|
|
201
|
+
children: /* @__PURE__ */ f(t, { className: "h-4 w-4" })
|
|
202
|
+
}), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("p", {
|
|
203
|
+
className: "text-xs font-medium text-text-secondary",
|
|
204
|
+
children: [
|
|
205
|
+
s[e.sport],
|
|
206
|
+
" · ",
|
|
207
|
+
o[e.level]
|
|
208
|
+
]
|
|
209
|
+
}), /* @__PURE__ */ p("p", {
|
|
210
|
+
className: "text-xs text-text-muted",
|
|
211
|
+
children: ["by ", e.sellerDisplayName]
|
|
212
|
+
})] })]
|
|
213
|
+
}), /* @__PURE__ */ f(m, {
|
|
214
|
+
variant: e.priceCents === 0 ? "default" : "secondary",
|
|
215
|
+
children: C(e.priceCents, e.currency)
|
|
216
|
+
})]
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h3", {
|
|
219
|
+
className: "text-base font-semibold text-text-primary",
|
|
220
|
+
children: e.title
|
|
221
|
+
}), e.summary ? /* @__PURE__ */ f("p", {
|
|
222
|
+
className: "mt-1 line-clamp-2 text-xs text-text-secondary",
|
|
223
|
+
children: e.summary
|
|
224
|
+
}) : null] }),
|
|
225
|
+
/* @__PURE__ */ p("div", {
|
|
226
|
+
className: "flex flex-wrap items-center gap-3 text-xs tabular-nums text-text-muted",
|
|
227
|
+
children: [
|
|
228
|
+
/* @__PURE__ */ p("span", { children: [e.weeks, " weeks"] }),
|
|
229
|
+
/* @__PURE__ */ f("span", { children: "·" }),
|
|
230
|
+
/* @__PURE__ */ p("span", { children: [e.drillCount, " drills"] }),
|
|
231
|
+
/* @__PURE__ */ f("span", { children: "·" }),
|
|
232
|
+
/* @__PURE__ */ p("span", { children: [e.purchaseCount, " acquired"] }),
|
|
233
|
+
e.ratingAvg == null ? null : /* @__PURE__ */ p("span", {
|
|
234
|
+
className: "inline-flex items-center gap-1 text-text-primary",
|
|
235
|
+
children: [
|
|
236
|
+
/* @__PURE__ */ f(Ee, { className: "h-3.5 w-3.5 fill-current text-[var(--color-accent-teal)]" }),
|
|
237
|
+
e.ratingAvg.toFixed(1),
|
|
238
|
+
" (",
|
|
239
|
+
e.ratingCount,
|
|
240
|
+
")"
|
|
241
|
+
]
|
|
242
|
+
})
|
|
243
|
+
]
|
|
244
|
+
}),
|
|
245
|
+
e.previewDrills.length > 0 ? /* @__PURE__ */ p("div", {
|
|
246
|
+
className: "rounded-lg border border-border-seam bg-bg-sunken/50 p-3",
|
|
247
|
+
children: [/* @__PURE__ */ f("p", {
|
|
248
|
+
className: "mb-1.5 text-[0.7rem] font-semibold uppercase tracking-wide text-text-muted",
|
|
249
|
+
children: "Drill preview"
|
|
250
|
+
}), /* @__PURE__ */ f("ul", {
|
|
251
|
+
className: "space-y-1 text-xs text-text-secondary",
|
|
252
|
+
children: e.previewDrills.slice(0, 3).map((e, t) => /* @__PURE__ */ p("li", {
|
|
253
|
+
className: "truncate",
|
|
254
|
+
children: [
|
|
255
|
+
"W",
|
|
256
|
+
e.weekNumber,
|
|
257
|
+
" · ",
|
|
258
|
+
e.name
|
|
259
|
+
]
|
|
260
|
+
}, t))
|
|
261
|
+
})]
|
|
262
|
+
}) : null,
|
|
263
|
+
/* @__PURE__ */ p("div", {
|
|
264
|
+
className: "mt-auto flex items-center gap-2 pt-2",
|
|
265
|
+
children: [/* @__PURE__ */ f("button", {
|
|
266
|
+
type: "button",
|
|
267
|
+
onClick: () => void gt(e),
|
|
268
|
+
disabled: N.isPending || Be.isPending || e.priceCents > 0 && !e.paidCheckoutReady,
|
|
269
|
+
className: "inline-flex flex-1 items-center justify-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-2 text-xs font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
270
|
+
children: n ? "In My Library" : e.priceCents === 0 ? "Get Free Plan" : e.paidCheckoutReady ? `Buy ${C(e.priceCents, e.currency)}` : "Checkout Pending Setup"
|
|
271
|
+
}), /* @__PURE__ */ f("button", {
|
|
272
|
+
type: "button",
|
|
273
|
+
onClick: () => Z(e),
|
|
274
|
+
className: "rounded-lg border border-border-seam px-3 py-2 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
275
|
+
children: "Reviews"
|
|
276
|
+
})]
|
|
277
|
+
})
|
|
278
|
+
]
|
|
279
|
+
}, e.id);
|
|
280
|
+
})
|
|
281
|
+
})]
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ f(x, {
|
|
284
|
+
value: "library",
|
|
285
|
+
className: "space-y-4",
|
|
286
|
+
children: M.isLoading ? /* @__PURE__ */ f(r, { label: "Loading your purchased plan snapshots…" }) : (M.data ?? []).length === 0 ? /* @__PURE__ */ f(t, {
|
|
287
|
+
illustration: "empty-data",
|
|
288
|
+
icon: /* @__PURE__ */ f(we, { className: "h-10 w-10" }),
|
|
289
|
+
title: "Your training plan library is empty",
|
|
290
|
+
description: "Acquire a free or paid training plan from Discover to lock in an immutable snapshot and import it into your workspace."
|
|
291
|
+
}) : /* @__PURE__ */ f("div", {
|
|
292
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
293
|
+
children: (M.data ?? []).map((e) => {
|
|
294
|
+
let t = e.planSnapshot, n = typeof t?.title == "string" && t.title || e.listing?.title || "Purchased Plan", ee = Array.isArray(t?.drills) ? t.drills.length : 0;
|
|
295
|
+
return /* @__PURE__ */ p(h, {
|
|
296
|
+
treatment: "insight",
|
|
297
|
+
className: "flex flex-col gap-3 p-5",
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ p("div", {
|
|
300
|
+
className: "flex items-start justify-between gap-2",
|
|
301
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h3", {
|
|
302
|
+
className: "font-semibold text-text-primary",
|
|
303
|
+
children: n
|
|
304
|
+
}), /* @__PURE__ */ p("p", {
|
|
305
|
+
className: "text-xs text-text-muted",
|
|
306
|
+
children: [
|
|
307
|
+
"Immutable snapshot · ",
|
|
308
|
+
ee,
|
|
309
|
+
" drills ·",
|
|
310
|
+
" ",
|
|
311
|
+
C(e.priceCents, e.currency)
|
|
312
|
+
]
|
|
313
|
+
})] }), /* @__PURE__ */ f(m, {
|
|
314
|
+
variant: e.status === "COMPLETED" ? "default" : "secondary",
|
|
315
|
+
children: e.status
|
|
316
|
+
})]
|
|
317
|
+
}),
|
|
318
|
+
/* @__PURE__ */ p("p", {
|
|
319
|
+
className: "text-xs text-text-secondary",
|
|
320
|
+
children: ["Acquired ", c(e.completedAt ?? e.createdAt)]
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ f("div", {
|
|
323
|
+
className: "mt-auto flex flex-wrap items-center gap-2 pt-2",
|
|
324
|
+
children: e.status === "COMPLETED" ? /* @__PURE__ */ p(Oe, { children: [
|
|
325
|
+
/* @__PURE__ */ p("button", {
|
|
326
|
+
type: "button",
|
|
327
|
+
onClick: () => {
|
|
328
|
+
W(null), st(n), lt(""), U(e);
|
|
329
|
+
},
|
|
330
|
+
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-semibold text-action-primary-text hover:bg-action-primary-bg/90",
|
|
331
|
+
children: [/* @__PURE__ */ f(xe, { className: "h-3.5 w-3.5" }), e.importedProgramId ? "Import copy again" : "Import to workspace"]
|
|
332
|
+
}),
|
|
333
|
+
e.importedProgramId ? /* @__PURE__ */ p("button", {
|
|
334
|
+
type: "button",
|
|
335
|
+
onClick: () => w(`/programs/${e.importedProgramId}`),
|
|
336
|
+
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
337
|
+
children: ["Open program ", /* @__PURE__ */ f(Se, { className: "h-3.5 w-3.5" })]
|
|
338
|
+
}) : null,
|
|
339
|
+
/* @__PURE__ */ p("button", {
|
|
340
|
+
type: "button",
|
|
341
|
+
onClick: () => {
|
|
342
|
+
Y(null), dt(5), J(""), K(e);
|
|
343
|
+
},
|
|
344
|
+
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
345
|
+
children: [/* @__PURE__ */ f(Ee, { className: "h-3.5 w-3.5" }), " Review"]
|
|
346
|
+
})
|
|
347
|
+
] }) : null
|
|
348
|
+
})
|
|
349
|
+
]
|
|
350
|
+
}, e.id);
|
|
351
|
+
})
|
|
352
|
+
})
|
|
353
|
+
}),
|
|
354
|
+
/* @__PURE__ */ p(x, {
|
|
355
|
+
value: "studio",
|
|
356
|
+
className: "space-y-4",
|
|
357
|
+
children: [/* @__PURE__ */ p(h, {
|
|
358
|
+
treatment: "metric",
|
|
359
|
+
className: "flex flex-wrap items-center justify-between gap-3 p-4",
|
|
360
|
+
children: [/* @__PURE__ */ p("div", {
|
|
361
|
+
className: "text-xs text-text-secondary",
|
|
362
|
+
children: [/* @__PURE__ */ f("p", {
|
|
363
|
+
className: "font-semibold text-text-primary",
|
|
364
|
+
children: "Coach Publisher Payouts (Stripe Connect Split)"
|
|
365
|
+
}), /* @__PURE__ */ f("p", {
|
|
366
|
+
className: "mt-0.5",
|
|
367
|
+
children: "Free plans publish immediately. Paid plans settle directly to your connected Stripe Express payout account (configured under Registrations → Online Payments) with a 10% platform revenue share."
|
|
368
|
+
})]
|
|
369
|
+
}), /* @__PURE__ */ f("button", {
|
|
370
|
+
type: "button",
|
|
371
|
+
onClick: () => w("/registrations"),
|
|
372
|
+
className: "rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
373
|
+
children: "Manage Payout Account"
|
|
374
|
+
})]
|
|
375
|
+
}), (j.data?.items ?? []).length === 0 ? /* @__PURE__ */ f(t, {
|
|
376
|
+
illustration: "empty-data",
|
|
377
|
+
icon: /* @__PURE__ */ f(Te, { className: "h-10 w-10" }),
|
|
378
|
+
title: "You haven't published any training plans yet",
|
|
379
|
+
description: "Turn any of your authored workspace training programs (with drills) into a free or paid marketplace listing.",
|
|
380
|
+
action: /* @__PURE__ */ p("button", {
|
|
381
|
+
type: "button",
|
|
382
|
+
onClick: () => z(!0),
|
|
383
|
+
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text",
|
|
384
|
+
children: [/* @__PURE__ */ f(d, { className: "h-4 w-4" }), " Publish a plan"]
|
|
385
|
+
})
|
|
386
|
+
}) : /* @__PURE__ */ f("div", {
|
|
387
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
388
|
+
children: (j.data?.items ?? []).map((e) => /* @__PURE__ */ p(h, {
|
|
389
|
+
treatment: "insight",
|
|
390
|
+
className: "flex flex-col gap-3 p-5",
|
|
391
|
+
children: [/* @__PURE__ */ p("div", {
|
|
392
|
+
className: "flex items-start justify-between gap-2",
|
|
393
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h3", {
|
|
394
|
+
className: "font-semibold text-text-primary",
|
|
395
|
+
children: e.title
|
|
396
|
+
}), /* @__PURE__ */ p("p", {
|
|
397
|
+
className: "text-xs text-text-muted",
|
|
398
|
+
children: [
|
|
399
|
+
C(e.priceCents, e.currency),
|
|
400
|
+
" · ",
|
|
401
|
+
e.drillCount,
|
|
402
|
+
" drills ·",
|
|
403
|
+
" ",
|
|
404
|
+
e.purchaseCount,
|
|
405
|
+
" acquired"
|
|
406
|
+
]
|
|
407
|
+
})] }), /* @__PURE__ */ f(m, {
|
|
408
|
+
variant: e.status === "PUBLISHED" ? "default" : "secondary",
|
|
409
|
+
children: e.status
|
|
410
|
+
})]
|
|
411
|
+
}), /* @__PURE__ */ p("div", {
|
|
412
|
+
className: "flex flex-wrap gap-2 pt-2",
|
|
413
|
+
children: [e.status === "PUBLISHED" ? /* @__PURE__ */ f("button", {
|
|
414
|
+
type: "button",
|
|
415
|
+
onClick: () => void I.mutate({
|
|
416
|
+
id: e.id,
|
|
417
|
+
input: { status: "UNLISTED" }
|
|
418
|
+
}),
|
|
419
|
+
className: "rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
420
|
+
children: "Unlist"
|
|
421
|
+
}) : /* @__PURE__ */ f("button", {
|
|
422
|
+
type: "button",
|
|
423
|
+
onClick: () => void I.mutate({
|
|
424
|
+
id: e.id,
|
|
425
|
+
input: { status: "PUBLISHED" }
|
|
426
|
+
}),
|
|
427
|
+
className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-semibold text-action-primary-text",
|
|
428
|
+
children: "Publish"
|
|
429
|
+
}), /* @__PURE__ */ f("button", {
|
|
430
|
+
type: "button",
|
|
431
|
+
onClick: () => void I.mutate({
|
|
432
|
+
id: e.id,
|
|
433
|
+
input: { status: "ARCHIVED" }
|
|
434
|
+
}),
|
|
435
|
+
className: "rounded-lg border border-status-error-border px-3 py-1.5 text-xs font-medium text-status-error-text hover:bg-status-error-bg-subtle",
|
|
436
|
+
children: "Archive"
|
|
437
|
+
})]
|
|
438
|
+
})]
|
|
439
|
+
}, e.id))
|
|
440
|
+
})]
|
|
441
|
+
})
|
|
442
|
+
]
|
|
443
|
+
}),
|
|
444
|
+
/* @__PURE__ */ f(g, {
|
|
445
|
+
open: Ge,
|
|
446
|
+
onOpenChange: z,
|
|
447
|
+
children: /* @__PURE__ */ p(_, { children: [/* @__PURE__ */ f(y, { children: /* @__PURE__ */ f(b, { children: "Publish Training Plan to Marketplace" }) }), /* @__PURE__ */ p("form", {
|
|
448
|
+
onSubmit: async (e) => {
|
|
449
|
+
if (e.preventDefault(), V(null), !B) {
|
|
450
|
+
V("Select a training program to publish.");
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
let t = Math.max(0, Math.round((Number.parseFloat($e) || 0) * 100));
|
|
454
|
+
try {
|
|
455
|
+
await F.mutateAsync({
|
|
456
|
+
programId: B,
|
|
457
|
+
title: qe.trim() || void 0,
|
|
458
|
+
summary: Ye.trim() || void 0,
|
|
459
|
+
sellerDisplayName: Ze.trim() || "Coach",
|
|
460
|
+
priceCents: t,
|
|
461
|
+
currency: tt.trim().toUpperCase() || "USD",
|
|
462
|
+
publishImmediately: rt
|
|
463
|
+
}), z(!1), Je(""), Xe(""), et("0");
|
|
464
|
+
} catch (e) {
|
|
465
|
+
V(e instanceof Error ? e.message : "Failed to publish listing.");
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
className: "space-y-4 px-1",
|
|
469
|
+
children: [
|
|
470
|
+
/* @__PURE__ */ f(i, {
|
|
471
|
+
label: "Source training program",
|
|
472
|
+
htmlFor: "pub-program",
|
|
473
|
+
children: /* @__PURE__ */ p("select", {
|
|
474
|
+
id: "pub-program",
|
|
475
|
+
className: a,
|
|
476
|
+
value: B,
|
|
477
|
+
onChange: (e) => Ke(e.target.value),
|
|
478
|
+
required: !0,
|
|
479
|
+
children: [/* @__PURE__ */ f("option", {
|
|
480
|
+
value: "",
|
|
481
|
+
children: "Choose a program…"
|
|
482
|
+
}), (Re.data?.items ?? []).map((e) => /* @__PURE__ */ p("option", {
|
|
483
|
+
value: e.id,
|
|
484
|
+
children: [
|
|
485
|
+
e.name,
|
|
486
|
+
" (",
|
|
487
|
+
e.weeks,
|
|
488
|
+
"w · ",
|
|
489
|
+
s[e.sport],
|
|
490
|
+
")"
|
|
491
|
+
]
|
|
492
|
+
}, e.id))]
|
|
493
|
+
})
|
|
494
|
+
}),
|
|
495
|
+
/* @__PURE__ */ f(i, {
|
|
496
|
+
label: "Listing title",
|
|
497
|
+
htmlFor: "pub-title",
|
|
498
|
+
hint: "Leave blank to use program name.",
|
|
499
|
+
children: /* @__PURE__ */ f("input", {
|
|
500
|
+
id: "pub-title",
|
|
501
|
+
className: a,
|
|
502
|
+
value: qe,
|
|
503
|
+
onChange: (e) => Je(e.target.value),
|
|
504
|
+
placeholder: "e.g. 8-Week Explosive Sprint Block"
|
|
505
|
+
})
|
|
506
|
+
}),
|
|
507
|
+
/* @__PURE__ */ f(i, {
|
|
508
|
+
label: "Coach / Seller display name",
|
|
509
|
+
htmlFor: "pub-seller",
|
|
510
|
+
children: /* @__PURE__ */ f("input", {
|
|
511
|
+
id: "pub-seller",
|
|
512
|
+
className: a,
|
|
513
|
+
value: Ze,
|
|
514
|
+
onChange: (e) => Qe(e.target.value),
|
|
515
|
+
required: !0
|
|
516
|
+
})
|
|
517
|
+
}),
|
|
518
|
+
/* @__PURE__ */ f(i, {
|
|
519
|
+
label: "Summary",
|
|
520
|
+
htmlFor: "pub-summary",
|
|
521
|
+
children: /* @__PURE__ */ f("textarea", {
|
|
522
|
+
id: "pub-summary",
|
|
523
|
+
rows: 2,
|
|
524
|
+
className: a,
|
|
525
|
+
value: Ye,
|
|
526
|
+
onChange: (e) => Xe(e.target.value)
|
|
527
|
+
})
|
|
528
|
+
}),
|
|
529
|
+
/* @__PURE__ */ p("div", {
|
|
530
|
+
className: "grid grid-cols-2 gap-3",
|
|
531
|
+
children: [/* @__PURE__ */ f(i, {
|
|
532
|
+
label: "Price (0 = Free)",
|
|
533
|
+
htmlFor: "pub-price",
|
|
534
|
+
children: /* @__PURE__ */ f("input", {
|
|
535
|
+
id: "pub-price",
|
|
536
|
+
type: "number",
|
|
537
|
+
min: 0,
|
|
538
|
+
step: "0.01",
|
|
539
|
+
className: a,
|
|
540
|
+
value: $e,
|
|
541
|
+
onChange: (e) => et(e.target.value)
|
|
542
|
+
})
|
|
543
|
+
}), /* @__PURE__ */ f(i, {
|
|
544
|
+
label: "Currency",
|
|
545
|
+
htmlFor: "pub-currency",
|
|
546
|
+
children: /* @__PURE__ */ f("input", {
|
|
547
|
+
id: "pub-currency",
|
|
548
|
+
maxLength: 3,
|
|
549
|
+
className: a,
|
|
550
|
+
value: tt,
|
|
551
|
+
onChange: (e) => nt(e.target.value.toUpperCase())
|
|
552
|
+
})
|
|
553
|
+
})]
|
|
554
|
+
}),
|
|
555
|
+
/* @__PURE__ */ p("label", {
|
|
556
|
+
className: "flex items-center gap-2 text-xs text-text-secondary",
|
|
557
|
+
children: [/* @__PURE__ */ f("input", {
|
|
558
|
+
type: "checkbox",
|
|
559
|
+
checked: rt,
|
|
560
|
+
onChange: (e) => it(e.target.checked)
|
|
561
|
+
}), "Publish immediately (uncheck to save as Draft)"]
|
|
562
|
+
}),
|
|
563
|
+
at ? /* @__PURE__ */ f("p", {
|
|
564
|
+
className: "text-xs text-status-error-text",
|
|
565
|
+
children: at
|
|
566
|
+
}) : null,
|
|
567
|
+
/* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f("button", {
|
|
568
|
+
type: "button",
|
|
569
|
+
onClick: () => z(!1),
|
|
570
|
+
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
571
|
+
children: "Cancel"
|
|
572
|
+
}), /* @__PURE__ */ p("button", {
|
|
573
|
+
type: "submit",
|
|
574
|
+
disabled: F.isPending,
|
|
575
|
+
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text disabled:opacity-60",
|
|
576
|
+
children: [F.isPending ? /* @__PURE__ */ f(u, { className: "h-4 w-4 animate-spin" }) : null, "Create listing"]
|
|
577
|
+
})] })
|
|
578
|
+
]
|
|
579
|
+
})] })
|
|
580
|
+
}),
|
|
581
|
+
/* @__PURE__ */ f(g, {
|
|
582
|
+
open: !!H,
|
|
583
|
+
onOpenChange: (e) => !e && U(null),
|
|
584
|
+
children: /* @__PURE__ */ p(_, { children: [/* @__PURE__ */ f(y, { children: /* @__PURE__ */ f(b, { children: "Import Plan Snapshot into Workspace" }) }), /* @__PURE__ */ p("form", {
|
|
585
|
+
onSubmit: async (e) => {
|
|
586
|
+
if (e.preventDefault(), H) {
|
|
587
|
+
W(null);
|
|
588
|
+
try {
|
|
589
|
+
let e = await P.mutateAsync({
|
|
590
|
+
purchaseId: H.id,
|
|
591
|
+
customName: ot.trim() || void 0,
|
|
592
|
+
assignTeamId: ct || void 0
|
|
593
|
+
});
|
|
594
|
+
U(null), w(`/programs/${e.program.id}`);
|
|
595
|
+
} catch (e) {
|
|
596
|
+
W(e instanceof Error ? e.message : "Failed to import training plan.");
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
className: "space-y-4 px-1",
|
|
601
|
+
children: [
|
|
602
|
+
/* @__PURE__ */ f(i, {
|
|
603
|
+
label: "Program name in your workspace",
|
|
604
|
+
htmlFor: "imp-name",
|
|
605
|
+
children: /* @__PURE__ */ f("input", {
|
|
606
|
+
id: "imp-name",
|
|
607
|
+
className: a,
|
|
608
|
+
value: ot,
|
|
609
|
+
onChange: (e) => st(e.target.value),
|
|
610
|
+
required: !0
|
|
611
|
+
})
|
|
612
|
+
}),
|
|
613
|
+
/* @__PURE__ */ f(i, {
|
|
614
|
+
label: "Assign to team (optional)",
|
|
615
|
+
htmlFor: "imp-team",
|
|
616
|
+
hint: "You can also assign or edit drills after importing.",
|
|
617
|
+
children: /* @__PURE__ */ p("select", {
|
|
618
|
+
id: "imp-team",
|
|
619
|
+
className: a,
|
|
620
|
+
value: ct,
|
|
621
|
+
onChange: (e) => lt(e.target.value),
|
|
622
|
+
children: [/* @__PURE__ */ f("option", {
|
|
623
|
+
value: "",
|
|
624
|
+
children: "Leave unassigned"
|
|
625
|
+
}), (ze.data?.items ?? []).map((e) => /* @__PURE__ */ f("option", {
|
|
626
|
+
value: e.id,
|
|
627
|
+
children: e.name
|
|
628
|
+
}, e.id))]
|
|
629
|
+
})
|
|
630
|
+
}),
|
|
631
|
+
ut ? /* @__PURE__ */ f("p", {
|
|
632
|
+
className: "text-xs text-status-error-text",
|
|
633
|
+
children: ut
|
|
634
|
+
}) : null,
|
|
635
|
+
/* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f("button", {
|
|
636
|
+
type: "button",
|
|
637
|
+
onClick: () => U(null),
|
|
638
|
+
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
639
|
+
children: "Cancel"
|
|
640
|
+
}), /* @__PURE__ */ p("button", {
|
|
641
|
+
type: "submit",
|
|
642
|
+
disabled: P.isPending,
|
|
643
|
+
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text disabled:opacity-60",
|
|
644
|
+
children: [P.isPending ? /* @__PURE__ */ f(u, { className: "h-4 w-4 animate-spin" }) : null, "Import program"]
|
|
645
|
+
})] })
|
|
646
|
+
]
|
|
647
|
+
})] })
|
|
648
|
+
}),
|
|
649
|
+
/* @__PURE__ */ f(g, {
|
|
650
|
+
open: !!G,
|
|
651
|
+
onOpenChange: (e) => !e && K(null),
|
|
652
|
+
children: /* @__PURE__ */ p(_, { children: [/* @__PURE__ */ f(y, { children: /* @__PURE__ */ f(b, { children: "Review Training Plan" }) }), /* @__PURE__ */ p("form", {
|
|
653
|
+
onSubmit: async (e) => {
|
|
654
|
+
if (e.preventDefault(), G) {
|
|
655
|
+
Y(null);
|
|
656
|
+
try {
|
|
657
|
+
await L.mutateAsync({
|
|
658
|
+
listingId: G.listingId,
|
|
659
|
+
rating: q,
|
|
660
|
+
comment: ft.trim() || void 0,
|
|
661
|
+
reviewerName: T?.name || T?.firstName || void 0
|
|
662
|
+
}), K(null), J("");
|
|
663
|
+
} catch (e) {
|
|
664
|
+
Y(e instanceof Error ? e.message : "Failed to submit review.");
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
className: "space-y-4 px-1",
|
|
669
|
+
children: [
|
|
670
|
+
/* @__PURE__ */ f(i, {
|
|
671
|
+
label: "Rating",
|
|
672
|
+
children: /* @__PURE__ */ f(n, {
|
|
673
|
+
value: q,
|
|
674
|
+
onChange: dt,
|
|
675
|
+
size: 28,
|
|
676
|
+
showLabels: !0
|
|
677
|
+
})
|
|
678
|
+
}),
|
|
679
|
+
/* @__PURE__ */ f(i, {
|
|
680
|
+
label: "Comment (optional)",
|
|
681
|
+
htmlFor: "rev-comment",
|
|
682
|
+
children: /* @__PURE__ */ f("textarea", {
|
|
683
|
+
id: "rev-comment",
|
|
684
|
+
rows: 3,
|
|
685
|
+
className: a,
|
|
686
|
+
value: ft,
|
|
687
|
+
onChange: (e) => J(e.target.value),
|
|
688
|
+
placeholder: "How well did this plan work for your athletes?"
|
|
689
|
+
})
|
|
690
|
+
}),
|
|
691
|
+
pt ? /* @__PURE__ */ f("p", {
|
|
692
|
+
className: "text-xs text-status-error-text",
|
|
693
|
+
children: pt
|
|
694
|
+
}) : null,
|
|
695
|
+
/* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f("button", {
|
|
696
|
+
type: "button",
|
|
697
|
+
onClick: () => K(null),
|
|
698
|
+
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
699
|
+
children: "Cancel"
|
|
700
|
+
}), /* @__PURE__ */ p("button", {
|
|
701
|
+
type: "submit",
|
|
702
|
+
disabled: L.isPending,
|
|
703
|
+
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text disabled:opacity-60",
|
|
704
|
+
children: [L.isPending ? /* @__PURE__ */ f(u, { className: "h-4 w-4 animate-spin" }) : null, "Submit review"]
|
|
705
|
+
})] })
|
|
706
|
+
]
|
|
707
|
+
})] })
|
|
708
|
+
}),
|
|
709
|
+
/* @__PURE__ */ f(g, {
|
|
710
|
+
open: !!X,
|
|
711
|
+
onOpenChange: (e) => !e && Z(null),
|
|
712
|
+
children: /* @__PURE__ */ p(_, { children: [
|
|
713
|
+
/* @__PURE__ */ f(y, { children: /* @__PURE__ */ p(b, { children: ["Verified Reviews · ", X?.title] }) }),
|
|
714
|
+
/* @__PURE__ */ f("div", {
|
|
715
|
+
className: "max-h-72 space-y-3 overflow-y-auto px-1",
|
|
716
|
+
children: Q.isLoading ? /* @__PURE__ */ f(r, { label: "Loading reviews…" }) : (Q.data ?? []).length === 0 ? /* @__PURE__ */ f("p", {
|
|
717
|
+
className: "py-6 text-center text-xs text-text-muted",
|
|
718
|
+
children: "No verified reviews yet."
|
|
719
|
+
}) : (Q.data ?? []).map((e) => /* @__PURE__ */ p("div", {
|
|
720
|
+
className: "rounded-lg border border-border-seam bg-bg-sunken/50 p-3 text-xs",
|
|
721
|
+
children: [
|
|
722
|
+
/* @__PURE__ */ p("div", {
|
|
723
|
+
className: "flex items-center justify-between gap-2",
|
|
724
|
+
children: [/* @__PURE__ */ f("span", {
|
|
725
|
+
className: "font-semibold text-text-primary",
|
|
726
|
+
children: e.reviewerName
|
|
727
|
+
}), /* @__PURE__ */ f(n, {
|
|
728
|
+
value: e.rating,
|
|
729
|
+
size: 14
|
|
730
|
+
})]
|
|
731
|
+
}),
|
|
732
|
+
e.comment ? /* @__PURE__ */ f("p", {
|
|
733
|
+
className: "mt-1.5 text-text-secondary",
|
|
734
|
+
children: e.comment
|
|
735
|
+
}) : null,
|
|
736
|
+
/* @__PURE__ */ f("p", {
|
|
737
|
+
className: "mt-1 text-[0.68rem] text-text-muted",
|
|
738
|
+
children: c(e.createdAt)
|
|
739
|
+
})
|
|
740
|
+
]
|
|
741
|
+
}, e.id))
|
|
742
|
+
}),
|
|
743
|
+
/* @__PURE__ */ f(v, { children: /* @__PURE__ */ f("button", {
|
|
744
|
+
type: "button",
|
|
745
|
+
onClick: () => Z(null),
|
|
746
|
+
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
747
|
+
children: "Close"
|
|
748
|
+
}) })
|
|
749
|
+
] })
|
|
750
|
+
})
|
|
751
|
+
]
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
export { w as MarketplacePage };
|
|
755
|
+
|
|
756
|
+
//# sourceMappingURL=MarketplacePage.js.map
|