@burdenoff/microfe-subscriberbot 2026.1102.4 → 2026.1102.6
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/stories/pages/DashboardPage.stories.d.ts +4 -0
- package/dist/stories/pages/DashboardPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts +5 -0
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts +14 -0
- package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts.map +1 -0
- package/dist/stories/pages/WorkflowsPage.stories.d.ts +1 -0
- package/dist/stories/pages/WorkflowsPage.stories.d.ts.map +1 -1
- package/dist/stories/support/fixtures.d.ts +6 -1
- package/dist/stories/support/fixtures.d.ts.map +1 -1
- package/dist/stories/support/handlers.d.ts.map +1 -1
- package/dist/stories/support/phoneViewport.d.ts +4 -0
- package/dist/stories/support/phoneViewport.d.ts.map +1 -0
- package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.js +27 -23
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +3 -3
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts +18 -0
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +247 -0
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts +10 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +217 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +26 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.js +46 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts +10 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +25 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -0
- package/dist/subscriberbot/components/mobile/index.d.ts +9 -0
- package/dist/subscriberbot/components/mobile/index.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/index.js +4 -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 +1 -0
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts +13 -0
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useCompactViewport.js +21 -0
- package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +10 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +113 -79
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +166 -189
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts +4 -4
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +201 -190
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +120 -119
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +226 -212
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts +3 -0
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -0
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +648 -0
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -0
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +60 -0
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -0
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +122 -0
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -0
- package/dist/subscriberbot/types/index.d.ts +65 -0
- package/dist/subscriberbot/types/index.d.ts.map +1 -1
- package/dist/subscriberbot/utils/pageContext.d.ts.map +1 -1
- package/dist/subscriberbot/utils/pageContext.js +21 -13
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/dist/subscriberbot/utils/portfolio.d.ts +106 -0
- package/dist/subscriberbot/utils/portfolio.d.ts.map +1 -0
- package/dist/subscriberbot/utils/portfolio.js +151 -0
- package/dist/subscriberbot/utils/portfolio.js.map +1 -0
- package/package.json +3 -1
|
@@ -5,121 +5,98 @@ import { formatCurrency as r, formatEnumLabel as i, formatRelativeTime as a } fr
|
|
|
5
5
|
import { StatusBadge as o } from "../components/StatusBadge.js";
|
|
6
6
|
import { EmptyState as s } from "../components/EmptyState.js";
|
|
7
7
|
import { useTr as c } from "../hooks/useTr.js";
|
|
8
|
-
import { ErrorView as
|
|
9
|
-
import { Donut as
|
|
8
|
+
import { ErrorView as l, LoadingView as u, Section as d } from "../components/StateViews.js";
|
|
9
|
+
import { Donut as f, Legend as p, Timeline as m } from "../components/viz.js";
|
|
10
10
|
import "../components/index.js";
|
|
11
|
-
import { useInboxMessages as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
11
|
+
import { useDecisions as h, useInboxMessages as g, useInvoices as _, useRelationships as v, useRenewalEvents as y } from "../hooks/useSubscriberBotApi.js";
|
|
12
|
+
import { buildUpcomingRenewals as ee, recurringSpend as te } from "../utils/portfolio.js";
|
|
13
|
+
import { useCompactViewport as ne } from "../hooks/useCompactViewport.js";
|
|
14
|
+
import { MobileDashboard as re } from "../components/mobile/MobileDashboard.js";
|
|
15
|
+
import "../components/mobile/index.js";
|
|
16
|
+
import { useMemo as b } from "react";
|
|
17
|
+
import { AlertTriangle as x, ArrowRight as S, ArrowUpRight as C, Bot as w, CalendarClock as T, Inbox as E, Repeat2 as D, ShieldCheck as ie, Sparkles as O, Wallet as k } from "lucide-react";
|
|
18
|
+
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
19
|
+
import { GlassCard as M, PagePurpose as N } from "@burdenoff/fe-libs/ui";
|
|
16
20
|
//#region src/subscriberbot/pages/DashboardPage.tsx
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
WEEKLY: 4.345,
|
|
20
|
-
MONTHLY: 1,
|
|
21
|
-
QUARTERLY: 1 / 3,
|
|
22
|
-
YEARLY: 1 / 12,
|
|
23
|
-
LIFETIME: 0,
|
|
24
|
-
FREE: 0,
|
|
25
|
-
USAGE_BASED: 1
|
|
26
|
-
}, P = 1e3 * 60 * 60 * 24;
|
|
27
|
-
function F() {
|
|
28
|
-
let { navigateTo: F, currentUser: I } = e(), L = c(), R = g({ pagination: {
|
|
21
|
+
function P() {
|
|
22
|
+
let { navigateTo: P, currentUser: F } = e(), I = c(), L = v({ pagination: {
|
|
29
23
|
limit: 100,
|
|
30
24
|
offset: 0
|
|
31
|
-
} }),
|
|
25
|
+
} }), R = _({ pagination: {
|
|
32
26
|
limit: 50,
|
|
33
27
|
offset: 0
|
|
34
|
-
} }),
|
|
28
|
+
} }), z = g({ pagination: {
|
|
35
29
|
limit: 50,
|
|
36
30
|
offset: 0
|
|
37
|
-
} }),
|
|
31
|
+
} }), B = y({ upcomingOnly: !0 }), V = ne(), H = h({ status: "PROPOSED" }, { enabled: V }), U = b(() => L.data?.items ?? [], [L.data]), W = b(() => R.data?.items ?? [], [R.data]), G = b(() => z.data?.items ?? [], [z.data]), K = b(() => B.data ?? [], [B.data]), q = b(() => {
|
|
38
32
|
let e = /* @__PURE__ */ new Map();
|
|
39
|
-
return
|
|
40
|
-
}, [
|
|
41
|
-
let e =
|
|
33
|
+
return U.forEach((t) => e.set(t.id, t)), e;
|
|
34
|
+
}, [U]), J = b(() => {
|
|
35
|
+
let e = te(U), t = G.filter((e) => e.actionRequired).length, n = W.filter((e) => e.status === "ISSUED" || e.status === "OVERDUE" || e.status === "FAILED"), r = n.reduce((e, t) => e + t.total, 0), i = U.filter((e) => e.status === "PAST_DUE" || e.status === "LAPSED").length;
|
|
42
36
|
return {
|
|
43
|
-
activeCount: e.
|
|
44
|
-
totalCount:
|
|
45
|
-
monthlySpend:
|
|
46
|
-
primaryCurrency:
|
|
47
|
-
actionRequired:
|
|
48
|
-
openInvoiceCount:
|
|
49
|
-
openInvoiceTotal:
|
|
50
|
-
atRisk:
|
|
37
|
+
activeCount: e.activeCount,
|
|
38
|
+
totalCount: U.length,
|
|
39
|
+
monthlySpend: e.monthly,
|
|
40
|
+
primaryCurrency: e.currency,
|
|
41
|
+
actionRequired: t,
|
|
42
|
+
openInvoiceCount: n.length,
|
|
43
|
+
openInvoiceTotal: r,
|
|
44
|
+
atRisk: i
|
|
51
45
|
};
|
|
52
46
|
}, [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
]),
|
|
47
|
+
U,
|
|
48
|
+
G,
|
|
49
|
+
W
|
|
50
|
+
]), Y = b(() => {
|
|
57
51
|
let e = /* @__PURE__ */ new Map();
|
|
58
|
-
return
|
|
52
|
+
return U.forEach((t) => e.set(t.status, (e.get(t.status) ?? 0) + 1)), Array.from(e.entries()).sort((e, t) => t[1] - e[1]).map(([e, t]) => ({
|
|
59
53
|
label: i(e),
|
|
60
54
|
value: t
|
|
61
55
|
}));
|
|
62
|
-
}, [
|
|
63
|
-
let e = Date.now(), t = G.map((t) => {
|
|
64
|
-
let n = K.get(t.relationshipId), r = new Date(t.occursAt).getTime();
|
|
65
|
-
return {
|
|
66
|
-
id: t.id,
|
|
67
|
-
relationshipId: t.relationshipId,
|
|
68
|
-
title: n?.label ?? i(t.eventType),
|
|
69
|
-
when: t.occursAt,
|
|
70
|
-
amount: t.amount ?? n?.amount ?? null,
|
|
71
|
-
currency: t.currency ?? n?.currency ?? null,
|
|
72
|
-
soon: !Number.isNaN(r) && r - e <= 7 * P
|
|
73
|
-
};
|
|
74
|
-
});
|
|
75
|
-
return t.length > 0 ? t.filter((e) => !Number.isNaN(new Date(e.when).getTime())).sort((e, t) => new Date(e.when).getTime() - new Date(t.when).getTime()) : H.filter((t) => {
|
|
76
|
-
if (!t.renewsAt) return !1;
|
|
77
|
-
let n = new Date(t.renewsAt).getTime();
|
|
78
|
-
return !Number.isNaN(n) && n >= e;
|
|
79
|
-
}).map((t) => {
|
|
80
|
-
let n = new Date(t.renewsAt).getTime();
|
|
81
|
-
return {
|
|
82
|
-
id: t.id,
|
|
83
|
-
relationshipId: t.id,
|
|
84
|
-
title: t.label,
|
|
85
|
-
when: t.renewsAt,
|
|
86
|
-
amount: t.amount,
|
|
87
|
-
currency: t.currency,
|
|
88
|
-
soon: n - e <= 7 * P
|
|
89
|
-
};
|
|
90
|
-
}).sort((e, t) => new Date(e.when).getTime() - new Date(t.when).getTime());
|
|
91
|
-
}, [
|
|
92
|
-
G,
|
|
93
|
-
H,
|
|
94
|
-
K
|
|
95
|
-
]), X = v(() => Y.slice(0, 6).map((e) => ({
|
|
56
|
+
}, [U]), X = b(() => ee(U, K, (e) => i(e)), [U, K]), Z = b(() => X.slice(0, 6).map((e) => ({
|
|
96
57
|
title: e.title,
|
|
97
58
|
sub: a(e.when),
|
|
98
59
|
tone: e.soon ? "warning" : "default",
|
|
99
|
-
meta: e.amount == null ? void 0 : r(e.amount, e.currency ??
|
|
100
|
-
})), [
|
|
101
|
-
if (
|
|
102
|
-
title:
|
|
103
|
-
description:
|
|
104
|
-
children: /* @__PURE__ */
|
|
60
|
+
meta: e.amount == null ? void 0 : r(e.amount, e.currency ?? J.primaryCurrency, { maximumFractionDigits: 0 })
|
|
61
|
+
})), [X, J.primaryCurrency]), Q = b(() => G.filter((e) => e.actionRequired), [G]), ae = L.isLoading || R.isLoading || z.isLoading || B.isLoading, oe = L.isError && R.isError && z.isError && B.isError;
|
|
62
|
+
if (ae) return /* @__PURE__ */ A(t, {
|
|
63
|
+
title: I("dashboard.title", "Overview"),
|
|
64
|
+
description: I("dashboard.description", "Your recurring digital relationships at a glance"),
|
|
65
|
+
children: /* @__PURE__ */ A(u, { label: I("dashboard.loading", "Loading your subscription portfolio…") })
|
|
105
66
|
});
|
|
106
|
-
if (
|
|
107
|
-
title:
|
|
108
|
-
description:
|
|
109
|
-
children: /* @__PURE__ */
|
|
110
|
-
message:
|
|
67
|
+
if (oe) return /* @__PURE__ */ A(t, {
|
|
68
|
+
title: I("dashboard.title", "Overview"),
|
|
69
|
+
description: I("dashboard.description", "Your recurring digital relationships at a glance"),
|
|
70
|
+
children: /* @__PURE__ */ A(l, {
|
|
71
|
+
message: I("dashboard.error", "We couldn't reach the Subscriber Bot service. Please try again."),
|
|
111
72
|
onRetry: () => {
|
|
112
|
-
|
|
73
|
+
L.refetch(), R.refetch(), z.refetch(), B.refetch();
|
|
113
74
|
}
|
|
114
75
|
})
|
|
115
76
|
});
|
|
116
|
-
let $ =
|
|
77
|
+
let $ = F?.firstName || F?.name?.split(" ")[0];
|
|
78
|
+
if (V) return /* @__PURE__ */ A(re, {
|
|
79
|
+
greetingName: $ || void 0,
|
|
80
|
+
spend: {
|
|
81
|
+
monthly: J.monthlySpend,
|
|
82
|
+
currency: J.primaryCurrency,
|
|
83
|
+
activeCount: J.activeCount
|
|
84
|
+
},
|
|
85
|
+
upcoming: X,
|
|
86
|
+
actionMessages: Q,
|
|
87
|
+
decisions: H.data?.items ?? [],
|
|
88
|
+
relationshipLabel: (e) => q.get(e)?.label,
|
|
89
|
+
openInvoiceCount: J.openInvoiceCount,
|
|
90
|
+
openInvoiceTotal: J.openInvoiceTotal,
|
|
91
|
+
navigateTo: P
|
|
92
|
+
});
|
|
93
|
+
let se = [
|
|
117
94
|
{
|
|
118
95
|
labelKey: "dashboard.quickActions.addRelationship.label",
|
|
119
96
|
descriptionKey: "dashboard.quickActions.addRelationship.description",
|
|
120
97
|
fallbackLabel: "Add a relationship",
|
|
121
98
|
fallbackDescription: "Track a new subscription",
|
|
122
|
-
icon: /* @__PURE__ */
|
|
99
|
+
icon: /* @__PURE__ */ A(D, { className: "h-5 w-5" }),
|
|
123
100
|
path: "/relationships/new"
|
|
124
101
|
},
|
|
125
102
|
{
|
|
@@ -127,7 +104,7 @@ function F() {
|
|
|
127
104
|
descriptionKey: "dashboard.quickActions.discoverProviders.description",
|
|
128
105
|
fallbackLabel: "Discover providers",
|
|
129
106
|
fallbackDescription: "Browse the registry",
|
|
130
|
-
icon: /* @__PURE__ */
|
|
107
|
+
icon: /* @__PURE__ */ A(O, { className: "h-5 w-5" }),
|
|
131
108
|
path: "/providers"
|
|
132
109
|
},
|
|
133
110
|
{
|
|
@@ -135,7 +112,7 @@ function F() {
|
|
|
135
112
|
descriptionKey: "dashboard.quickActions.openInbox.description",
|
|
136
113
|
fallbackLabel: "Open inbox",
|
|
137
114
|
fallbackDescription: "Merged communications",
|
|
138
|
-
icon: /* @__PURE__ */
|
|
115
|
+
icon: /* @__PURE__ */ A(E, { className: "h-5 w-5" }),
|
|
139
116
|
path: "/inbox"
|
|
140
117
|
},
|
|
141
118
|
{
|
|
@@ -143,151 +120,151 @@ function F() {
|
|
|
143
120
|
descriptionKey: "dashboard.quickActions.configureAgents.description",
|
|
144
121
|
fallbackLabel: "Configure agents",
|
|
145
122
|
fallbackDescription: "Automate your portfolio",
|
|
146
|
-
icon: /* @__PURE__ */
|
|
123
|
+
icon: /* @__PURE__ */ A(w, { className: "h-5 w-5" }),
|
|
147
124
|
path: "/agents"
|
|
148
125
|
}
|
|
149
126
|
];
|
|
150
|
-
return /* @__PURE__ */
|
|
151
|
-
title: $ ?
|
|
152
|
-
description:
|
|
127
|
+
return /* @__PURE__ */ j(t, {
|
|
128
|
+
title: $ ? I("dashboard.welcomeBack", "Welcome back, {{name}}", { name: $ }) : I("dashboard.title", "Overview"),
|
|
129
|
+
description: I("dashboard.description", "Everything you pay for on repeat — in one intelligent console."),
|
|
153
130
|
children: [
|
|
154
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ A(N, {
|
|
155
132
|
className: "mb-6",
|
|
156
|
-
children:
|
|
133
|
+
children: I("dashboard.purpose", "Subscriber Bot is your system of record for every recurring digital relationship. See total recurring spend, what renews next, what needs action, and what to optimize — all from real data across your providers.")
|
|
157
134
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ j("div", {
|
|
159
136
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
160
137
|
children: [
|
|
161
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ A(n, {
|
|
162
139
|
featured: !0,
|
|
163
|
-
icon: /* @__PURE__ */ k
|
|
164
|
-
value: r(
|
|
165
|
-
label:
|
|
140
|
+
icon: /* @__PURE__ */ A(k, {}),
|
|
141
|
+
value: r(J.monthlySpend, J.primaryCurrency, { maximumFractionDigits: 0 }),
|
|
142
|
+
label: I("dashboard.metrics.recurringSpend", "Recurring spend / month")
|
|
166
143
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
icon: /* @__PURE__ */
|
|
169
|
-
value:
|
|
170
|
-
label:
|
|
144
|
+
/* @__PURE__ */ A(n, {
|
|
145
|
+
icon: /* @__PURE__ */ A(D, {}),
|
|
146
|
+
value: J.activeCount,
|
|
147
|
+
label: I("dashboard.metrics.activeRelationships", "Active relationships")
|
|
171
148
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
icon: /* @__PURE__ */
|
|
174
|
-
value:
|
|
175
|
-
label:
|
|
149
|
+
/* @__PURE__ */ A(n, {
|
|
150
|
+
icon: /* @__PURE__ */ A(T, {}),
|
|
151
|
+
value: X.length,
|
|
152
|
+
label: I("dashboard.metrics.upcomingRenewals", "Upcoming renewals")
|
|
176
153
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
icon: /* @__PURE__ */
|
|
179
|
-
value:
|
|
180
|
-
label:
|
|
181
|
-
trend:
|
|
154
|
+
/* @__PURE__ */ A(n, {
|
|
155
|
+
icon: /* @__PURE__ */ A(x, {}),
|
|
156
|
+
value: J.actionRequired,
|
|
157
|
+
label: I("dashboard.metrics.needsAction", "Need your action"),
|
|
158
|
+
trend: J.actionRequired > 0 ? "down" : void 0
|
|
182
159
|
})
|
|
183
160
|
]
|
|
184
161
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ j("div", {
|
|
186
163
|
className: "mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ A("div", {
|
|
188
165
|
className: "lg:col-span-2",
|
|
189
|
-
children: /* @__PURE__ */
|
|
190
|
-
title:
|
|
191
|
-
description:
|
|
166
|
+
children: /* @__PURE__ */ A(d, {
|
|
167
|
+
title: I("dashboard.renewals.title", "Upcoming renewals"),
|
|
168
|
+
description: I("dashboard.renewals.description", "What's charging next across your portfolio"),
|
|
192
169
|
className: "mt-0",
|
|
193
|
-
action: /* @__PURE__ */
|
|
170
|
+
action: /* @__PURE__ */ j("button", {
|
|
194
171
|
type: "button",
|
|
195
|
-
onClick: () =>
|
|
172
|
+
onClick: () => P("/relationships"),
|
|
196
173
|
className: "inline-flex items-center gap-1 text-sm font-medium text-text-link hover:underline",
|
|
197
174
|
children: [
|
|
198
|
-
|
|
175
|
+
I("common.viewAll", "View all"),
|
|
199
176
|
" ",
|
|
200
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ A(C, { className: "h-3.5 w-3.5" })
|
|
201
178
|
]
|
|
202
179
|
}),
|
|
203
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ A(M, {
|
|
204
181
|
treatment: "plain",
|
|
205
182
|
className: "p-5",
|
|
206
|
-
children:
|
|
183
|
+
children: Z.length === 0 ? /* @__PURE__ */ A(s, {
|
|
207
184
|
illustration: "empty-calendar",
|
|
208
|
-
title:
|
|
209
|
-
description:
|
|
210
|
-
}) : /* @__PURE__ */
|
|
185
|
+
title: I("dashboard.renewals.emptyTitle", "No upcoming renewals"),
|
|
186
|
+
description: I("dashboard.renewals.emptyDescription", "Renewals you track will appear here ahead of time.")
|
|
187
|
+
}) : /* @__PURE__ */ A(m, { items: Z })
|
|
211
188
|
})
|
|
212
189
|
})
|
|
213
|
-
}), /* @__PURE__ */
|
|
190
|
+
}), /* @__PURE__ */ j("div", {
|
|
214
191
|
className: "flex flex-col gap-6",
|
|
215
|
-
children: [/* @__PURE__ */
|
|
216
|
-
title:
|
|
217
|
-
description:
|
|
192
|
+
children: [/* @__PURE__ */ A(d, {
|
|
193
|
+
title: I("dashboard.portfolio.title", "Portfolio by status"),
|
|
194
|
+
description: I("dashboard.portfolio.description", "Where your relationships stand"),
|
|
218
195
|
className: "mt-0",
|
|
219
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ A(M, {
|
|
220
197
|
treatment: "glass",
|
|
221
198
|
className: "p-5",
|
|
222
|
-
children:
|
|
199
|
+
children: Y.length === 0 ? /* @__PURE__ */ A(s, {
|
|
223
200
|
illustration: "empty-data",
|
|
224
|
-
title:
|
|
225
|
-
description:
|
|
226
|
-
action: /* @__PURE__ */
|
|
201
|
+
title: I("dashboard.portfolio.emptyTitle", "No relationships yet"),
|
|
202
|
+
description: I("dashboard.portfolio.emptyDescription", "Add your first subscription to see the breakdown."),
|
|
203
|
+
action: /* @__PURE__ */ A("button", {
|
|
227
204
|
type: "button",
|
|
228
|
-
onClick: () =>
|
|
205
|
+
onClick: () => P("/relationships/new"),
|
|
229
206
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
230
|
-
children:
|
|
207
|
+
children: I("dashboard.portfolio.addRelationship", "Add relationship")
|
|
231
208
|
})
|
|
232
|
-
}) : /* @__PURE__ */
|
|
209
|
+
}) : /* @__PURE__ */ j("div", {
|
|
233
210
|
className: "flex flex-col items-center gap-5 sm:flex-row sm:items-center lg:flex-col xl:flex-row",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
235
|
-
data:
|
|
211
|
+
children: [/* @__PURE__ */ A(f, {
|
|
212
|
+
data: Y,
|
|
236
213
|
size: 148,
|
|
237
214
|
thickness: 20,
|
|
238
|
-
centerLabel: String(
|
|
239
|
-
centerSub:
|
|
215
|
+
centerLabel: String(J.totalCount),
|
|
216
|
+
centerSub: I(J.totalCount === 1 ? "dashboard.portfolio.relationshipSingular" : "dashboard.portfolio.relationshipPlural", J.totalCount === 1 ? "relationship" : "relationships"),
|
|
240
217
|
className: "shrink-0"
|
|
241
|
-
}), /* @__PURE__ */
|
|
242
|
-
data:
|
|
218
|
+
}), /* @__PURE__ */ A(p, {
|
|
219
|
+
data: Y,
|
|
243
220
|
className: "w-full min-w-0 flex-1"
|
|
244
221
|
})]
|
|
245
222
|
})
|
|
246
223
|
})
|
|
247
|
-
}), /* @__PURE__ */
|
|
248
|
-
title:
|
|
249
|
-
description:
|
|
224
|
+
}), /* @__PURE__ */ A(d, {
|
|
225
|
+
title: I("dashboard.needsAttention.title", "Needs attention"),
|
|
226
|
+
description: I("dashboard.needsAttention.description", "Required actions from the Universal Inbox"),
|
|
250
227
|
className: "mt-0",
|
|
251
|
-
action: /* @__PURE__ */
|
|
228
|
+
action: /* @__PURE__ */ A("button", {
|
|
252
229
|
type: "button",
|
|
253
|
-
onClick: () =>
|
|
230
|
+
onClick: () => P("/inbox"),
|
|
254
231
|
className: "text-sm font-medium text-text-link hover:underline",
|
|
255
|
-
children:
|
|
232
|
+
children: I("dashboard.needsAttention.openInbox", "Open inbox")
|
|
256
233
|
}),
|
|
257
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ A(M, {
|
|
258
235
|
treatment: "plain",
|
|
259
236
|
className: "p-3",
|
|
260
|
-
children:
|
|
237
|
+
children: Q.length === 0 ? /* @__PURE__ */ j("div", {
|
|
261
238
|
className: "flex items-center gap-3 px-2 py-4",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ A("span", {
|
|
263
240
|
className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-status-success-bg-subtle text-status-success-text",
|
|
264
|
-
children: /* @__PURE__ */
|
|
265
|
-
}), /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ A(ie, { className: "h-5 w-5" })
|
|
242
|
+
}), /* @__PURE__ */ j("div", {
|
|
266
243
|
className: "min-w-0",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ A("p", {
|
|
268
245
|
className: "text-sm font-medium text-text-primary",
|
|
269
|
-
children:
|
|
270
|
-
}), /* @__PURE__ */
|
|
246
|
+
children: I("dashboard.needsAttention.allCaughtUp", "You're all caught up")
|
|
247
|
+
}), /* @__PURE__ */ A("p", {
|
|
271
248
|
className: "text-xs text-text-secondary",
|
|
272
|
-
children:
|
|
249
|
+
children: I("dashboard.needsAttention.allCaughtUpDescription", "Required actions across your channels will surface here.")
|
|
273
250
|
})]
|
|
274
251
|
})]
|
|
275
|
-
}) : /* @__PURE__ */
|
|
252
|
+
}) : /* @__PURE__ */ A("ul", {
|
|
276
253
|
className: "space-y-1",
|
|
277
|
-
children:
|
|
254
|
+
children: Q.slice(0, 5).map((e) => /* @__PURE__ */ A("li", { children: /* @__PURE__ */ j("button", {
|
|
278
255
|
type: "button",
|
|
279
|
-
onClick: () =>
|
|
256
|
+
onClick: () => P("/inbox"),
|
|
280
257
|
className: "flex w-full items-center gap-3 rounded-lg border-l-2 border-status-warning-text/60 bg-status-warning-bg-subtle/50 p-3 text-left transition-colors hover:bg-status-warning-bg-subtle",
|
|
281
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ j("div", {
|
|
282
259
|
className: "min-w-0 flex-1",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ A("p", {
|
|
284
261
|
className: "truncate text-sm font-medium text-text-primary",
|
|
285
|
-
children: e.subject ||
|
|
286
|
-
}), e.preview && /* @__PURE__ */
|
|
262
|
+
children: e.subject || I("dashboard.needsAttention.noSubject", "(no subject)")
|
|
263
|
+
}), e.preview && /* @__PURE__ */ A("p", {
|
|
287
264
|
className: "truncate text-xs text-text-secondary",
|
|
288
265
|
children: e.preview
|
|
289
266
|
})]
|
|
290
|
-
}), /* @__PURE__ */
|
|
267
|
+
}), /* @__PURE__ */ A(o, {
|
|
291
268
|
status: e.category,
|
|
292
269
|
className: "shrink-0"
|
|
293
270
|
})]
|
|
@@ -297,46 +274,46 @@ function F() {
|
|
|
297
274
|
})]
|
|
298
275
|
})]
|
|
299
276
|
}),
|
|
300
|
-
|
|
277
|
+
J.openInvoiceCount > 0 && /* @__PURE__ */ j("button", {
|
|
301
278
|
type: "button",
|
|
302
|
-
onClick: () =>
|
|
279
|
+
onClick: () => P("/invoices"),
|
|
303
280
|
className: "mt-6 flex w-full items-center justify-between gap-3 rounded-xl border border-status-warning-text/30 bg-status-warning-bg-subtle px-5 py-4 text-left transition-shadow hover:shadow-md",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ j("div", {
|
|
305
282
|
className: "flex items-center gap-3",
|
|
306
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ A(x, { className: "h-5 w-5 shrink-0 text-status-warning-text" }), /* @__PURE__ */ A("span", {
|
|
307
284
|
className: "text-sm font-medium text-status-warning-text",
|
|
308
|
-
children:
|
|
309
|
-
count:
|
|
310
|
-
amount: r(
|
|
285
|
+
children: I("dashboard.openInvoices.label", "{{count}} open invoice · {{amount}} outstanding", {
|
|
286
|
+
count: J.openInvoiceCount,
|
|
287
|
+
amount: r(J.openInvoiceTotal, J.primaryCurrency)
|
|
311
288
|
})
|
|
312
289
|
})]
|
|
313
|
-
}), /* @__PURE__ */
|
|
290
|
+
}), /* @__PURE__ */ A(S, { className: "h-4 w-4 shrink-0 text-status-warning-text" })]
|
|
314
291
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
title:
|
|
317
|
-
description:
|
|
318
|
-
children: /* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ A(d, {
|
|
293
|
+
title: I("dashboard.quickActions.title", "Quick actions"),
|
|
294
|
+
description: I("dashboard.quickActions.description", "Jump straight into your workflow"),
|
|
295
|
+
children: /* @__PURE__ */ A("div", {
|
|
319
296
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
320
|
-
children:
|
|
297
|
+
children: se.map((e) => /* @__PURE__ */ j("button", {
|
|
321
298
|
type: "button",
|
|
322
|
-
onClick: () =>
|
|
299
|
+
onClick: () => P(e.path),
|
|
323
300
|
className: "group flex items-center gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 text-left transition-all hover:-translate-y-0.5 hover:border-border-seam hover:shadow-md",
|
|
324
301
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ A("span", {
|
|
326
303
|
className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
327
304
|
children: e.icon
|
|
328
305
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ j("span", {
|
|
330
307
|
className: "min-w-0 flex-1",
|
|
331
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ A("span", {
|
|
332
309
|
className: "block text-sm font-medium text-text-primary",
|
|
333
|
-
children:
|
|
334
|
-
}), /* @__PURE__ */
|
|
310
|
+
children: I(e.labelKey, e.fallbackLabel)
|
|
311
|
+
}), /* @__PURE__ */ A("span", {
|
|
335
312
|
className: "block text-xs text-text-secondary",
|
|
336
|
-
children:
|
|
313
|
+
children: I(e.descriptionKey, e.fallbackDescription)
|
|
337
314
|
})]
|
|
338
315
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ A(S, { className: "h-4 w-4 shrink-0 text-text-secondary transition-transform group-hover:translate-x-0.5" })
|
|
340
317
|
]
|
|
341
318
|
}, e.path))
|
|
342
319
|
})
|
|
@@ -345,6 +322,6 @@ function F() {
|
|
|
345
322
|
});
|
|
346
323
|
}
|
|
347
324
|
//#endregion
|
|
348
|
-
export {
|
|
325
|
+
export { P as DashboardPage };
|
|
349
326
|
|
|
350
327
|
//# sourceMappingURL=DashboardPage.js.map
|