@burdenoff/microfe-comradecircle 2026.827.1 → 2026.830.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/comradecircle/components/AvatarUploadField.js +8 -8
- package/dist/comradecircle/components/CircleCard.js +4 -4
- package/dist/comradecircle/components/CommentThread.d.ts.map +1 -1
- package/dist/comradecircle/components/CommentThread.js +66 -61
- package/dist/comradecircle/components/CommentThread.js.map +1 -1
- package/dist/comradecircle/components/CreateCircleDialog.d.ts.map +1 -1
- package/dist/comradecircle/components/CreateCircleDialog.js +89 -88
- package/dist/comradecircle/components/CreateCircleDialog.js.map +1 -1
- package/dist/comradecircle/components/CreateEventDialog.d.ts.map +1 -1
- package/dist/comradecircle/components/CreateEventDialog.js +28 -27
- package/dist/comradecircle/components/CreateEventDialog.js.map +1 -1
- package/dist/comradecircle/components/DraftsPanel.js +13 -13
- package/dist/comradecircle/components/EventCard.js +5 -5
- package/dist/comradecircle/components/FileImage.js +5 -5
- package/dist/comradecircle/components/ImageAttachments.js +21 -21
- package/dist/comradecircle/components/MemberIdentity.js +4 -4
- package/dist/comradecircle/components/MobileBottomNav.d.ts.map +1 -1
- package/dist/comradecircle/components/MobileBottomNav.js +37 -30
- package/dist/comradecircle/components/MobileBottomNav.js.map +1 -1
- package/dist/comradecircle/components/Pagination.d.ts.map +1 -1
- package/dist/comradecircle/components/Pagination.js +37 -28
- package/dist/comradecircle/components/Pagination.js.map +1 -1
- package/dist/comradecircle/components/PollCard.js +13 -13
- package/dist/comradecircle/components/PostCard.d.ts.map +1 -1
- package/dist/comradecircle/components/PostCard.js +102 -89
- package/dist/comradecircle/components/PostCard.js.map +1 -1
- package/dist/comradecircle/components/PostComposer.js +4 -4
- package/dist/comradecircle/components/ReactionBar.d.ts.map +1 -1
- package/dist/comradecircle/components/ReactionBar.js +65 -55
- package/dist/comradecircle/components/ReactionBar.js.map +1 -1
- package/dist/comradecircle/components/StateViews.d.ts.map +1 -1
- package/dist/comradecircle/components/StateViews.js +38 -30
- package/dist/comradecircle/components/StateViews.js.map +1 -1
- package/dist/comradecircle/components/UpcomingEvents.js +17 -17
- package/dist/comradecircle/hooks/index.d.ts +1 -0
- package/dist/comradecircle/hooks/index.d.ts.map +1 -1
- package/dist/comradecircle/hooks/index.js +1 -0
- package/dist/comradecircle/hooks/useTr.d.ts +18 -0
- package/dist/comradecircle/hooks/useTr.d.ts.map +1 -0
- package/dist/comradecircle/hooks/useTr.js +12 -0
- package/dist/comradecircle/hooks/useTr.js.map +1 -0
- package/dist/comradecircle/pages/FeedPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/FeedPage.js +75 -62
- package/dist/comradecircle/pages/FeedPage.js.map +1 -1
- package/dist/comradecircle/pages/circles/CircleDetailPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/circles/CircleDetailPage.js +439 -401
- package/dist/comradecircle/pages/circles/CircleDetailPage.js.map +1 -1
- package/dist/comradecircle/pages/circles/CirclesPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/circles/CirclesPage.js +124 -117
- package/dist/comradecircle/pages/circles/CirclesPage.js.map +1 -1
- package/dist/comradecircle/pages/events/EventDetailPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/events/EventDetailPage.js +182 -153
- package/dist/comradecircle/pages/events/EventDetailPage.js.map +1 -1
- package/dist/comradecircle/pages/events/EventsPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/events/EventsPage.js +100 -91
- package/dist/comradecircle/pages/events/EventsPage.js.map +1 -1
- package/dist/comradecircle/pages/members/MemberProfilePage.d.ts.map +1 -1
- package/dist/comradecircle/pages/members/MemberProfilePage.js +172 -159
- package/dist/comradecircle/pages/members/MemberProfilePage.js.map +1 -1
- package/dist/comradecircle/pages/members/MembersPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/members/MembersPage.js +103 -104
- package/dist/comradecircle/pages/members/MembersPage.js.map +1 -1
- package/dist/comradecircle/pages/monetization/MonetizationPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/monetization/MonetizationPage.js +319 -297
- package/dist/comradecircle/pages/monetization/MonetizationPage.js.map +1 -1
- package/dist/comradecircle/pages/posts/PostThreadPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/posts/PostThreadPage.js +37 -32
- package/dist/comradecircle/pages/posts/PostThreadPage.js.map +1 -1
- package/dist/comradecircle/pages/profile/MyProfilePage.d.ts.map +1 -1
- package/dist/comradecircle/pages/profile/MyProfilePage.js +182 -177
- package/dist/comradecircle/pages/profile/MyProfilePage.js.map +1 -1
- package/dist/comradecircle/utils/i18n.js +15 -0
- package/dist/comradecircle/utils/i18n.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,37 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { useComArchiveDigitalProduct as n, useComArchiveMembershipTier as r, useComArchivePaidEvent as i, useComCreateDigitalProduct as a, useComCreateMembershipTier as o, useComCreatePaidEvent as s, useComMyDigitalProducts as c, useComMyMembershipTiers as l, useComMyPaidEvents as u, useComMyReceivedTips as d, useComUpdatePaidEvent as f } from "../../hooks/useComradeCircleApi.js";
|
|
1
|
+
import { useComArchiveDigitalProduct as e, useComArchiveMembershipTier as t, useComArchivePaidEvent as n, useComCreateDigitalProduct as r, useComCreateMembershipTier as i, useComCreatePaidEvent as a, useComMyDigitalProducts as o, useComMyMembershipTiers as s, useComMyPaidEvents as c, useComMyReceivedTips as l, useComUpdatePaidEvent as u } from "../../hooks/useComradeCircleApi.js";
|
|
2
|
+
import { useTr as d } from "../../hooks/useTr.js";
|
|
4
3
|
import "../../hooks/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
4
|
+
import { cn as f } from "../../utils/cn.js";
|
|
5
|
+
import { PageLayout as p } from "../../components/PageLayout.js";
|
|
6
|
+
import { describeError as m, notify as h } from "../../lib/toast.js";
|
|
7
|
+
import { EmptyState as g } from "../../components/EmptyState.js";
|
|
8
|
+
import { ErrorView as _, LoadingView as v } from "../../components/StateViews.js";
|
|
9
|
+
import { useState as y } from "react";
|
|
10
|
+
import { Coins as b, Gift as x, Package as S, Plus as C, Ticket as w, Trash2 as T, Users as E } from "lucide-react";
|
|
11
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
12
|
+
import { Badge as k, Button as A, GlassCard as j, Input as M, Label as N, Textarea as P } from "@burdenoff/fe-libs/ui";
|
|
12
13
|
//#region src/comradecircle/pages/monetization/MonetizationPage.tsx
|
|
13
|
-
var P = [
|
|
14
|
-
{
|
|
15
|
-
id: "tiers",
|
|
16
|
-
label: "Membership tiers",
|
|
17
|
-
icon: T
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
id: "events",
|
|
21
|
-
label: "Paid events",
|
|
22
|
-
icon: C
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "products",
|
|
26
|
-
label: "Digital products",
|
|
27
|
-
icon: x
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: "tips",
|
|
31
|
-
label: "Tips received",
|
|
32
|
-
icon: b
|
|
33
|
-
}
|
|
34
|
-
];
|
|
35
14
|
function F(e, t) {
|
|
36
15
|
try {
|
|
37
16
|
return new Intl.NumberFormat(void 0, {
|
|
@@ -43,41 +22,41 @@ function F(e, t) {
|
|
|
43
22
|
}
|
|
44
23
|
}
|
|
45
24
|
function I({ children: e }) {
|
|
46
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ D("p", {
|
|
47
26
|
className: "text-xs font-semibold uppercase tracking-[0.08em] text-text-tertiary",
|
|
48
27
|
children: e
|
|
49
28
|
});
|
|
50
29
|
}
|
|
51
|
-
function L({ title: e, subtitle: t, price: n, statusLabel: r, statusTone: i, onArchive: a, archiving: o, archiveLabel: s
|
|
52
|
-
return /* @__PURE__ */
|
|
30
|
+
function L({ title: e, subtitle: t, price: n, statusLabel: r, statusTone: i, onArchive: a, archiving: o, archiveLabel: s }) {
|
|
31
|
+
return /* @__PURE__ */ O("div", {
|
|
53
32
|
className: "flex flex-col gap-3 rounded-xl border border-border-seam bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between",
|
|
54
|
-
children: [/* @__PURE__ */
|
|
33
|
+
children: [/* @__PURE__ */ O("div", {
|
|
55
34
|
className: "min-w-0",
|
|
56
|
-
children: [/* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ O("div", {
|
|
57
36
|
className: "flex flex-wrap items-center gap-2",
|
|
58
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ D("h4", {
|
|
59
38
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
60
39
|
children: e
|
|
61
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ D(k, {
|
|
62
41
|
variant: i === "positive" ? "default" : i === "negative" ? "destructive" : "secondary",
|
|
63
42
|
children: r
|
|
64
43
|
})]
|
|
65
|
-
}), t && /* @__PURE__ */
|
|
44
|
+
}), t && /* @__PURE__ */ D("p", {
|
|
66
45
|
className: "mt-1 truncate text-xs text-text-secondary",
|
|
67
46
|
children: t
|
|
68
47
|
})]
|
|
69
|
-
}), /* @__PURE__ */
|
|
48
|
+
}), /* @__PURE__ */ O("div", {
|
|
70
49
|
className: "flex shrink-0 items-center gap-3",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
50
|
+
children: [/* @__PURE__ */ D("span", {
|
|
72
51
|
className: "text-sm font-semibold tabular-nums text-text-primary",
|
|
73
52
|
children: n
|
|
74
|
-
}), a && /* @__PURE__ */
|
|
53
|
+
}), a && /* @__PURE__ */ O(A, {
|
|
75
54
|
variant: "ghost",
|
|
76
55
|
size: "sm",
|
|
77
56
|
onClick: a,
|
|
78
57
|
disabled: o,
|
|
79
58
|
children: [
|
|
80
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ D(T, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
81
60
|
" ",
|
|
82
61
|
s
|
|
83
62
|
]
|
|
@@ -86,85 +65,85 @@ function L({ title: e, subtitle: t, price: n, statusLabel: r, statusTone: i, onA
|
|
|
86
65
|
});
|
|
87
66
|
}
|
|
88
67
|
function R({ onDone: e }) {
|
|
89
|
-
let t =
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
onSubmit: async (
|
|
92
|
-
|
|
93
|
-
let
|
|
94
|
-
if (!
|
|
95
|
-
|
|
68
|
+
let t = d(), n = i(), [r, a] = y(""), [o, s] = y(""), [c, l] = y("");
|
|
69
|
+
return /* @__PURE__ */ O("form", {
|
|
70
|
+
onSubmit: async (i) => {
|
|
71
|
+
i.preventDefault();
|
|
72
|
+
let u = Number(c);
|
|
73
|
+
if (!r.trim()) {
|
|
74
|
+
h.error(t("comradecircle.pages.monetization.tierNameRequired", "Name required"), t("comradecircle.pages.monetization.tierNameRequiredHint", "Give your tier a name."));
|
|
96
75
|
return;
|
|
97
76
|
}
|
|
98
|
-
if (!Number.isFinite(
|
|
99
|
-
|
|
77
|
+
if (!Number.isFinite(u) || u < 0) {
|
|
78
|
+
h.error(t("comradecircle.pages.monetization.tierPriceInvalid", "Invalid price"), t("comradecircle.pages.monetization.tierPriceInvalidHint", "Enter a price of 0 or more."));
|
|
100
79
|
return;
|
|
101
80
|
}
|
|
102
81
|
try {
|
|
103
|
-
await
|
|
104
|
-
name:
|
|
105
|
-
description:
|
|
106
|
-
priceAmount:
|
|
82
|
+
await n.mutateAsync({
|
|
83
|
+
name: r.trim(),
|
|
84
|
+
description: o.trim() || null,
|
|
85
|
+
priceAmount: u,
|
|
107
86
|
billingInterval: "MONTHLY"
|
|
108
|
-
}),
|
|
87
|
+
}), h.success(t("comradecircle.pages.monetization.tierCreated", "Membership tier created")), a(""), s(""), l(""), e();
|
|
109
88
|
} catch (e) {
|
|
110
|
-
|
|
89
|
+
h.error(t("comradecircle.pages.monetization.tierCreateError", "Could not create tier"), m(e));
|
|
111
90
|
}
|
|
112
91
|
},
|
|
113
92
|
className: "grid gap-3 rounded-xl border border-border-seam bg-bg-surface p-4",
|
|
114
93
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ O("div", {
|
|
116
95
|
className: "grid gap-3 sm:grid-cols-[2fr_1fr]",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ O("div", {
|
|
118
97
|
className: "grid gap-1.5",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ D(N, {
|
|
120
99
|
htmlFor: "tier-name",
|
|
121
|
-
children: "Tier name"
|
|
122
|
-
}), /* @__PURE__ */
|
|
100
|
+
children: t("comradecircle.pages.monetization.tierNameLabel", "Tier name")
|
|
101
|
+
}), /* @__PURE__ */ D(M, {
|
|
123
102
|
id: "tier-name",
|
|
124
|
-
value:
|
|
125
|
-
onChange: (e) =>
|
|
126
|
-
placeholder: "e.g. Supporter",
|
|
103
|
+
value: r,
|
|
104
|
+
onChange: (e) => a(e.target.value),
|
|
105
|
+
placeholder: t("comradecircle.pages.monetization.tierNamePlaceholder", "e.g. Supporter"),
|
|
127
106
|
required: !0
|
|
128
107
|
})]
|
|
129
|
-
}), /* @__PURE__ */
|
|
108
|
+
}), /* @__PURE__ */ O("div", {
|
|
130
109
|
className: "grid gap-1.5",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ D(N, {
|
|
132
111
|
htmlFor: "tier-price",
|
|
133
|
-
children: "Price / month (USD)"
|
|
134
|
-
}), /* @__PURE__ */
|
|
112
|
+
children: t("comradecircle.pages.monetization.tierPriceLabel", "Price / month (USD)")
|
|
113
|
+
}), /* @__PURE__ */ D(M, {
|
|
135
114
|
id: "tier-price",
|
|
136
115
|
type: "number",
|
|
137
116
|
min: "0",
|
|
138
117
|
step: "0.01",
|
|
139
|
-
value:
|
|
140
|
-
onChange: (e) =>
|
|
141
|
-
placeholder: "4.99",
|
|
118
|
+
value: c,
|
|
119
|
+
onChange: (e) => l(e.target.value),
|
|
120
|
+
placeholder: t("comradecircle.pages.monetization.tierPricePlaceholder", "4.99"),
|
|
142
121
|
required: !0
|
|
143
122
|
})]
|
|
144
123
|
})]
|
|
145
124
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ O("div", {
|
|
147
126
|
className: "grid gap-1.5",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ D(N, {
|
|
149
128
|
htmlFor: "tier-description",
|
|
150
|
-
children: "Perks description"
|
|
151
|
-
}), /* @__PURE__ */
|
|
129
|
+
children: t("comradecircle.pages.monetization.tierDescriptionLabel", "Perks description")
|
|
130
|
+
}), /* @__PURE__ */ D(P, {
|
|
152
131
|
id: "tier-description",
|
|
153
|
-
value:
|
|
154
|
-
onChange: (e) =>
|
|
132
|
+
value: o,
|
|
133
|
+
onChange: (e) => s(e.target.value),
|
|
155
134
|
rows: 2,
|
|
156
|
-
placeholder: "What supporters get at this tier"
|
|
135
|
+
placeholder: t("comradecircle.pages.monetization.tierDescriptionPlaceholder", "What supporters get at this tier")
|
|
157
136
|
})]
|
|
158
137
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ D("div", {
|
|
160
139
|
className: "flex justify-end",
|
|
161
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ O(A, {
|
|
162
141
|
type: "submit",
|
|
163
|
-
disabled:
|
|
142
|
+
disabled: n.isPending,
|
|
164
143
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ D(C, { className: "mr-1.5 h-4 w-4" }),
|
|
166
145
|
" ",
|
|
167
|
-
|
|
146
|
+
n.isPending ? t("comradecircle.pages.monetization.creating", "Creating…") : t("comradecircle.pages.monetization.createTier", "Create tier")
|
|
168
147
|
]
|
|
169
148
|
})
|
|
170
149
|
})
|
|
@@ -172,292 +151,305 @@ function R({ onDone: e }) {
|
|
|
172
151
|
});
|
|
173
152
|
}
|
|
174
153
|
function z() {
|
|
175
|
-
let { data:
|
|
154
|
+
let e = d(), { data: n, isLoading: r, isError: i, refetch: a } = s(), o = t(), [c, l] = y(!1), u = n?.items ?? [], f = async (t) => {
|
|
176
155
|
try {
|
|
177
|
-
await
|
|
178
|
-
} catch (
|
|
179
|
-
|
|
156
|
+
await o.mutateAsync(t.id), h.success(e("comradecircle.pages.monetization.tierArchived", "Tier archived"), t.name);
|
|
157
|
+
} catch (t) {
|
|
158
|
+
h.error(e("comradecircle.pages.monetization.tierArchiveError", "Could not archive tier"), m(t));
|
|
180
159
|
}
|
|
181
160
|
};
|
|
182
|
-
return
|
|
183
|
-
message: "We couldn't load your membership tiers.",
|
|
184
|
-
onRetry: () =>
|
|
185
|
-
}) : /* @__PURE__ */
|
|
161
|
+
return r ? /* @__PURE__ */ D(v, { label: e("comradecircle.pages.monetization.loadingTiers", "Loading your membership tiers…") }) : i ? /* @__PURE__ */ D(_, {
|
|
162
|
+
message: e("comradecircle.pages.monetization.tiersError", "We couldn't load your membership tiers."),
|
|
163
|
+
onRetry: () => a()
|
|
164
|
+
}) : /* @__PURE__ */ O("div", {
|
|
186
165
|
className: "flex flex-col gap-4",
|
|
187
166
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ O("div", {
|
|
189
168
|
className: "flex items-center justify-between",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ D(I, { children: e("comradecircle.pages.monetization.tiersSectionLabel", "Your membership tiers") }), /* @__PURE__ */ O(A, {
|
|
191
170
|
variant: "outline",
|
|
192
171
|
size: "sm",
|
|
193
|
-
onClick: () =>
|
|
194
|
-
children: [
|
|
172
|
+
onClick: () => l((e) => !e),
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ D(C, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
175
|
+
" ",
|
|
176
|
+
e("comradecircle.pages.monetization.newTier", "New tier")
|
|
177
|
+
]
|
|
195
178
|
})]
|
|
196
179
|
}),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
icon: /* @__PURE__ */ E
|
|
200
|
-
title: "No membership tiers yet",
|
|
201
|
-
description: "Create a tier so fans can support you on a recurring basis."
|
|
202
|
-
}) : /* @__PURE__ */
|
|
180
|
+
c && /* @__PURE__ */ D(R, { onDone: () => l(!1) }),
|
|
181
|
+
u.length === 0 ? /* @__PURE__ */ D(g, {
|
|
182
|
+
icon: /* @__PURE__ */ D(E, { className: "h-10 w-10" }),
|
|
183
|
+
title: e("comradecircle.pages.monetization.noTiersTitle", "No membership tiers yet"),
|
|
184
|
+
description: e("comradecircle.pages.monetization.noTiersDescription", "Create a tier so fans can support you on a recurring basis.")
|
|
185
|
+
}) : /* @__PURE__ */ D("div", {
|
|
203
186
|
className: "flex flex-col gap-3",
|
|
204
|
-
children:
|
|
205
|
-
title:
|
|
206
|
-
subtitle:
|
|
207
|
-
price: `${F(
|
|
208
|
-
statusLabel:
|
|
209
|
-
statusTone:
|
|
210
|
-
onArchive:
|
|
211
|
-
archiving:
|
|
212
|
-
|
|
187
|
+
children: u.map((t) => /* @__PURE__ */ D(L, {
|
|
188
|
+
title: t.name,
|
|
189
|
+
subtitle: t.description,
|
|
190
|
+
price: `${F(t.priceAmount, t.currency)}/${t.billingInterval === "YEARLY" ? "yr" : "mo"}`,
|
|
191
|
+
statusLabel: t.status,
|
|
192
|
+
statusTone: t.status === "ACTIVE" ? "positive" : "neutral",
|
|
193
|
+
onArchive: t.status === "ACTIVE" ? () => f(t) : void 0,
|
|
194
|
+
archiving: o.isPending,
|
|
195
|
+
archiveLabel: e("comradecircle.pages.monetization.archive", "Archive")
|
|
196
|
+
}, t.id))
|
|
213
197
|
})
|
|
214
198
|
]
|
|
215
199
|
});
|
|
216
200
|
}
|
|
217
201
|
function B({ onDone: e }) {
|
|
218
|
-
let t =
|
|
219
|
-
return /* @__PURE__ */
|
|
220
|
-
onSubmit: async (
|
|
221
|
-
|
|
222
|
-
let
|
|
223
|
-
if (!
|
|
224
|
-
|
|
202
|
+
let t = d(), n = a(), [r, i] = y(""), [o, s] = y(""), [c, l] = y("");
|
|
203
|
+
return /* @__PURE__ */ O("form", {
|
|
204
|
+
onSubmit: async (a) => {
|
|
205
|
+
a.preventDefault();
|
|
206
|
+
let u = Number(o);
|
|
207
|
+
if (!r.trim()) {
|
|
208
|
+
h.error(t("comradecircle.pages.monetization.eventTitleRequired", "Title required"), t("comradecircle.pages.monetization.eventTitleRequiredHint", "Give your event a title."));
|
|
225
209
|
return;
|
|
226
210
|
}
|
|
227
|
-
if (!Number.isFinite(
|
|
228
|
-
|
|
211
|
+
if (!Number.isFinite(u) || u < 0) {
|
|
212
|
+
h.error(t("comradecircle.pages.monetization.eventPriceInvalid", "Invalid price"), t("comradecircle.pages.monetization.eventPriceInvalidHint", "Enter a ticket price of 0 or more."));
|
|
229
213
|
return;
|
|
230
214
|
}
|
|
231
215
|
try {
|
|
232
|
-
await
|
|
233
|
-
title:
|
|
234
|
-
priceAmount:
|
|
235
|
-
capacity:
|
|
236
|
-
}),
|
|
216
|
+
await n.mutateAsync({
|
|
217
|
+
title: r.trim(),
|
|
218
|
+
priceAmount: u,
|
|
219
|
+
capacity: c.trim() ? Number(c) : null
|
|
220
|
+
}), h.success(t("comradecircle.pages.monetization.eventCreated", "Paid event created as a draft"), t("comradecircle.pages.monetization.eventCreatedHint", "Publish it once you’re ready.")), i(""), s(""), l(""), e();
|
|
237
221
|
} catch (e) {
|
|
238
|
-
|
|
222
|
+
h.error(t("comradecircle.pages.monetization.eventCreateError", "Could not create event"), m(e));
|
|
239
223
|
}
|
|
240
224
|
},
|
|
241
225
|
className: "grid gap-3 rounded-xl border border-border-seam bg-bg-surface p-4",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ O("div", {
|
|
243
227
|
className: "grid gap-3 sm:grid-cols-[2fr_1fr_1fr]",
|
|
244
228
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ O("div", {
|
|
246
230
|
className: "grid gap-1.5",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ D(N, {
|
|
248
232
|
htmlFor: "event-title",
|
|
249
|
-
children: "Event title"
|
|
250
|
-
}), /* @__PURE__ */
|
|
233
|
+
children: t("comradecircle.pages.monetization.eventTitleLabel", "Event title")
|
|
234
|
+
}), /* @__PURE__ */ D(M, {
|
|
251
235
|
id: "event-title",
|
|
252
|
-
value:
|
|
253
|
-
onChange: (e) =>
|
|
236
|
+
value: r,
|
|
237
|
+
onChange: (e) => i(e.target.value),
|
|
254
238
|
required: !0
|
|
255
239
|
})]
|
|
256
240
|
}),
|
|
257
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ O("div", {
|
|
258
242
|
className: "grid gap-1.5",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ D(N, {
|
|
260
244
|
htmlFor: "event-price",
|
|
261
|
-
children: "Ticket price (USD)"
|
|
262
|
-
}), /* @__PURE__ */
|
|
245
|
+
children: t("comradecircle.pages.monetization.eventTicketPriceLabel", "Ticket price (USD)")
|
|
246
|
+
}), /* @__PURE__ */ D(M, {
|
|
263
247
|
id: "event-price",
|
|
264
248
|
type: "number",
|
|
265
249
|
min: "0",
|
|
266
250
|
step: "0.01",
|
|
267
|
-
value:
|
|
268
|
-
onChange: (e) =>
|
|
251
|
+
value: o,
|
|
252
|
+
onChange: (e) => s(e.target.value),
|
|
269
253
|
required: !0
|
|
270
254
|
})]
|
|
271
255
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ O("div", {
|
|
273
257
|
className: "grid gap-1.5",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ D(N, {
|
|
275
259
|
htmlFor: "event-capacity",
|
|
276
|
-
children: "Capacity (optional)"
|
|
277
|
-
}), /* @__PURE__ */
|
|
260
|
+
children: t("comradecircle.pages.monetization.eventCapacityLabel", "Capacity (optional)")
|
|
261
|
+
}), /* @__PURE__ */ D(M, {
|
|
278
262
|
id: "event-capacity",
|
|
279
263
|
type: "number",
|
|
280
264
|
min: "1",
|
|
281
|
-
value:
|
|
282
|
-
onChange: (e) =>
|
|
265
|
+
value: c,
|
|
266
|
+
onChange: (e) => l(e.target.value)
|
|
283
267
|
})]
|
|
284
268
|
})
|
|
285
269
|
]
|
|
286
|
-
}), /* @__PURE__ */
|
|
270
|
+
}), /* @__PURE__ */ D("div", {
|
|
287
271
|
className: "flex justify-end",
|
|
288
|
-
children: /* @__PURE__ */
|
|
272
|
+
children: /* @__PURE__ */ O(A, {
|
|
289
273
|
type: "submit",
|
|
290
|
-
disabled:
|
|
274
|
+
disabled: n.isPending,
|
|
291
275
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ D(C, { className: "mr-1.5 h-4 w-4" }),
|
|
293
277
|
" ",
|
|
294
|
-
|
|
278
|
+
n.isPending ? t("comradecircle.pages.monetization.creating", "Creating…") : t("comradecircle.pages.monetization.createEventDraft", "Create event (draft)")
|
|
295
279
|
]
|
|
296
280
|
})
|
|
297
281
|
})]
|
|
298
282
|
});
|
|
299
283
|
}
|
|
300
284
|
function V() {
|
|
301
|
-
let { data:
|
|
285
|
+
let e = d(), { data: t, isLoading: r, isError: i, refetch: a } = c(), o = u(), s = n(), [l, f] = y(!1), p = t?.items ?? [], b = async (t) => {
|
|
302
286
|
try {
|
|
303
|
-
await
|
|
304
|
-
id:
|
|
287
|
+
await o.mutateAsync({
|
|
288
|
+
id: t.id,
|
|
305
289
|
input: { status: "PUBLISHED" }
|
|
306
|
-
}),
|
|
307
|
-
} catch (
|
|
308
|
-
|
|
290
|
+
}), h.success(e("comradecircle.pages.monetization.eventPublished", "Event published"), t.title);
|
|
291
|
+
} catch (t) {
|
|
292
|
+
h.error(e("comradecircle.pages.monetization.eventPublishError", "Could not publish event"), m(t));
|
|
309
293
|
}
|
|
310
|
-
},
|
|
294
|
+
}, x = async (t) => {
|
|
311
295
|
try {
|
|
312
|
-
await
|
|
313
|
-
} catch (
|
|
314
|
-
|
|
296
|
+
await s.mutateAsync(t.id), h.success(e("comradecircle.pages.monetization.eventCancelled", "Event cancelled"), t.title);
|
|
297
|
+
} catch (t) {
|
|
298
|
+
h.error(e("comradecircle.pages.monetization.eventCancelError", "Could not cancel event"), m(t));
|
|
315
299
|
}
|
|
316
300
|
};
|
|
317
|
-
return
|
|
318
|
-
message: "We couldn't load your paid events.",
|
|
319
|
-
onRetry: () =>
|
|
320
|
-
}) : /* @__PURE__ */
|
|
301
|
+
return r ? /* @__PURE__ */ D(v, { label: e("comradecircle.pages.monetization.loadingEvents", "Loading your paid events…") }) : i ? /* @__PURE__ */ D(_, {
|
|
302
|
+
message: e("comradecircle.pages.monetization.eventsError", "We couldn't load your paid events."),
|
|
303
|
+
onRetry: () => a()
|
|
304
|
+
}) : /* @__PURE__ */ O("div", {
|
|
321
305
|
className: "flex flex-col gap-4",
|
|
322
306
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ O("div", {
|
|
324
308
|
className: "flex items-center justify-between",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
309
|
+
children: [/* @__PURE__ */ D(I, { children: e("comradecircle.pages.monetization.eventsSectionLabel", "Your paid events") }), /* @__PURE__ */ O(A, {
|
|
326
310
|
variant: "outline",
|
|
327
311
|
size: "sm",
|
|
328
|
-
onClick: () =>
|
|
329
|
-
children: [
|
|
312
|
+
onClick: () => f((e) => !e),
|
|
313
|
+
children: [
|
|
314
|
+
/* @__PURE__ */ D(C, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
315
|
+
" ",
|
|
316
|
+
e("comradecircle.pages.monetization.newEvent", "New event")
|
|
317
|
+
]
|
|
330
318
|
})]
|
|
331
319
|
}),
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
icon: /* @__PURE__ */
|
|
335
|
-
title: "No paid events yet",
|
|
336
|
-
description: "Create a ticketed event — it starts as a draft until you publish it."
|
|
337
|
-
}) : /* @__PURE__ */
|
|
320
|
+
l && /* @__PURE__ */ D(B, { onDone: () => f(!1) }),
|
|
321
|
+
p.length === 0 ? /* @__PURE__ */ D(g, {
|
|
322
|
+
icon: /* @__PURE__ */ D(w, { className: "h-10 w-10" }),
|
|
323
|
+
title: e("comradecircle.pages.monetization.noEventsTitle", "No paid events yet"),
|
|
324
|
+
description: e("comradecircle.pages.monetization.noEventsDescription", "Create a ticketed event — it starts as a draft until you publish it.")
|
|
325
|
+
}) : /* @__PURE__ */ D("div", {
|
|
338
326
|
className: "flex flex-col gap-3",
|
|
339
|
-
children:
|
|
327
|
+
children: p.map((t) => /* @__PURE__ */ O("div", {
|
|
340
328
|
className: "flex flex-col gap-3 rounded-xl border border-border-seam bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ O("div", {
|
|
342
330
|
className: "min-w-0",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ O("div", {
|
|
344
332
|
className: "flex flex-wrap items-center gap-2",
|
|
345
|
-
children: [/* @__PURE__ */
|
|
333
|
+
children: [/* @__PURE__ */ D("h4", {
|
|
346
334
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
347
|
-
children:
|
|
348
|
-
}), /* @__PURE__ */
|
|
349
|
-
variant:
|
|
350
|
-
children:
|
|
335
|
+
children: t.title
|
|
336
|
+
}), /* @__PURE__ */ D(k, {
|
|
337
|
+
variant: t.status === "PUBLISHED" ? "default" : t.status === "CANCELLED" ? "destructive" : "secondary",
|
|
338
|
+
children: t.status
|
|
351
339
|
})]
|
|
352
|
-
}),
|
|
340
|
+
}), t.capacity != null && /* @__PURE__ */ D("p", {
|
|
353
341
|
className: "mt-1 text-xs text-text-secondary",
|
|
354
|
-
children:
|
|
342
|
+
children: e("comradecircle.pages.monetization.eventCapacity", "Capacity: {{capacity}}", { capacity: t.capacity })
|
|
355
343
|
})]
|
|
356
|
-
}), /* @__PURE__ */
|
|
344
|
+
}), /* @__PURE__ */ O("div", {
|
|
357
345
|
className: "flex shrink-0 items-center gap-2",
|
|
358
346
|
children: [
|
|
359
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ D("span", {
|
|
360
348
|
className: "text-sm font-semibold tabular-nums text-text-primary",
|
|
361
|
-
children: F(
|
|
349
|
+
children: F(t.priceAmount, t.currency)
|
|
362
350
|
}),
|
|
363
|
-
|
|
351
|
+
t.status === "DRAFT" && /* @__PURE__ */ D(A, {
|
|
364
352
|
size: "sm",
|
|
365
|
-
onClick: () =>
|
|
366
|
-
disabled:
|
|
367
|
-
children: "Publish"
|
|
353
|
+
onClick: () => b(t),
|
|
354
|
+
disabled: o.isPending,
|
|
355
|
+
children: e("comradecircle.pages.monetization.publish", "Publish")
|
|
368
356
|
}),
|
|
369
|
-
|
|
357
|
+
t.status !== "CANCELLED" && /* @__PURE__ */ O(A, {
|
|
370
358
|
variant: "ghost",
|
|
371
359
|
size: "sm",
|
|
372
|
-
onClick: () =>
|
|
373
|
-
disabled:
|
|
374
|
-
children: [
|
|
360
|
+
onClick: () => x(t),
|
|
361
|
+
disabled: s.isPending,
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ D(T, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
364
|
+
" ",
|
|
365
|
+
e("comradecircle.pages.monetization.cancel", "Cancel")
|
|
366
|
+
]
|
|
375
367
|
})
|
|
376
368
|
]
|
|
377
369
|
})]
|
|
378
|
-
},
|
|
370
|
+
}, t.id))
|
|
379
371
|
})
|
|
380
372
|
]
|
|
381
373
|
});
|
|
382
374
|
}
|
|
383
375
|
function H({ onDone: e }) {
|
|
384
|
-
let t =
|
|
385
|
-
return /* @__PURE__ */
|
|
386
|
-
onSubmit: async (
|
|
387
|
-
|
|
388
|
-
let
|
|
389
|
-
if (!
|
|
390
|
-
|
|
376
|
+
let t = d(), n = r(), [i, a] = y(""), [o, s] = y(""), [c, l] = y("");
|
|
377
|
+
return /* @__PURE__ */ O("form", {
|
|
378
|
+
onSubmit: async (r) => {
|
|
379
|
+
r.preventDefault();
|
|
380
|
+
let u = Number(o);
|
|
381
|
+
if (!i.trim()) {
|
|
382
|
+
h.error(t("comradecircle.pages.monetization.productTitleRequired", "Title required"), t("comradecircle.pages.monetization.productTitleRequiredHint", "Give your product a title."));
|
|
391
383
|
return;
|
|
392
384
|
}
|
|
393
|
-
if (!Number.isFinite(
|
|
394
|
-
|
|
385
|
+
if (!Number.isFinite(u) || u < 0) {
|
|
386
|
+
h.error(t("comradecircle.pages.monetization.productPriceInvalid", "Invalid price"), t("comradecircle.pages.monetization.productPriceInvalidHint", "Enter a price of 0 or more."));
|
|
395
387
|
return;
|
|
396
388
|
}
|
|
397
389
|
try {
|
|
398
|
-
await
|
|
399
|
-
title:
|
|
400
|
-
description:
|
|
401
|
-
priceAmount:
|
|
390
|
+
await n.mutateAsync({
|
|
391
|
+
title: i.trim(),
|
|
392
|
+
description: c.trim() || null,
|
|
393
|
+
priceAmount: u,
|
|
402
394
|
productType: "DOWNLOAD"
|
|
403
|
-
}),
|
|
395
|
+
}), h.success(t("comradecircle.pages.monetization.productCreated", "Digital product created")), a(""), s(""), l(""), e();
|
|
404
396
|
} catch (e) {
|
|
405
|
-
|
|
397
|
+
h.error(t("comradecircle.pages.monetization.productCreateError", "Could not create product"), m(e));
|
|
406
398
|
}
|
|
407
399
|
},
|
|
408
400
|
className: "grid gap-3 rounded-xl border border-border-seam bg-bg-surface p-4",
|
|
409
401
|
children: [
|
|
410
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ O("div", {
|
|
411
403
|
className: "grid gap-3 sm:grid-cols-[2fr_1fr]",
|
|
412
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ O("div", {
|
|
413
405
|
className: "grid gap-1.5",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
406
|
+
children: [/* @__PURE__ */ D(N, {
|
|
415
407
|
htmlFor: "product-title",
|
|
416
|
-
children: "Product title"
|
|
417
|
-
}), /* @__PURE__ */
|
|
408
|
+
children: t("comradecircle.pages.monetization.productTitleLabel", "Product title")
|
|
409
|
+
}), /* @__PURE__ */ D(M, {
|
|
418
410
|
id: "product-title",
|
|
419
|
-
value:
|
|
420
|
-
onChange: (e) =>
|
|
411
|
+
value: i,
|
|
412
|
+
onChange: (e) => a(e.target.value),
|
|
421
413
|
required: !0
|
|
422
414
|
})]
|
|
423
|
-
}), /* @__PURE__ */
|
|
415
|
+
}), /* @__PURE__ */ O("div", {
|
|
424
416
|
className: "grid gap-1.5",
|
|
425
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ D(N, {
|
|
426
418
|
htmlFor: "product-price",
|
|
427
|
-
children: "Price (USD)"
|
|
428
|
-
}), /* @__PURE__ */
|
|
419
|
+
children: t("comradecircle.pages.monetization.productPriceLabel", "Price (USD)")
|
|
420
|
+
}), /* @__PURE__ */ D(M, {
|
|
429
421
|
id: "product-price",
|
|
430
422
|
type: "number",
|
|
431
423
|
min: "0",
|
|
432
424
|
step: "0.01",
|
|
433
|
-
value:
|
|
434
|
-
onChange: (e) =>
|
|
425
|
+
value: o,
|
|
426
|
+
onChange: (e) => s(e.target.value),
|
|
435
427
|
required: !0
|
|
436
428
|
})]
|
|
437
429
|
})]
|
|
438
430
|
}),
|
|
439
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ O("div", {
|
|
440
432
|
className: "grid gap-1.5",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
433
|
+
children: [/* @__PURE__ */ D(N, {
|
|
442
434
|
htmlFor: "product-description",
|
|
443
|
-
children: "Description"
|
|
444
|
-
}), /* @__PURE__ */
|
|
435
|
+
children: t("comradecircle.pages.monetization.productDescriptionLabel", "Description")
|
|
436
|
+
}), /* @__PURE__ */ D(P, {
|
|
445
437
|
id: "product-description",
|
|
446
|
-
value:
|
|
447
|
-
onChange: (e) =>
|
|
438
|
+
value: c,
|
|
439
|
+
onChange: (e) => l(e.target.value),
|
|
448
440
|
rows: 2,
|
|
449
|
-
placeholder: "What's included in this download"
|
|
441
|
+
placeholder: t("comradecircle.pages.monetization.productDescriptionPlaceholder", "What's included in this download")
|
|
450
442
|
})]
|
|
451
443
|
}),
|
|
452
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ D("div", {
|
|
453
445
|
className: "flex justify-end",
|
|
454
|
-
children: /* @__PURE__ */
|
|
446
|
+
children: /* @__PURE__ */ O(A, {
|
|
455
447
|
type: "submit",
|
|
456
|
-
disabled:
|
|
448
|
+
disabled: n.isPending,
|
|
457
449
|
children: [
|
|
458
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ D(C, { className: "mr-1.5 h-4 w-4" }),
|
|
459
451
|
" ",
|
|
460
|
-
|
|
452
|
+
n.isPending ? t("comradecircle.pages.monetization.creating", "Creating…") : t("comradecircle.pages.monetization.createProduct", "Create product")
|
|
461
453
|
]
|
|
462
454
|
})
|
|
463
455
|
})
|
|
@@ -465,85 +457,90 @@ function H({ onDone: e }) {
|
|
|
465
457
|
});
|
|
466
458
|
}
|
|
467
459
|
function U() {
|
|
468
|
-
let { data:
|
|
460
|
+
let t = d(), { data: n, isLoading: r, isError: i, refetch: a } = o(), s = e(), [c, l] = y(!1), u = n?.items ?? [], f = async (e) => {
|
|
469
461
|
try {
|
|
470
|
-
await
|
|
462
|
+
await s.mutateAsync(e.id), h.success(t("comradecircle.pages.monetization.productArchived", "Product archived"), e.title);
|
|
471
463
|
} catch (e) {
|
|
472
|
-
|
|
464
|
+
h.error(t("comradecircle.pages.monetization.productArchiveError", "Could not archive product"), m(e));
|
|
473
465
|
}
|
|
474
466
|
};
|
|
475
|
-
return
|
|
476
|
-
message: "We couldn't load your digital products.",
|
|
477
|
-
onRetry: () =>
|
|
478
|
-
}) : /* @__PURE__ */
|
|
467
|
+
return r ? /* @__PURE__ */ D(v, { label: t("comradecircle.pages.monetization.loadingProducts", "Loading your digital products…") }) : i ? /* @__PURE__ */ D(_, {
|
|
468
|
+
message: t("comradecircle.pages.monetization.productsError", "We couldn't load your digital products."),
|
|
469
|
+
onRetry: () => a()
|
|
470
|
+
}) : /* @__PURE__ */ O("div", {
|
|
479
471
|
className: "flex flex-col gap-4",
|
|
480
472
|
children: [
|
|
481
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ O("div", {
|
|
482
474
|
className: "flex items-center justify-between",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
475
|
+
children: [/* @__PURE__ */ D(I, { children: t("comradecircle.pages.monetization.productsSectionLabel", "Your digital products") }), /* @__PURE__ */ O(A, {
|
|
484
476
|
variant: "outline",
|
|
485
477
|
size: "sm",
|
|
486
|
-
onClick: () =>
|
|
487
|
-
children: [
|
|
478
|
+
onClick: () => l((e) => !e),
|
|
479
|
+
children: [
|
|
480
|
+
/* @__PURE__ */ D(C, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
481
|
+
" ",
|
|
482
|
+
t("comradecircle.pages.monetization.newProduct", "New product")
|
|
483
|
+
]
|
|
488
484
|
})]
|
|
489
485
|
}),
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
icon: /* @__PURE__ */
|
|
493
|
-
title: "No digital products yet",
|
|
494
|
-
description: "List a downloadable or access-gated product with a price."
|
|
495
|
-
}) : /* @__PURE__ */
|
|
486
|
+
c && /* @__PURE__ */ D(H, { onDone: () => l(!1) }),
|
|
487
|
+
u.length === 0 ? /* @__PURE__ */ D(g, {
|
|
488
|
+
icon: /* @__PURE__ */ D(S, { className: "h-10 w-10" }),
|
|
489
|
+
title: t("comradecircle.pages.monetization.noProductsTitle", "No digital products yet"),
|
|
490
|
+
description: t("comradecircle.pages.monetization.noProductsDescription", "List a downloadable or access-gated product with a price.")
|
|
491
|
+
}) : /* @__PURE__ */ D("div", {
|
|
496
492
|
className: "flex flex-col gap-3",
|
|
497
|
-
children:
|
|
493
|
+
children: u.map((e) => /* @__PURE__ */ D(L, {
|
|
498
494
|
title: e.title,
|
|
499
495
|
subtitle: e.description,
|
|
500
496
|
price: F(e.priceAmount, e.currency),
|
|
501
497
|
statusLabel: e.status,
|
|
502
498
|
statusTone: e.status === "ACTIVE" ? "positive" : "neutral",
|
|
503
|
-
onArchive: e.status === "ACTIVE" ? () =>
|
|
504
|
-
archiving:
|
|
499
|
+
onArchive: e.status === "ACTIVE" ? () => f(e) : void 0,
|
|
500
|
+
archiving: s.isPending,
|
|
501
|
+
archiveLabel: t("comradecircle.pages.monetization.archive", "Archive")
|
|
505
502
|
}, e.id))
|
|
506
503
|
})
|
|
507
504
|
]
|
|
508
505
|
});
|
|
509
506
|
}
|
|
510
507
|
function W() {
|
|
511
|
-
let { data:
|
|
512
|
-
return
|
|
513
|
-
message: "We couldn't load your tips.",
|
|
514
|
-
onRetry: () =>
|
|
515
|
-
}) : /* @__PURE__ */
|
|
508
|
+
let e = d(), { data: t, isLoading: n, isError: r, refetch: i } = l(), a = t?.items ?? [], o = a.filter((e) => e.status === "RECORDED").reduce((e, t) => e + t.amount, 0);
|
|
509
|
+
return n ? /* @__PURE__ */ D(v, { label: e("comradecircle.pages.monetization.loadingTips", "Loading tips received…") }) : r ? /* @__PURE__ */ D(_, {
|
|
510
|
+
message: e("comradecircle.pages.monetization.tipsError", "We couldn't load your tips."),
|
|
511
|
+
onRetry: () => i()
|
|
512
|
+
}) : /* @__PURE__ */ O("div", {
|
|
516
513
|
className: "flex flex-col gap-4",
|
|
517
|
-
children: [/* @__PURE__ */
|
|
514
|
+
children: [/* @__PURE__ */ O("div", {
|
|
518
515
|
className: "rounded-xl border border-border-seam bg-bg-surface p-4",
|
|
519
516
|
children: [
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ D(I, { children: e("comradecircle.pages.monetization.totalRecorded", "Total recorded (not yet payable)") }),
|
|
518
|
+
/* @__PURE__ */ D("p", {
|
|
522
519
|
className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
|
|
523
|
-
children: F(
|
|
520
|
+
children: F(o, a[0]?.currency ?? "USD")
|
|
524
521
|
}),
|
|
525
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ D("p", {
|
|
526
523
|
className: "mt-1 text-xs text-text-tertiary",
|
|
527
|
-
children: "These are recorded tip intents only — payment integration is pending, so no funds have actually moved yet."
|
|
524
|
+
children: e("comradecircle.pages.monetization.tipsPendingDisclaimer", "These are recorded tip intents only — payment integration is pending, so no funds have actually moved yet.")
|
|
528
525
|
})
|
|
529
526
|
]
|
|
530
|
-
}),
|
|
531
|
-
icon: /* @__PURE__ */
|
|
532
|
-
title: "No tips recorded yet",
|
|
533
|
-
description: "When fans tip you, the recorded intents will show up here."
|
|
534
|
-
}) : /* @__PURE__ */
|
|
527
|
+
}), a.length === 0 ? /* @__PURE__ */ D(g, {
|
|
528
|
+
icon: /* @__PURE__ */ D(x, { className: "h-10 w-10" }),
|
|
529
|
+
title: e("comradecircle.pages.monetization.noTipsTitle", "No tips recorded yet"),
|
|
530
|
+
description: e("comradecircle.pages.monetization.noTipsDescription", "When fans tip you, the recorded intents will show up here.")
|
|
531
|
+
}) : /* @__PURE__ */ D("div", {
|
|
535
532
|
className: "flex flex-col gap-3",
|
|
536
|
-
children:
|
|
533
|
+
children: a.map((e) => /* @__PURE__ */ O("div", {
|
|
537
534
|
className: "flex items-center justify-between gap-3 rounded-xl border border-border-seam bg-bg-surface p-4",
|
|
538
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ O("div", {
|
|
539
536
|
className: "min-w-0",
|
|
540
|
-
children: [/* @__PURE__ */
|
|
537
|
+
children: [/* @__PURE__ */ O("p", {
|
|
541
538
|
className: "text-sm font-medium text-text-primary",
|
|
542
|
-
children: [F(e.amount, e.currency), /* @__PURE__ */
|
|
539
|
+
children: [F(e.amount, e.currency), /* @__PURE__ */ D("span", {
|
|
543
540
|
className: "ml-2 text-xs font-normal text-text-tertiary",
|
|
544
541
|
children: new Date(e.createdAt).toLocaleDateString()
|
|
545
542
|
})]
|
|
546
|
-
}), e.message && /* @__PURE__ */
|
|
543
|
+
}), e.message && /* @__PURE__ */ O("p", {
|
|
547
544
|
className: "mt-1 truncate text-xs text-text-secondary",
|
|
548
545
|
children: [
|
|
549
546
|
"“",
|
|
@@ -551,7 +548,7 @@ function W() {
|
|
|
551
548
|
"”"
|
|
552
549
|
]
|
|
553
550
|
})]
|
|
554
|
-
}), /* @__PURE__ */
|
|
551
|
+
}), /* @__PURE__ */ D(k, {
|
|
555
552
|
variant: e.status === "RECORDED" ? "secondary" : "destructive",
|
|
556
553
|
children: e.status
|
|
557
554
|
})]
|
|
@@ -560,33 +557,58 @@ function W() {
|
|
|
560
557
|
});
|
|
561
558
|
}
|
|
562
559
|
function G() {
|
|
563
|
-
let [
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
560
|
+
let e = d(), [t, n] = y("tiers"), r = [
|
|
561
|
+
{
|
|
562
|
+
id: "tiers",
|
|
563
|
+
labelKey: "comradecircle.pages.monetization.tabTiers",
|
|
564
|
+
fallback: "Membership tiers",
|
|
565
|
+
icon: E
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
id: "events",
|
|
569
|
+
labelKey: "comradecircle.pages.monetization.tabEvents",
|
|
570
|
+
fallback: "Paid events",
|
|
571
|
+
icon: w
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
id: "products",
|
|
575
|
+
labelKey: "comradecircle.pages.monetization.tabProducts",
|
|
576
|
+
fallback: "Digital products",
|
|
577
|
+
icon: S
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
id: "tips",
|
|
581
|
+
labelKey: "comradecircle.pages.monetization.tabTips",
|
|
582
|
+
fallback: "Tips received",
|
|
583
|
+
icon: x
|
|
584
|
+
}
|
|
585
|
+
];
|
|
586
|
+
return /* @__PURE__ */ O(p, {
|
|
587
|
+
title: e("comradecircle.pages.monetization.title", "Monetization"),
|
|
588
|
+
description: e("comradecircle.pages.monetization.description", "Manage the membership tiers, paid events, and digital products you offer — and see the tips you've received. This is a pricing/catalog core: payment integration is pending, so no checkout is live yet."),
|
|
567
589
|
children: [
|
|
568
|
-
/* @__PURE__ */
|
|
590
|
+
/* @__PURE__ */ D(j, {
|
|
569
591
|
treatment: "plain",
|
|
570
592
|
className: "mb-5 flex flex-wrap gap-1 p-1.5",
|
|
571
|
-
children:
|
|
593
|
+
children: r.map(({ id: r, labelKey: i, fallback: a, icon: o }) => /* @__PURE__ */ O("button", {
|
|
572
594
|
type: "button",
|
|
573
|
-
onClick: () => r
|
|
574
|
-
className:
|
|
595
|
+
onClick: () => n(r),
|
|
596
|
+
className: f("flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs font-medium transition-colors", t === r ? "bg-[var(--color-accent-soft)] text-accent" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
575
597
|
children: [
|
|
576
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ D(o, { className: "h-4 w-4" }),
|
|
577
599
|
" ",
|
|
578
|
-
i
|
|
600
|
+
e(i, a)
|
|
579
601
|
]
|
|
580
|
-
},
|
|
602
|
+
}, r))
|
|
581
603
|
}),
|
|
582
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ O("div", {
|
|
583
605
|
className: "mb-5 flex items-center gap-2 rounded-xl border border-status-warning-border bg-status-warning-bg-subtle px-4 py-3 text-xs text-status-warning-text",
|
|
584
|
-
children: [/* @__PURE__ */
|
|
606
|
+
children: [/* @__PURE__ */ D(b, { className: "h-4 w-4 shrink-0" }), e("comradecircle.pages.monetization.paymentPendingBanner", "Payment integration pending — prices are informational until checkout goes live.")]
|
|
585
607
|
}),
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
608
|
+
t === "tiers" && /* @__PURE__ */ D(z, {}),
|
|
609
|
+
t === "events" && /* @__PURE__ */ D(V, {}),
|
|
610
|
+
t === "products" && /* @__PURE__ */ D(U, {}),
|
|
611
|
+
t === "tips" && /* @__PURE__ */ D(W, {})
|
|
590
612
|
]
|
|
591
613
|
});
|
|
592
614
|
}
|