@burdenoff/microfe-billing 2026.1112.1 → 2026.1112.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/billing/modules/affiliate/pages/AffiliateDashboardPage.js +182 -150
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +153 -126
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +110 -109
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +220 -181
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +160 -141
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/utils/planAction.d.ts +16 -0
- package/dist/billing/modules/plans/utils/planAction.js +16 -0
- package/dist/billing/modules/plans/utils/planAction.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { useBilling as e } from "../../../providers/BillingProvider.js";
|
|
2
2
|
import { AccessDenied as t } from "../../../shared/components/AccessDenied.js";
|
|
3
3
|
import { PageHeader as n } from "../../../shared/components/PageHeader.js";
|
|
4
|
-
import { StatCard as
|
|
5
|
-
import { ServerError as
|
|
4
|
+
import { StatCard as ee } from "../../../shared/components/StatCard.js";
|
|
5
|
+
import { ServerError as r } from "../../../shared/components/ServerError.js";
|
|
6
|
+
import { MoneyActionDialog as i } from "../../../shared/components/MoneyActionDialog.js";
|
|
6
7
|
import { useBillingEventEmitter as a } from "../../../hooks/useBillingEventEmitter.js";
|
|
7
|
-
import { useBillingPermissions as
|
|
8
|
-
import { formatCurrency as
|
|
9
|
-
import { isServerError as
|
|
8
|
+
import { useBillingPermissions as te } from "../../../hooks/useBillingPermissions.js";
|
|
9
|
+
import { formatCurrency as o, formatDateTime as s } from "../../../shared/utils/format.js";
|
|
10
|
+
import { isServerError as c } from "../../../shared/utils/error.js";
|
|
11
|
+
import { useIsFluidgridsVariant as l } from "../../../hooks/useBillingVariant.js";
|
|
10
12
|
import "../../../shared/components/index.js";
|
|
11
13
|
import "../../../shared/utils/index.js";
|
|
12
|
-
import { addAffiliateCodeNote as u, createAffiliateCode as d, deactivateAffiliateCode as f, fetchMyAffiliateAnalytics as p, fetchMyAffiliateCodes as
|
|
13
|
-
import { useCallback as
|
|
14
|
-
import { Link2 as
|
|
15
|
-
import { jsx as
|
|
16
|
-
import { CTAOverflowMenu as
|
|
14
|
+
import { addAffiliateCodeNote as u, createAffiliateCode as d, deactivateAffiliateCode as f, fetchMyAffiliateAnalytics as p, fetchMyAffiliateCodes as m, fetchMyAffiliateJourneys as h, updateAffiliateCode as g } from "../api.js";
|
|
15
|
+
import { useCallback as _, useEffect as v, useMemo as y, useState as b } from "react";
|
|
16
|
+
import { Link2 as ne, Plus as re, RefreshCw as ie, StickyNote as ae, Ticket as oe, TrendingUp as se, Users as ce } from "lucide-react";
|
|
17
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
18
|
+
import { CTAOverflowMenu as le, EmphasisPanel as ue, IllustratedEmptyState as C, PagePurpose as w, ResponsiveTable as T } from "@burdenoff/fe-libs/ui";
|
|
17
19
|
// src/billing/modules/affiliate/pages/AffiliateDashboardPage.tsx
|
|
18
|
-
var
|
|
20
|
+
var E = [
|
|
19
21
|
{
|
|
20
22
|
key: "code",
|
|
21
23
|
header: "Code",
|
|
@@ -45,90 +47,90 @@ var M = [
|
|
|
45
47
|
{
|
|
46
48
|
key: "visited",
|
|
47
49
|
header: "Visited",
|
|
48
|
-
cell: (e) =>
|
|
50
|
+
cell: (e) => s(e.lastVisitedAt)
|
|
49
51
|
}
|
|
50
|
-
],
|
|
51
|
-
let
|
|
52
|
+
], D = () => {
|
|
53
|
+
let s = te(), D = l(), [O, k] = b(null), [A, j] = b(!1), [M, N] = b(null), { emit: P } = a(), { apiGatewayUrl: F, authToken: I, orgId: L } = e(), [R, de] = b([]), [z, B] = b([]), [V, H] = b(null), [U, W] = b(!0), [G, K] = b(null), [fe, q] = b(null), [J, Y] = b({
|
|
52
54
|
label: "",
|
|
53
55
|
description: "",
|
|
54
56
|
notes: "",
|
|
55
57
|
productSlug: "",
|
|
56
58
|
destinationPath: "",
|
|
57
59
|
destinationUrl: ""
|
|
58
|
-
}),
|
|
59
|
-
apiGatewayUrl:
|
|
60
|
-
authToken:
|
|
61
|
-
orgId:
|
|
60
|
+
}), X = y(() => ({
|
|
61
|
+
apiGatewayUrl: F,
|
|
62
|
+
authToken: I,
|
|
63
|
+
orgId: L
|
|
62
64
|
}), [
|
|
63
|
-
P,
|
|
64
65
|
F,
|
|
65
|
-
I
|
|
66
|
-
|
|
66
|
+
I,
|
|
67
|
+
L
|
|
68
|
+
]), Z = _(async () => {
|
|
67
69
|
W(!0), K(null);
|
|
68
70
|
try {
|
|
69
71
|
let [e, t, n] = await Promise.all([
|
|
70
|
-
|
|
71
|
-
p(
|
|
72
|
-
|
|
72
|
+
m(X),
|
|
73
|
+
p(X),
|
|
74
|
+
h(X)
|
|
73
75
|
]);
|
|
74
|
-
|
|
76
|
+
de(e), H(t), B(n);
|
|
75
77
|
} catch (e) {
|
|
76
78
|
K(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load affiliate dashboard"));
|
|
77
79
|
} finally {
|
|
78
80
|
W(!1);
|
|
79
81
|
}
|
|
80
|
-
}, [
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
}, [
|
|
84
|
-
if (G &&
|
|
82
|
+
}, [X]);
|
|
83
|
+
if (v(() => {
|
|
84
|
+
Z();
|
|
85
|
+
}, [Z]), !s.canViewBillingAccount) return /* @__PURE__ */ x(t, { message: "You don't have permission to view affiliate analytics." });
|
|
86
|
+
if (G && c(G)) return /* @__PURE__ */ x(r, {
|
|
85
87
|
title: "Affiliate service unavailable",
|
|
86
88
|
message: G.message,
|
|
87
|
-
onRetry: () => void
|
|
89
|
+
onRetry: () => void Z(),
|
|
88
90
|
showRetry: !0
|
|
89
91
|
});
|
|
90
|
-
let
|
|
91
|
-
if (!
|
|
92
|
+
let Q = R.find((e) => e.id === fe) ?? null, pe = async () => {
|
|
93
|
+
if (!J.productSlug.trim()) K(/* @__PURE__ */ Error("Product slug is required"));
|
|
92
94
|
else try {
|
|
93
|
-
if (
|
|
94
|
-
label:
|
|
95
|
-
description:
|
|
96
|
-
notes:
|
|
97
|
-
destinationPath:
|
|
98
|
-
destinationUrl:
|
|
99
|
-
},
|
|
95
|
+
if (Q) await g(Q.id, {
|
|
96
|
+
label: J.label,
|
|
97
|
+
description: J.description,
|
|
98
|
+
notes: J.notes,
|
|
99
|
+
destinationPath: J.destinationPath,
|
|
100
|
+
destinationUrl: J.destinationUrl
|
|
101
|
+
}, X), P("billing.affiliate_code.updated", {
|
|
100
102
|
route: "/billing/affiliate",
|
|
101
|
-
entityId:
|
|
103
|
+
entityId: Q.id,
|
|
102
104
|
source: "affiliate-dashboard"
|
|
103
105
|
});
|
|
104
106
|
else {
|
|
105
107
|
let e = await d({
|
|
106
|
-
label:
|
|
107
|
-
description:
|
|
108
|
-
notes:
|
|
109
|
-
productSlug:
|
|
110
|
-
destinationPath:
|
|
111
|
-
destinationUrl:
|
|
112
|
-
},
|
|
113
|
-
|
|
108
|
+
label: J.label,
|
|
109
|
+
description: J.description,
|
|
110
|
+
notes: J.notes,
|
|
111
|
+
productSlug: J.productSlug,
|
|
112
|
+
destinationPath: J.destinationPath,
|
|
113
|
+
destinationUrl: J.destinationUrl
|
|
114
|
+
}, X);
|
|
115
|
+
P("billing.affiliate_code.created", {
|
|
114
116
|
route: "/billing/affiliate",
|
|
115
117
|
entityId: e.id,
|
|
116
118
|
source: "affiliate-dashboard"
|
|
117
119
|
});
|
|
118
120
|
}
|
|
119
|
-
|
|
121
|
+
q(null), Y({
|
|
120
122
|
label: "",
|
|
121
123
|
description: "",
|
|
122
124
|
notes: "",
|
|
123
125
|
productSlug: "",
|
|
124
126
|
destinationPath: "",
|
|
125
127
|
destinationUrl: ""
|
|
126
|
-
}), await
|
|
128
|
+
}), await Z();
|
|
127
129
|
} catch (e) {
|
|
128
130
|
K(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to save affiliate code"));
|
|
129
131
|
}
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
+
}, me = (e) => {
|
|
133
|
+
q(e.id), Y({
|
|
132
134
|
label: e.label ?? "",
|
|
133
135
|
description: e.description ?? "",
|
|
134
136
|
notes: e.notes ?? "",
|
|
@@ -136,141 +138,168 @@ var M = [
|
|
|
136
138
|
destinationPath: e.destinationPath ?? "",
|
|
137
139
|
destinationUrl: e.destinationUrl ?? ""
|
|
138
140
|
});
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
+
}, he = async () => {
|
|
142
|
+
if (O) {
|
|
143
|
+
j(!0), N(null);
|
|
144
|
+
try {
|
|
145
|
+
await $(O.id), k(null);
|
|
146
|
+
} catch (e) {
|
|
147
|
+
N(e instanceof Error ? e.message : "Could not deactivate this code.");
|
|
148
|
+
} finally {
|
|
149
|
+
j(!1);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}, $ = async (e) => {
|
|
153
|
+
await f(e, X), P("billing.affiliate_code.deactivated", {
|
|
141
154
|
route: "/billing/affiliate",
|
|
142
155
|
entityId: e,
|
|
143
156
|
source: "affiliate-dashboard"
|
|
144
|
-
}), await
|
|
145
|
-
},
|
|
157
|
+
}), await Z();
|
|
158
|
+
}, ge = async (e) => {
|
|
146
159
|
let t = window.prompt("Add an internal note for this affiliate code");
|
|
147
|
-
t && (await u(e, t,
|
|
160
|
+
t && (await u(e, t, X), P("billing.affiliate_code.note_added", {
|
|
148
161
|
route: "/billing/affiliate",
|
|
149
162
|
entityId: e,
|
|
150
163
|
source: "affiliate-dashboard"
|
|
151
|
-
}), await
|
|
152
|
-
},
|
|
164
|
+
}), await Z());
|
|
165
|
+
}, _e = V ? [
|
|
153
166
|
{
|
|
154
167
|
title: "Codes",
|
|
155
168
|
value: V.totalCodes,
|
|
156
|
-
icon: /* @__PURE__ */
|
|
169
|
+
icon: /* @__PURE__ */ x(oe, { className: "size-5" })
|
|
157
170
|
},
|
|
158
171
|
{
|
|
159
172
|
title: "Visits",
|
|
160
173
|
value: V.totalVisits,
|
|
161
|
-
icon: /* @__PURE__ */
|
|
174
|
+
icon: /* @__PURE__ */ x(ce, { className: "size-5" })
|
|
162
175
|
},
|
|
163
176
|
{
|
|
164
177
|
title: "Journeys",
|
|
165
178
|
value: V.totalJourneys,
|
|
166
|
-
icon: /* @__PURE__ */
|
|
179
|
+
icon: /* @__PURE__ */ x(ne, { className: "size-5" })
|
|
167
180
|
},
|
|
168
181
|
{
|
|
169
182
|
title: "Revenue influenced",
|
|
170
|
-
value:
|
|
171
|
-
icon: /* @__PURE__ */
|
|
183
|
+
value: o(V.totalRevenueAmount, "USD"),
|
|
184
|
+
icon: /* @__PURE__ */ x(se, { className: "size-5" })
|
|
172
185
|
}
|
|
173
186
|
] : [];
|
|
174
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ S("div", {
|
|
175
188
|
className: "space-y-6 p-6",
|
|
176
189
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
190
|
+
D && /* @__PURE__ */ x(i, {
|
|
191
|
+
open: O !== null,
|
|
192
|
+
tone: "danger",
|
|
193
|
+
title: "Deactivate this affiliate code?",
|
|
194
|
+
description: "The code stops tracking new visits straight away. Visits and journeys already recorded are kept.",
|
|
195
|
+
details: [{
|
|
196
|
+
label: "Code",
|
|
197
|
+
value: O?.label ?? ""
|
|
198
|
+
}],
|
|
199
|
+
confirmLabel: "Deactivate code",
|
|
200
|
+
busyLabel: "Deactivating…",
|
|
201
|
+
isBusy: A,
|
|
202
|
+
error: M,
|
|
203
|
+
onConfirm: () => void he(),
|
|
204
|
+
onCancel: () => k(null)
|
|
205
|
+
}),
|
|
206
|
+
/* @__PURE__ */ x(n, {
|
|
178
207
|
title: "Affiliate codes",
|
|
179
208
|
description: "Create referral codes, add internal notes, and monitor attributed journeys.",
|
|
180
|
-
actions: /* @__PURE__ */
|
|
209
|
+
actions: /* @__PURE__ */ x(le, { actions: [{
|
|
181
210
|
label: "Refresh",
|
|
182
|
-
onSelect: () => void
|
|
183
|
-
icon: /* @__PURE__ */
|
|
211
|
+
onSelect: () => void Z(),
|
|
212
|
+
icon: /* @__PURE__ */ x(ie, { className: "size-4" })
|
|
184
213
|
}] })
|
|
185
214
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
U ? /* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ x(w, { children: "Generate referral links for any product, share them, and see exactly what they drive — visits, signups, paid conversions and the rewards you have earned. Create and manage your codes on the left and watch attributed visitor journeys on the right." }),
|
|
216
|
+
U ? /* @__PURE__ */ x("div", {
|
|
188
217
|
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
|
|
189
218
|
children: [
|
|
190
219
|
1,
|
|
191
220
|
2,
|
|
192
221
|
3,
|
|
193
222
|
4
|
|
194
|
-
].map((e) => /* @__PURE__ */
|
|
195
|
-
}) : V ? /* @__PURE__ */
|
|
223
|
+
].map((e) => /* @__PURE__ */ x("div", { className: "h-28 animate-pulse rounded-lg border border-border-subtle bg-bg-surface" }, e))
|
|
224
|
+
}) : V ? /* @__PURE__ */ x(ue, {
|
|
196
225
|
className: "p-4 sm:p-5",
|
|
197
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ x("div", {
|
|
198
227
|
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
|
|
199
|
-
children:
|
|
228
|
+
children: _e.map((e) => /* @__PURE__ */ x(ee, {
|
|
200
229
|
label: e.title,
|
|
201
230
|
value: e.value,
|
|
202
231
|
icon: e.icon
|
|
203
232
|
}, e.title))
|
|
204
233
|
})
|
|
205
234
|
}) : null,
|
|
206
|
-
G && !
|
|
235
|
+
G && !c(G) ? /* @__PURE__ */ x("div", {
|
|
207
236
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text",
|
|
208
237
|
children: G.message
|
|
209
238
|
}) : null,
|
|
210
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ S("div", {
|
|
211
240
|
className: "grid gap-6 xl:grid-cols-[1.1fr,1.9fr]",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ S("section", {
|
|
213
242
|
className: "rounded-lg border border-border-seam bg-bg-surface p-4 xl:sticky xl:top-6 xl:self-start",
|
|
214
243
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ S("div", {
|
|
216
245
|
className: "mb-4 flex items-center justify-between",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
218
247
|
className: "text-lg font-semibold text-text-primary",
|
|
219
|
-
children:
|
|
220
|
-
}),
|
|
248
|
+
children: Q ? "Update affiliate code" : "Create affiliate code"
|
|
249
|
+
}), Q ? null : /* @__PURE__ */ x(re, { className: "size-4 text-text-secondary" })]
|
|
221
250
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ S("div", {
|
|
223
252
|
className: "space-y-3",
|
|
224
253
|
children: [
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
value:
|
|
227
|
-
onChange: (e) =>
|
|
254
|
+
/* @__PURE__ */ x("input", {
|
|
255
|
+
value: J.label,
|
|
256
|
+
onChange: (e) => Y((t) => ({
|
|
228
257
|
...t,
|
|
229
258
|
label: e.target.value
|
|
230
259
|
})),
|
|
231
260
|
placeholder: "Label",
|
|
232
261
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
233
262
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
value:
|
|
236
|
-
onChange: (e) =>
|
|
263
|
+
/* @__PURE__ */ x("input", {
|
|
264
|
+
value: J.productSlug,
|
|
265
|
+
onChange: (e) => Y((t) => ({
|
|
237
266
|
...t,
|
|
238
267
|
productSlug: e.target.value
|
|
239
268
|
})),
|
|
240
269
|
placeholder: "Product slug (eg. bigconsole)",
|
|
241
270
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
242
|
-
disabled:
|
|
271
|
+
disabled: !!Q
|
|
243
272
|
}),
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
value:
|
|
246
|
-
onChange: (e) =>
|
|
273
|
+
/* @__PURE__ */ x("input", {
|
|
274
|
+
value: J.destinationPath,
|
|
275
|
+
onChange: (e) => Y((t) => ({
|
|
247
276
|
...t,
|
|
248
277
|
destinationPath: e.target.value
|
|
249
278
|
})),
|
|
250
279
|
placeholder: "Destination path (eg. /pricing)",
|
|
251
280
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
252
281
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
value:
|
|
255
|
-
onChange: (e) =>
|
|
282
|
+
/* @__PURE__ */ x("input", {
|
|
283
|
+
value: J.destinationUrl,
|
|
284
|
+
onChange: (e) => Y((t) => ({
|
|
256
285
|
...t,
|
|
257
286
|
destinationUrl: e.target.value
|
|
258
287
|
})),
|
|
259
288
|
placeholder: "Absolute destination URL (optional)",
|
|
260
289
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
261
290
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
value:
|
|
264
|
-
onChange: (e) =>
|
|
291
|
+
/* @__PURE__ */ x("textarea", {
|
|
292
|
+
value: J.description,
|
|
293
|
+
onChange: (e) => Y((t) => ({
|
|
265
294
|
...t,
|
|
266
295
|
description: e.target.value
|
|
267
296
|
})),
|
|
268
297
|
placeholder: "Description",
|
|
269
298
|
className: "min-h-24 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
270
299
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
value:
|
|
273
|
-
onChange: (e) =>
|
|
300
|
+
/* @__PURE__ */ x("textarea", {
|
|
301
|
+
value: J.notes,
|
|
302
|
+
onChange: (e) => Y((t) => ({
|
|
274
303
|
...t,
|
|
275
304
|
notes: e.target.value
|
|
276
305
|
})),
|
|
@@ -279,17 +308,17 @@ var M = [
|
|
|
279
308
|
})
|
|
280
309
|
]
|
|
281
310
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ S("div", {
|
|
283
312
|
className: "mt-4 flex flex-wrap gap-3",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
313
|
+
children: [/* @__PURE__ */ x("button", {
|
|
285
314
|
type: "button",
|
|
286
|
-
onClick: () => void
|
|
315
|
+
onClick: () => void pe(),
|
|
287
316
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text",
|
|
288
|
-
children:
|
|
289
|
-
}),
|
|
317
|
+
children: Q ? "Save changes" : "Create code"
|
|
318
|
+
}), Q ? /* @__PURE__ */ x("button", {
|
|
290
319
|
type: "button",
|
|
291
320
|
onClick: () => {
|
|
292
|
-
|
|
321
|
+
q(null), Y({
|
|
293
322
|
label: "",
|
|
294
323
|
description: "",
|
|
295
324
|
notes: "",
|
|
@@ -303,32 +332,32 @@ var M = [
|
|
|
303
332
|
}) : null]
|
|
304
333
|
})
|
|
305
334
|
]
|
|
306
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ S("section", {
|
|
307
336
|
className: "space-y-4",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ S("div", {
|
|
309
338
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
339
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
311
340
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
312
341
|
children: "My codes"
|
|
313
|
-
}),
|
|
342
|
+
}), R.length === 0 && !U ? /* @__PURE__ */ x(C, {
|
|
314
343
|
illustration: "empty-data",
|
|
315
344
|
title: "No affiliate codes yet",
|
|
316
345
|
description: "Create your first code to start tracking attributable journeys."
|
|
317
|
-
}) : /* @__PURE__ */
|
|
346
|
+
}) : /* @__PURE__ */ x("div", {
|
|
318
347
|
className: "space-y-4",
|
|
319
|
-
children:
|
|
348
|
+
children: R.map((e) => {
|
|
320
349
|
let t = e.destinationUrl || `https://${e.productSlug}.com${e.destinationPath || ""}?ref=${e.code}`;
|
|
321
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ S("div", {
|
|
322
351
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
323
352
|
children: [
|
|
324
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ S("div", {
|
|
325
354
|
className: "flex flex-wrap items-start justify-between gap-4",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ S("div", { children: [
|
|
356
|
+
/* @__PURE__ */ x("p", {
|
|
328
357
|
className: "text-sm font-semibold text-text-primary",
|
|
329
358
|
children: e.label || e.code
|
|
330
359
|
}),
|
|
331
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ S("p", {
|
|
332
361
|
className: "text-xs text-text-secondary",
|
|
333
362
|
children: [
|
|
334
363
|
e.code,
|
|
@@ -336,80 +365,83 @@ var M = [
|
|
|
336
365
|
e.productSlug
|
|
337
366
|
]
|
|
338
367
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ x("p", {
|
|
340
369
|
className: "mt-1 break-all text-xs text-text-secondary",
|
|
341
370
|
children: t
|
|
342
371
|
})
|
|
343
|
-
] }), /* @__PURE__ */
|
|
372
|
+
] }), /* @__PURE__ */ S("div", {
|
|
344
373
|
className: "flex flex-wrap gap-2",
|
|
345
374
|
children: [
|
|
346
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ x("button", {
|
|
347
376
|
type: "button",
|
|
348
|
-
onClick: () =>
|
|
377
|
+
onClick: () => me(e),
|
|
349
378
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
350
379
|
children: "Edit"
|
|
351
380
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ S("button", {
|
|
353
382
|
type: "button",
|
|
354
|
-
onClick: () => void
|
|
383
|
+
onClick: () => void ge(e.id),
|
|
355
384
|
className: "inline-flex items-center gap-1 rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ x(ae, { className: "size-3.5" }), "Note"]
|
|
357
386
|
}),
|
|
358
|
-
e.status === "ACTIVE" ? /* @__PURE__ */
|
|
387
|
+
e.status === "ACTIVE" ? /* @__PURE__ */ x("button", {
|
|
359
388
|
type: "button",
|
|
360
|
-
onClick: () =>
|
|
389
|
+
onClick: () => D ? (N(null), k({
|
|
390
|
+
id: e.id,
|
|
391
|
+
label: e.label || e.code
|
|
392
|
+
})) : void $(e.id),
|
|
361
393
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text",
|
|
362
394
|
children: "Deactivate"
|
|
363
395
|
}) : null
|
|
364
396
|
]
|
|
365
397
|
})]
|
|
366
398
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ S("div", {
|
|
368
400
|
className: "mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",
|
|
369
401
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ S("div", {
|
|
371
403
|
className: "rounded-md border border-border-subtle bg-bg-surface p-3",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ x("p", {
|
|
373
405
|
className: "text-xs text-text-secondary",
|
|
374
406
|
children: "Visits"
|
|
375
|
-
}), /* @__PURE__ */
|
|
407
|
+
}), /* @__PURE__ */ x("p", {
|
|
376
408
|
className: "text-lg font-semibold text-text-primary",
|
|
377
409
|
children: e.totalVisits
|
|
378
410
|
})]
|
|
379
411
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ S("div", {
|
|
381
413
|
className: "rounded-md border border-border-subtle bg-bg-surface p-3",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ x("p", {
|
|
383
415
|
className: "text-xs text-text-secondary",
|
|
384
416
|
children: "Signups"
|
|
385
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ x("p", {
|
|
386
418
|
className: "text-lg font-semibold text-text-primary",
|
|
387
419
|
children: e.totalSignups
|
|
388
420
|
})]
|
|
389
421
|
}),
|
|
390
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ S("div", {
|
|
391
423
|
className: "rounded-md border border-border-subtle bg-bg-surface p-3",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
424
|
+
children: [/* @__PURE__ */ x("p", {
|
|
393
425
|
className: "text-xs text-text-secondary",
|
|
394
426
|
children: "Paid conversions"
|
|
395
|
-
}), /* @__PURE__ */
|
|
427
|
+
}), /* @__PURE__ */ x("p", {
|
|
396
428
|
className: "text-lg font-semibold text-text-primary",
|
|
397
429
|
children: e.totalPaidConversions + e.totalStorePurchases
|
|
398
430
|
})]
|
|
399
431
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ S("div", {
|
|
401
433
|
className: "rounded-md border border-border-subtle bg-bg-surface p-3",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ x("p", {
|
|
403
435
|
className: "text-xs text-text-secondary",
|
|
404
436
|
children: "Rewards earned"
|
|
405
|
-
}), /* @__PURE__ */
|
|
437
|
+
}), /* @__PURE__ */ x("p", {
|
|
406
438
|
className: "text-lg font-semibold text-text-primary",
|
|
407
|
-
children:
|
|
439
|
+
children: o(e.totalRewardAmount, "USD")
|
|
408
440
|
})]
|
|
409
441
|
})
|
|
410
442
|
]
|
|
411
443
|
}),
|
|
412
|
-
e.notes ? /* @__PURE__ */
|
|
444
|
+
e.notes ? /* @__PURE__ */ x("p", {
|
|
413
445
|
className: "mt-3 text-sm text-text-secondary",
|
|
414
446
|
children: e.notes
|
|
415
447
|
}) : null
|
|
@@ -417,19 +449,19 @@ var M = [
|
|
|
417
449
|
}, e.id);
|
|
418
450
|
})
|
|
419
451
|
})]
|
|
420
|
-
}), /* @__PURE__ */
|
|
452
|
+
}), /* @__PURE__ */ S("div", {
|
|
421
453
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
423
455
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
424
456
|
children: "Recent attributed journeys"
|
|
425
|
-
}), z.length === 0 ? /* @__PURE__ */
|
|
457
|
+
}), z.length === 0 ? /* @__PURE__ */ x(C, {
|
|
426
458
|
illustration: "empty-people",
|
|
427
459
|
title: "No journeys yet",
|
|
428
460
|
description: "Journeys will appear as visitors land on your affiliate links."
|
|
429
|
-
}) : /* @__PURE__ */ T
|
|
461
|
+
}) : /* @__PURE__ */ x(T, {
|
|
430
462
|
data: z,
|
|
431
463
|
rowKey: (e) => e.id,
|
|
432
|
-
columns:
|
|
464
|
+
columns: E
|
|
433
465
|
})]
|
|
434
466
|
})]
|
|
435
467
|
})]
|
|
@@ -437,6 +469,6 @@ var M = [
|
|
|
437
469
|
]
|
|
438
470
|
});
|
|
439
471
|
};
|
|
440
|
-
export {
|
|
472
|
+
export { D as AffiliateDashboardPage };
|
|
441
473
|
|
|
442
474
|
//# sourceMappingURL=AffiliateDashboardPage.js.map
|