@burdenoff/microfe-subscriberbot 2026.1023.2 → 2026.1029.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/subscriberbot/admin/AdminDashboardPage.js +5 -5
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts +10 -0
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -0
- package/dist/subscriberbot/components/PostureOptions.js +20 -0
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -0
- package/dist/subscriberbot/components/index.d.ts +2 -0
- package/dist/subscriberbot/components/index.d.ts.map +1 -1
- package/dist/subscriberbot/components/index.js +1 -0
- package/dist/subscriberbot/hooks/index.d.ts +1 -0
- package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/index.js +2 -1
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts +15 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +13 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -0
- package/dist/subscriberbot/pages/AssetVaultPage.js +16 -16
- package/dist/subscriberbot/pages/DashboardPage.js +23 -23
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +62 -62
- package/dist/subscriberbot/pages/InsightsPage.js +14 -14
- package/dist/subscriberbot/pages/InvoicesPage.js +66 -66
- package/dist/subscriberbot/pages/WorkflowsPage.js +20 -20
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +184 -182
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +77 -79
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +134 -133
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +64 -64
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +3 -3
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +18 -18
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +76 -76
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +6 -6
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +7 -7
- package/package.json +1 -1
|
@@ -4,11 +4,11 @@ import { formatCurrency as n, formatDate as r, formatEnumLabel as i, formatInter
|
|
|
4
4
|
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
5
5
|
import { EmptyState as s } from "../../components/EmptyState.js";
|
|
6
6
|
import { Modal as c } from "../../components/Modal.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useTr as l } from "../../hooks/useTr.js";
|
|
8
|
+
import { ErrorView as u, LoadingView as d, Section as f } from "../../components/StateViews.js";
|
|
9
|
+
import { Gauge as p, MiniProgress as m, Timeline as h } from "../../components/viz.js";
|
|
9
10
|
import "../../components/index.js";
|
|
10
|
-
import { useCancelRelationship as
|
|
11
|
-
import { useTr as T } from "../../hooks/useTr.js";
|
|
11
|
+
import { useCancelRelationship as g, useCreateAsset as _, useCreateEntitlement as v, useFileDownloadUrl as y, usePlans as b, useProviders as x, useRelationship as S, useTransitionRelationship as C, useUpdateRelationship as w, useUploadFile as T } from "../../hooks/useSubscriberBotApi.js";
|
|
12
12
|
import { useState as E } from "react";
|
|
13
13
|
import { Activity as D, ArrowLeft as O, Ban as k, CalendarClock as A, CreditCard as j, Download as M, Paperclip as N, Pause as P, Pencil as F, Play as I, Plus as L, ShieldCheck as R, Tag as ee, Wallet as te } from "lucide-react";
|
|
14
14
|
import { useParams as ne } from "react-router";
|
|
@@ -90,10 +90,10 @@ function Y(e) {
|
|
|
90
90
|
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
|
|
91
91
|
}
|
|
92
92
|
function oe({ relationship: e, onClose: t }) {
|
|
93
|
-
let n =
|
|
93
|
+
let n = l(), r = w(), i = x({ pagination: {
|
|
94
94
|
limit: 100,
|
|
95
95
|
offset: 0
|
|
96
|
-
} }), [a, o] = E(e.label), [s,
|
|
96
|
+
} }), [a, o] = E(e.label), [s, u] = E(e.providerId ?? ""), [d, f] = E(e.planId ?? ""), [p, m] = E(String(e.amount ?? "")), [h, g] = E(e.currency), [_, v] = E(e.interval), [y, S] = E(Y(e.renewsAt)), [C, T] = E(e.autoRenew), [D, O] = E(e.healthScore == null ? "" : String(e.healthScore)), [k, A] = E(e.notes ?? ""), [j, M] = E(null), N = b(s || void 0), P = (() => {
|
|
97
97
|
let t = i.data?.items ?? [];
|
|
98
98
|
return e.provider && !t.some((t) => t.id === e.provider?.id) ? [e.provider, ...t] : t;
|
|
99
99
|
})(), F = N.data ?? [];
|
|
@@ -109,15 +109,15 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
109
109
|
}
|
|
110
110
|
let o = {
|
|
111
111
|
label: a.trim(),
|
|
112
|
-
interval:
|
|
113
|
-
autoRenew:
|
|
114
|
-
currency:
|
|
112
|
+
interval: _,
|
|
113
|
+
autoRenew: C,
|
|
114
|
+
currency: h.trim() || "USD",
|
|
115
115
|
notes: k.trim(),
|
|
116
116
|
...s ? { providerId: s } : {},
|
|
117
|
-
...
|
|
118
|
-
...
|
|
117
|
+
...d ? { planId: d } : {},
|
|
118
|
+
...p.trim() ? { amount: Number(p) } : {},
|
|
119
119
|
...D.trim() ? { healthScore: Number(D) } : {},
|
|
120
|
-
...
|
|
120
|
+
...y ? { renewsAt: new Date(y).toISOString() } : {}
|
|
121
121
|
};
|
|
122
122
|
r.mutate({
|
|
123
123
|
id: e.id,
|
|
@@ -162,7 +162,7 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
162
162
|
id: "edit-provider",
|
|
163
163
|
value: s,
|
|
164
164
|
onChange: (e) => {
|
|
165
|
-
|
|
165
|
+
u(e.target.value), f("");
|
|
166
166
|
},
|
|
167
167
|
className: H,
|
|
168
168
|
children: [/* @__PURE__ */ z("option", {
|
|
@@ -178,8 +178,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
178
178
|
children: n("relationships.detail.editModal.planLabel", "Plan")
|
|
179
179
|
}), /* @__PURE__ */ B("select", {
|
|
180
180
|
id: "edit-plan",
|
|
181
|
-
value:
|
|
182
|
-
onChange: (e) =>
|
|
181
|
+
value: d,
|
|
182
|
+
onChange: (e) => f(e.target.value),
|
|
183
183
|
className: H,
|
|
184
184
|
disabled: !s || F.length === 0,
|
|
185
185
|
children: [/* @__PURE__ */ z("option", {
|
|
@@ -203,8 +203,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
203
203
|
type: "number",
|
|
204
204
|
min: "0",
|
|
205
205
|
step: "0.01",
|
|
206
|
-
value:
|
|
207
|
-
onChange: (e) =>
|
|
206
|
+
value: p,
|
|
207
|
+
onChange: (e) => m(e.target.value),
|
|
208
208
|
className: H
|
|
209
209
|
})] }),
|
|
210
210
|
/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("label", {
|
|
@@ -214,8 +214,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
214
214
|
}), /* @__PURE__ */ z("input", {
|
|
215
215
|
id: "edit-currency",
|
|
216
216
|
type: "text",
|
|
217
|
-
value:
|
|
218
|
-
onChange: (e) =>
|
|
217
|
+
value: h,
|
|
218
|
+
onChange: (e) => g(e.target.value.toUpperCase()),
|
|
219
219
|
maxLength: 3,
|
|
220
220
|
className: H
|
|
221
221
|
})] }),
|
|
@@ -225,8 +225,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
225
225
|
children: n("relationships.detail.editModal.intervalLabel", "Billing interval")
|
|
226
226
|
}), /* @__PURE__ */ z("select", {
|
|
227
227
|
id: "edit-interval",
|
|
228
|
-
value:
|
|
229
|
-
onChange: (e) =>
|
|
228
|
+
value: _,
|
|
229
|
+
onChange: (e) => v(e.target.value),
|
|
230
230
|
className: H,
|
|
231
231
|
children: W.map((e) => /* @__PURE__ */ z("option", {
|
|
232
232
|
value: e,
|
|
@@ -245,8 +245,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
245
245
|
}), /* @__PURE__ */ z("input", {
|
|
246
246
|
id: "edit-renews",
|
|
247
247
|
type: "date",
|
|
248
|
-
value:
|
|
249
|
-
onChange: (e) =>
|
|
248
|
+
value: y,
|
|
249
|
+
onChange: (e) => S(e.target.value),
|
|
250
250
|
className: H
|
|
251
251
|
})] }),
|
|
252
252
|
/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("label", {
|
|
@@ -268,8 +268,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
268
268
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
269
269
|
children: [/* @__PURE__ */ z("input", {
|
|
270
270
|
type: "checkbox",
|
|
271
|
-
checked:
|
|
272
|
-
onChange: (e) =>
|
|
271
|
+
checked: C,
|
|
272
|
+
onChange: (e) => T(e.target.checked),
|
|
273
273
|
className: "size-4 rounded border-border-subtle"
|
|
274
274
|
}), n("relationships.detail.editModal.autoRenews", "Auto-renews")]
|
|
275
275
|
})
|
|
@@ -306,33 +306,33 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
function se({ relationshipId: e, onClose: t }) {
|
|
309
|
-
let n =
|
|
309
|
+
let n = l(), r = v(), [i, a] = E(""), [o, s] = E("FEATURE_ACCESS"), [u, d] = E(""), [f, p] = E(""), [m, h] = E(""), [g, _] = E(null);
|
|
310
310
|
return /* @__PURE__ */ z(c, {
|
|
311
311
|
title: n("relationships.detail.addEntitlementModal.title", "Add entitlement"),
|
|
312
312
|
onClose: t,
|
|
313
313
|
children: /* @__PURE__ */ B("form", {
|
|
314
314
|
onSubmit: (a) => {
|
|
315
|
-
if (a.preventDefault(),
|
|
316
|
-
|
|
315
|
+
if (a.preventDefault(), _(null), !i.trim()) {
|
|
316
|
+
_(n("relationships.detail.addEntitlementModal.nameRequired", "An entitlement name is required."));
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
319
|
r.mutate({
|
|
320
320
|
relationshipId: e,
|
|
321
321
|
name: i.trim(),
|
|
322
322
|
type: o,
|
|
323
|
-
...
|
|
324
|
-
...
|
|
325
|
-
...
|
|
323
|
+
...u.trim() ? { quota: Number(u) } : {},
|
|
324
|
+
...f.trim() ? { unit: f.trim() } : {},
|
|
325
|
+
...m.trim() ? { description: m.trim() } : {}
|
|
326
326
|
}, {
|
|
327
327
|
onSuccess: () => t(),
|
|
328
|
-
onError: (e) =>
|
|
328
|
+
onError: (e) => _(e instanceof Error ? e.message : n("relationships.detail.addEntitlementModal.error", "Could not add entitlement."))
|
|
329
329
|
});
|
|
330
330
|
},
|
|
331
331
|
className: "space-y-4",
|
|
332
332
|
children: [
|
|
333
|
-
|
|
333
|
+
g && /* @__PURE__ */ z("div", {
|
|
334
334
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
335
|
-
children:
|
|
335
|
+
children: g
|
|
336
336
|
}),
|
|
337
337
|
/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ B("label", {
|
|
338
338
|
htmlFor: "ent-name",
|
|
@@ -379,8 +379,8 @@ function se({ relationshipId: e, onClose: t }) {
|
|
|
379
379
|
id: "ent-quota",
|
|
380
380
|
type: "number",
|
|
381
381
|
min: "0",
|
|
382
|
-
value:
|
|
383
|
-
onChange: (e) =>
|
|
382
|
+
value: u,
|
|
383
|
+
onChange: (e) => d(e.target.value),
|
|
384
384
|
placeholder: n("relationships.detail.addEntitlementModal.quotaPlaceholder", "e.g. 5"),
|
|
385
385
|
className: H
|
|
386
386
|
})] }),
|
|
@@ -391,8 +391,8 @@ function se({ relationshipId: e, onClose: t }) {
|
|
|
391
391
|
}), /* @__PURE__ */ z("input", {
|
|
392
392
|
id: "ent-unit",
|
|
393
393
|
type: "text",
|
|
394
|
-
value:
|
|
395
|
-
onChange: (e) =>
|
|
394
|
+
value: f,
|
|
395
|
+
onChange: (e) => p(e.target.value),
|
|
396
396
|
placeholder: n("relationships.detail.addEntitlementModal.unitPlaceholder", "e.g. seats, GB"),
|
|
397
397
|
className: H
|
|
398
398
|
})] })
|
|
@@ -404,8 +404,8 @@ function se({ relationshipId: e, onClose: t }) {
|
|
|
404
404
|
children: n("relationships.detail.addEntitlementModal.descriptionLabel", "Description")
|
|
405
405
|
}), /* @__PURE__ */ z("textarea", {
|
|
406
406
|
id: "ent-desc",
|
|
407
|
-
value:
|
|
408
|
-
onChange: (e) =>
|
|
407
|
+
value: m,
|
|
408
|
+
onChange: (e) => h(e.target.value),
|
|
409
409
|
rows: 2,
|
|
410
410
|
className: H
|
|
411
411
|
})] }),
|
|
@@ -428,34 +428,34 @@ function se({ relationshipId: e, onClose: t }) {
|
|
|
428
428
|
});
|
|
429
429
|
}
|
|
430
430
|
function ce({ relationshipId: e, onClose: t }) {
|
|
431
|
-
let n =
|
|
431
|
+
let n = l(), r = _(), { uploadFile: i, progress: a, isUploading: o } = T(), [s, u] = E(""), [d, f] = E("RECEIPT"), [p, m] = E(null), [h, g] = E(""), [v, y] = E(null), b = o || r.isPending;
|
|
432
432
|
return /* @__PURE__ */ z(c, {
|
|
433
433
|
title: n("relationships.detail.attachAssetModal.title", "Attach asset"),
|
|
434
434
|
onClose: t,
|
|
435
435
|
children: /* @__PURE__ */ B("form", {
|
|
436
436
|
onSubmit: async (a) => {
|
|
437
|
-
if (a.preventDefault(),
|
|
438
|
-
|
|
437
|
+
if (a.preventDefault(), y(null), !p) {
|
|
438
|
+
y(n("relationships.detail.attachAssetModal.chooseFile", "Choose a file to attach."));
|
|
439
439
|
return;
|
|
440
440
|
}
|
|
441
441
|
try {
|
|
442
|
-
let { fileId: n, fileName: a } = await i(
|
|
442
|
+
let { fileId: n, fileName: a } = await i(p);
|
|
443
443
|
await r.mutateAsync({
|
|
444
444
|
relationshipId: e,
|
|
445
445
|
name: s.trim() || a,
|
|
446
|
-
type:
|
|
446
|
+
type: d,
|
|
447
447
|
fileId: n,
|
|
448
|
-
...
|
|
448
|
+
...h ? { expiresAt: new Date(h).toISOString() } : {}
|
|
449
449
|
}), t();
|
|
450
450
|
} catch (e) {
|
|
451
|
-
|
|
451
|
+
y(e instanceof Error ? e.message : n("relationships.detail.attachAssetModal.error", "Could not attach the asset."));
|
|
452
452
|
}
|
|
453
453
|
},
|
|
454
454
|
className: "space-y-4",
|
|
455
455
|
children: [
|
|
456
|
-
|
|
456
|
+
v && /* @__PURE__ */ z("div", {
|
|
457
457
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
458
|
-
children:
|
|
458
|
+
children: v
|
|
459
459
|
}),
|
|
460
460
|
/* @__PURE__ */ B("div", { children: [
|
|
461
461
|
/* @__PURE__ */ B("label", {
|
|
@@ -475,7 +475,7 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
475
475
|
type: "file",
|
|
476
476
|
onChange: (e) => {
|
|
477
477
|
let t = e.target.files?.[0] ?? null;
|
|
478
|
-
|
|
478
|
+
m(t), t && !s.trim() && u(t.name);
|
|
479
479
|
},
|
|
480
480
|
className: "w-full text-sm text-text-secondary file:mr-3 file:rounded-lg file:border file:border-border-subtle file:bg-bg-surface file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-text-primary hover:file:bg-bg-sunken"
|
|
481
481
|
}),
|
|
@@ -494,7 +494,7 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
494
494
|
id: "asset-name",
|
|
495
495
|
type: "text",
|
|
496
496
|
value: s,
|
|
497
|
-
onChange: (e) =>
|
|
497
|
+
onChange: (e) => u(e.target.value),
|
|
498
498
|
placeholder: n("relationships.detail.attachAssetModal.namePlaceholder", "Defaults to the file name"),
|
|
499
499
|
className: H
|
|
500
500
|
})] }), /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("label", {
|
|
@@ -503,8 +503,8 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
503
503
|
children: n("relationships.detail.attachAssetModal.typeLabel", "Type")
|
|
504
504
|
}), /* @__PURE__ */ z("select", {
|
|
505
505
|
id: "asset-type",
|
|
506
|
-
value:
|
|
507
|
-
onChange: (e) =>
|
|
506
|
+
value: d,
|
|
507
|
+
onChange: (e) => f(e.target.value),
|
|
508
508
|
className: H,
|
|
509
509
|
children: K.map((e) => /* @__PURE__ */ z("option", {
|
|
510
510
|
value: e,
|
|
@@ -519,8 +519,8 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
519
519
|
}), /* @__PURE__ */ z("input", {
|
|
520
520
|
id: "asset-expires",
|
|
521
521
|
type: "date",
|
|
522
|
-
value:
|
|
523
|
-
onChange: (e) =>
|
|
522
|
+
value: h,
|
|
523
|
+
onChange: (e) => g(e.target.value),
|
|
524
524
|
className: H
|
|
525
525
|
})] }),
|
|
526
526
|
o && /* @__PURE__ */ z("p", {
|
|
@@ -536,9 +536,9 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
536
536
|
children: n("relationships.detail.attachAssetModal.cancel", "Cancel")
|
|
537
537
|
}), /* @__PURE__ */ z("button", {
|
|
538
538
|
type: "submit",
|
|
539
|
-
disabled:
|
|
539
|
+
disabled: b,
|
|
540
540
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
541
|
-
children:
|
|
541
|
+
children: b ? n("relationships.detail.attachAssetModal.attaching", "Attaching…") : n("relationships.detail.attachAssetModal.submit", "Attach asset")
|
|
542
542
|
})]
|
|
543
543
|
})
|
|
544
544
|
]
|
|
@@ -546,7 +546,7 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
548
|
function le({ asset: e }) {
|
|
549
|
-
let t =
|
|
549
|
+
let t = l(), n = y(), [a, o] = E(!1);
|
|
550
550
|
return /* @__PURE__ */ B("div", {
|
|
551
551
|
className: "flex items-center justify-between gap-3 p-3",
|
|
552
552
|
children: [/* @__PURE__ */ B("div", {
|
|
@@ -591,7 +591,7 @@ function le({ asset: e }) {
|
|
|
591
591
|
});
|
|
592
592
|
}
|
|
593
593
|
function ue({ invoice: e }) {
|
|
594
|
-
let t =
|
|
594
|
+
let t = l(), a = e.number ?? t("relationships.detail.invoiceRow.unnumbered", "Unnumbered invoice");
|
|
595
595
|
return /* @__PURE__ */ B("div", {
|
|
596
596
|
className: "flex items-center justify-between gap-3 p-3",
|
|
597
597
|
children: [/* @__PURE__ */ B("div", {
|
|
@@ -613,19 +613,19 @@ function ue({ invoice: e }) {
|
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
615
|
function X() {
|
|
616
|
-
let c =
|
|
617
|
-
if (
|
|
616
|
+
let c = l(), { id: _ } = ne(), { navigateTo: v } = e(), { data: y, isLoading: b, isError: x, refetch: w } = S(_), T = C(), M = g(), [N, P] = E(null), [I, H] = E(!1), [U, W] = E(!1), [G, K] = E(!1);
|
|
617
|
+
if (b) return /* @__PURE__ */ z(t, {
|
|
618
618
|
title: c("relationships.title", "Relationship"),
|
|
619
|
-
children: /* @__PURE__ */ z(
|
|
619
|
+
children: /* @__PURE__ */ z(d, { label: c("relationships.detail.loading", "Loading relationship…") })
|
|
620
620
|
});
|
|
621
|
-
if (
|
|
621
|
+
if (x) return /* @__PURE__ */ z(t, {
|
|
622
622
|
title: c("relationships.title", "Relationship"),
|
|
623
|
-
children: /* @__PURE__ */ z(
|
|
623
|
+
children: /* @__PURE__ */ z(u, {
|
|
624
624
|
message: c("relationships.detail.error", "Could not load this relationship."),
|
|
625
|
-
onRetry: () => void
|
|
625
|
+
onRetry: () => void w()
|
|
626
626
|
})
|
|
627
627
|
});
|
|
628
|
-
if (!
|
|
628
|
+
if (!y) return /* @__PURE__ */ z(t, {
|
|
629
629
|
title: c("relationships.title", "Relationship"),
|
|
630
630
|
children: /* @__PURE__ */ z(s, {
|
|
631
631
|
illustration: "empty-data",
|
|
@@ -633,14 +633,14 @@ function X() {
|
|
|
633
633
|
description: c("relationships.detail.notFoundDescription", "It may have been removed, or you may not have access to it."),
|
|
634
634
|
action: /* @__PURE__ */ z("button", {
|
|
635
635
|
type: "button",
|
|
636
|
-
onClick: () =>
|
|
636
|
+
onClick: () => v("/relationships"),
|
|
637
637
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
638
638
|
children: c("relationships.detail.backToRelationships", "Back to relationships")
|
|
639
639
|
})
|
|
640
640
|
})
|
|
641
641
|
});
|
|
642
|
-
let Y =
|
|
643
|
-
P(null),
|
|
642
|
+
let Y = y, X = T.isPending || M.isPending, de = (e) => {
|
|
643
|
+
P(null), T.mutate({
|
|
644
644
|
id: Y.id,
|
|
645
645
|
status: e
|
|
646
646
|
}, { onError: (e) => P(e instanceof Error ? e.message : c("relationships.detail.transitionError", "Transition failed")) });
|
|
@@ -677,7 +677,7 @@ function X() {
|
|
|
677
677
|
]
|
|
678
678
|
}), /* @__PURE__ */ B("button", {
|
|
679
679
|
type: "button",
|
|
680
|
-
onClick: () =>
|
|
680
|
+
onClick: () => v("/relationships"),
|
|
681
681
|
className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
682
682
|
children: [
|
|
683
683
|
/* @__PURE__ */ z(O, { className: "h-4 w-4" }),
|
|
@@ -860,7 +860,7 @@ function X() {
|
|
|
860
860
|
})]
|
|
861
861
|
})]
|
|
862
862
|
}),
|
|
863
|
-
/* @__PURE__ */ z(
|
|
863
|
+
/* @__PURE__ */ z(f, {
|
|
864
864
|
className: "mt-0",
|
|
865
865
|
title: c("relationships.detail.sections.entitlements", "Entitlements"),
|
|
866
866
|
description: c("relationships.detail.sections.entitlementsDescription", "What this relationship grants you"),
|
|
@@ -910,7 +910,7 @@ function X() {
|
|
|
910
910
|
className: "tabular-nums",
|
|
911
911
|
children: [Math.round(e.used / e.quota * 100), "%"]
|
|
912
912
|
})]
|
|
913
|
-
}), /* @__PURE__ */ z(
|
|
913
|
+
}), /* @__PURE__ */ z(m, {
|
|
914
914
|
value: e.used,
|
|
915
915
|
max: e.quota,
|
|
916
916
|
tone: e.used / e.quota >= .9 ? "negative" : e.used / e.quota >= .7 ? "warning" : "accent",
|
|
@@ -922,7 +922,7 @@ function X() {
|
|
|
922
922
|
})
|
|
923
923
|
})
|
|
924
924
|
}),
|
|
925
|
-
/* @__PURE__ */ z(
|
|
925
|
+
/* @__PURE__ */ z(f, {
|
|
926
926
|
className: "mt-0",
|
|
927
927
|
title: c("relationships.detail.sections.assets", "Assets"),
|
|
928
928
|
description: c("relationships.detail.sections.assetsDescription", "Invoices, contracts, licenses and credentials"),
|
|
@@ -986,14 +986,14 @@ function X() {
|
|
|
986
986
|
children: c("relationships.detail.empty.noHealthScore", "Not scored yet. A health score appears once Subscriber Bot has enough signal.")
|
|
987
987
|
}) : /* @__PURE__ */ B("div", {
|
|
988
988
|
className: "mt-4 flex flex-col items-center",
|
|
989
|
-
children: [/* @__PURE__ */ z(
|
|
989
|
+
children: [/* @__PURE__ */ z(p, {
|
|
990
990
|
value: Y.healthScore,
|
|
991
991
|
max: 100,
|
|
992
992
|
size: 160,
|
|
993
993
|
label: c("relationships.detail.outOf100", "of 100")
|
|
994
994
|
}), /* @__PURE__ */ z("div", {
|
|
995
995
|
className: "mt-2 w-full",
|
|
996
|
-
children: /* @__PURE__ */ z(
|
|
996
|
+
children: /* @__PURE__ */ z(m, {
|
|
997
997
|
value: Y.healthScore,
|
|
998
998
|
max: 100,
|
|
999
999
|
tone: ae(Y.healthScore)
|
|
@@ -1023,7 +1023,7 @@ function X() {
|
|
|
1023
1023
|
title: c("relationships.detail.empty.noRenewalEventsTitle", "No renewal events"),
|
|
1024
1024
|
description: c("relationships.detail.empty.noRenewalEventsDescription", "Renewals and price changes will appear here as they're detected.")
|
|
1025
1025
|
})
|
|
1026
|
-
}) : /* @__PURE__ */ z(
|
|
1026
|
+
}) : /* @__PURE__ */ z(h, {
|
|
1027
1027
|
items: Z,
|
|
1028
1028
|
className: "mt-4"
|
|
1029
1029
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
3
|
import { formatEnumLabel as n } from "../../utils/formatters.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { useTr as r } from "../../hooks/useTr.js";
|
|
5
|
+
import { ErrorView as i } from "../../components/StateViews.js";
|
|
6
|
+
import { useCreateRelationship as a, usePlans as o, useProviders as s } from "../../hooks/useSubscriberBotApi.js";
|
|
7
7
|
import { useState as c } from "react";
|
|
8
8
|
import { ArrowLeft as l, Building2 as u, StickyNote as d, Tag as f, Wallet as p } from "lucide-react";
|
|
9
9
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
@@ -63,13 +63,13 @@ function C({ icon: e, title: t, description: n, children: r }) {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function w() {
|
|
66
|
-
let g =
|
|
66
|
+
let g = r(), { navigateTo: w } = e(), T = a(), E = s({ pagination: {
|
|
67
67
|
limit: 100,
|
|
68
68
|
offset: 0
|
|
69
|
-
} }), [D, O] = c(""), [k, A] = c("SUBSCRIPTION"), [j, M] = c(""), [N, P] = c(""), [F, I] = c(""), [L, R] = c("USD"), [z, B] = c("MONTHLY"), [V, H] = c(""), [U, W] = c(!0), [G, K] = c(""), [q, J] = c(null), Y =
|
|
69
|
+
} }), [D, O] = c(""), [k, A] = c("SUBSCRIPTION"), [j, M] = c(""), [N, P] = c(""), [F, I] = c(""), [L, R] = c("USD"), [z, B] = c("MONTHLY"), [V, H] = c(""), [U, W] = c(!0), [G, K] = c(""), [q, J] = c(null), Y = o(j || void 0), X = E.data?.items ?? [], Z = Y.data ?? [];
|
|
70
70
|
return E.isError ? /* @__PURE__ */ m(t, {
|
|
71
71
|
title: g("relationships.new.title", "Add relationship"),
|
|
72
|
-
children: /* @__PURE__ */ m(
|
|
72
|
+
children: /* @__PURE__ */ m(i, {
|
|
73
73
|
message: g("relationships.new.providerError", "Could not load the provider registry."),
|
|
74
74
|
onRetry: () => void E.refetch()
|
|
75
75
|
})
|
|
@@ -4,11 +4,11 @@ import { PageLayout as n } from "../../components/PageLayout.js";
|
|
|
4
4
|
import { formatCurrency as r, formatDate as i, formatEnumLabel as a, formatIntervalSuffix as o } from "../../utils/formatters.js";
|
|
5
5
|
import { StatusBadge as s } from "../../components/StatusBadge.js";
|
|
6
6
|
import { EmptyState as c } from "../../components/EmptyState.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useTr as l } from "../../hooks/useTr.js";
|
|
8
|
+
import { ErrorView as u, LoadingView as d } from "../../components/StateViews.js";
|
|
9
|
+
import { MiniProgress as f } from "../../components/viz.js";
|
|
9
10
|
import "../../components/index.js";
|
|
10
|
-
import { useRelationships as
|
|
11
|
-
import { useTr as p } from "../../hooks/useTr.js";
|
|
11
|
+
import { useRelationships as p } from "../../hooks/useSubscriberBotApi.js";
|
|
12
12
|
import { useMemo as m, useState as h } from "react";
|
|
13
13
|
import { ChevronRight as g, Plus as _, Repeat2 as v, Search as y } from "lucide-react";
|
|
14
14
|
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
@@ -53,7 +53,7 @@ function j(e) {
|
|
|
53
53
|
return e == null ? "accent" : e >= 66 ? "positive" : e >= 33 ? "warning" : "negative";
|
|
54
54
|
}
|
|
55
55
|
function M() {
|
|
56
|
-
let M =
|
|
56
|
+
let M = l(), { navigateTo: N } = e(), [P, F] = h(0), [I, L] = h(""), [R, z] = h(""), [B, V] = h(""), [H, U] = h(""), { data: W, isLoading: G, isError: K, refetch: q, isFetching: J } = p({
|
|
57
57
|
status: I || void 0,
|
|
58
58
|
kind: R || void 0,
|
|
59
59
|
search: B || void 0,
|
|
@@ -132,7 +132,7 @@ function M() {
|
|
|
132
132
|
})]
|
|
133
133
|
})
|
|
134
134
|
}),
|
|
135
|
-
G ? /* @__PURE__ */ x(
|
|
135
|
+
G ? /* @__PURE__ */ x(d, { label: M("relationships.loading", "Loading relationships…") }) : K ? /* @__PURE__ */ x(u, {
|
|
136
136
|
message: M("relationships.error", "Could not load relationships."),
|
|
137
137
|
onRetry: () => void q()
|
|
138
138
|
}) : Y.length === 0 ? /* @__PURE__ */ x("div", {
|
|
@@ -215,7 +215,7 @@ function M() {
|
|
|
215
215
|
children: [t == null ? /* @__PURE__ */ x("span", {
|
|
216
216
|
className: "text-xs text-text-secondary",
|
|
217
217
|
children: "—"
|
|
218
|
-
}) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(
|
|
218
|
+
}) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(f, {
|
|
219
219
|
value: t,
|
|
220
220
|
max: 100,
|
|
221
221
|
tone: j(t),
|