@burdenoff/microfe-subscriberbot 2026.1103.2 → 2026.1105.2
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/index.js +3 -3
- package/dist/stories/Accessibility.stories.d.ts +13 -0
- package/dist/stories/Accessibility.stories.d.ts.map +1 -0
- package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts +1 -0
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/DashboardPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/InboxPage.stories.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.js +168 -168
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +116 -116
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +211 -211
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/components/Modal.d.ts.map +1 -1
- package/dist/subscriberbot/components/Modal.js +43 -33
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.d.ts +6 -0
- package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +2 -1
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.js +10 -10
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.d.ts +2 -0
- package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +46 -37
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +6 -6
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +6 -6
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.js +149 -147
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +143 -135
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +114 -114
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +3 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js +5 -3
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +4 -4
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +11 -11
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +29 -29
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +43 -43
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +4 -4
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +14 -14
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.js +242 -237
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/viz.d.ts +1 -0
- package/dist/subscriberbot/components/viz.d.ts.map +1 -1
- package/dist/subscriberbot/components/viz.js +100 -101
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/hooks/index.js +1 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts +7 -0
- package/dist/subscriberbot/hooks/useFormError.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useFormError.js +28 -0
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -0
- package/dist/subscriberbot/hooks/useFormatters.d.ts +11 -0
- package/dist/subscriberbot/hooks/useFormatters.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useFormatters.js +13 -0
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +371 -370
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -1
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.js +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +124 -124
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts +0 -10
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +115 -98
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts +0 -10
- package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +421 -402
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +130 -121
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts +0 -12
- package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +237 -215
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.js +303 -295
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.js +57 -57
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts +0 -13
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +202 -196
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +0 -18
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +283 -275
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +0 -6
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +85 -77
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +0 -9
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +136 -136
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +0 -9
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +272 -260
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +0 -10
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +96 -96
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +0 -11
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +46 -46
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +0 -11
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +181 -171
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +0 -9
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +164 -164
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +0 -9
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +197 -181
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +0 -8
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +79 -79
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +0 -9
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +147 -147
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +0 -10
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +204 -188
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +0 -9
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +80 -80
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +0 -10
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +484 -458
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +0 -8
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +146 -136
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +0 -10
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +88 -87
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +0 -11
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +520 -490
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +0 -8
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +112 -91
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +0 -8
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +97 -96
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +76 -74
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +5 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +26 -25
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.d.ts +16 -5
- package/dist/subscriberbot/utils/formatters.d.ts.map +1 -1
- package/dist/subscriberbot/utils/formatters.js +57 -25
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts +2 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -21
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { useSubscriberBot as e } from "../context/SubscriberBotContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { ErrorView as
|
|
9
|
-
import { Donut as
|
|
2
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
+
import { useFormatters as n } from "../hooks/useFormatters.js";
|
|
4
|
+
import { PageLayout as r } from "../components/PageLayout.js";
|
|
5
|
+
import { MetricsCard as i } from "../components/MetricsCard.js";
|
|
6
|
+
import { StatusBadge as a } from "../components/StatusBadge.js";
|
|
7
|
+
import { EmptyState as o } from "../components/EmptyState.js";
|
|
8
|
+
import { ErrorView as ee, LoadingView as te, Section as s } from "../components/StateViews.js";
|
|
9
|
+
import { Donut as c, Legend as l, Timeline as u } from "../components/viz.js";
|
|
10
10
|
import "../components/index.js";
|
|
11
|
-
import { useDecisions as
|
|
12
|
-
import { buildUpcomingRenewals as
|
|
13
|
-
import { useCompactViewport as
|
|
11
|
+
import { useDecisions as d, useInboxMessages as f, useInvoices as p, useRelationships as m, useRenewalEvents as h } from "../hooks/useSubscriberBotApi.js";
|
|
12
|
+
import { buildUpcomingRenewals as ne, recurringSpend as g } from "../utils/portfolio.js";
|
|
13
|
+
import { useCompactViewport as _ } from "../hooks/useCompactViewport.js";
|
|
14
14
|
import { MobileDashboard as re } from "../components/mobile/MobileDashboard.js";
|
|
15
15
|
import "../components/mobile/index.js";
|
|
16
|
-
import { useMemo as
|
|
17
|
-
import { AlertTriangle as
|
|
18
|
-
import { jsx as
|
|
19
|
-
import { GlassCard as
|
|
16
|
+
import { useMemo as v } from "react";
|
|
17
|
+
import { AlertTriangle as y, ArrowRight as b, ArrowUpRight as x, Bot as S, CalendarClock as C, Inbox as w, Repeat2 as T, ShieldCheck as E, Sparkles as ie, Wallet as ae } from "lucide-react";
|
|
18
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
19
|
+
import { GlassCard as k, PagePurpose as A } from "@burdenoff/fe-libs/ui";
|
|
20
20
|
//#region src/subscriberbot/pages/DashboardPage.tsx
|
|
21
|
-
function
|
|
22
|
-
let { navigateTo: P, currentUser: F } = e(), I =
|
|
21
|
+
function j() {
|
|
22
|
+
let { formatCurrency: j, formatEnumLabel: M, formatRelativeTime: N } = n(), { navigateTo: P, currentUser: F } = e(), I = t(), L = m({ pagination: {
|
|
23
23
|
limit: 100,
|
|
24
24
|
offset: 0
|
|
25
|
-
} }), R =
|
|
25
|
+
} }), R = p({ pagination: {
|
|
26
26
|
limit: 50,
|
|
27
27
|
offset: 0
|
|
28
|
-
} }), z =
|
|
28
|
+
} }), z = f({ pagination: {
|
|
29
29
|
limit: 50,
|
|
30
30
|
offset: 0
|
|
31
|
-
} }), B =
|
|
31
|
+
} }), B = h({ upcomingOnly: !0 }), V = _(), H = d({ status: "PROPOSED" }, { enabled: V }), U = v(() => L.data?.items ?? [], [L.data]), W = v(() => R.data?.items ?? [], [R.data]), G = v(() => z.data?.items ?? [], [z.data]), K = v(() => B.data ?? [], [B.data]), q = v(() => {
|
|
32
32
|
let e = /* @__PURE__ */ new Map();
|
|
33
33
|
return U.forEach((t) => e.set(t.id, t)), e;
|
|
34
|
-
}, [U]), J =
|
|
35
|
-
let e =
|
|
34
|
+
}, [U]), J = v(() => {
|
|
35
|
+
let e = g(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;
|
|
36
36
|
return {
|
|
37
37
|
activeCount: e.activeCount,
|
|
38
38
|
totalCount: U.length,
|
|
@@ -47,27 +47,38 @@ function P() {
|
|
|
47
47
|
U,
|
|
48
48
|
G,
|
|
49
49
|
W
|
|
50
|
-
]), Y =
|
|
50
|
+
]), Y = v(() => {
|
|
51
51
|
let e = /* @__PURE__ */ new Map();
|
|
52
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]) => ({
|
|
53
|
-
label:
|
|
53
|
+
label: M(e),
|
|
54
54
|
value: t
|
|
55
55
|
}));
|
|
56
|
-
}, [U]), X =
|
|
56
|
+
}, [U, M]), X = v(() => ne(U, K, (e) => M(e)), [
|
|
57
|
+
U,
|
|
58
|
+
K,
|
|
59
|
+
M
|
|
60
|
+
]), Z = v(() => X.slice(0, 6).map((e) => ({
|
|
57
61
|
title: e.title,
|
|
58
|
-
sub:
|
|
62
|
+
sub: N(e.when),
|
|
59
63
|
tone: e.soon ? "warning" : "default",
|
|
60
|
-
meta: e.amount == null ? void 0 :
|
|
61
|
-
})), [
|
|
62
|
-
|
|
64
|
+
meta: e.amount == null ? void 0 : j(e.amount, e.currency ?? J.primaryCurrency, { maximumFractionDigits: 0 })
|
|
65
|
+
})), [
|
|
66
|
+
X,
|
|
67
|
+
J.primaryCurrency,
|
|
68
|
+
j,
|
|
69
|
+
N
|
|
70
|
+
]), Q = v(() => G.filter((e) => e.actionRequired), [G]), oe = L.isLoading || R.isLoading || z.isLoading || B.isLoading, se = L.isError && R.isError && z.isError && B.isError;
|
|
71
|
+
if (oe) return /* @__PURE__ */ D(r, {
|
|
72
|
+
dataTour: "subscriberbot-home",
|
|
63
73
|
title: I("dashboard.title", "Overview"),
|
|
64
74
|
description: I("dashboard.description", "Your recurring digital relationships at a glance"),
|
|
65
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ D(te, { label: I("dashboard.loading", "Loading your subscription portfolio…") })
|
|
66
76
|
});
|
|
67
|
-
if (
|
|
77
|
+
if (se) return /* @__PURE__ */ D(r, {
|
|
78
|
+
dataTour: "subscriberbot-home",
|
|
68
79
|
title: I("dashboard.title", "Overview"),
|
|
69
80
|
description: I("dashboard.description", "Your recurring digital relationships at a glance"),
|
|
70
|
-
children: /* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ D(ee, {
|
|
71
82
|
message: I("dashboard.error", "We couldn't reach the Subscriber Bot service. Please try again."),
|
|
72
83
|
onRetry: () => {
|
|
73
84
|
L.refetch(), R.refetch(), z.refetch(), B.refetch();
|
|
@@ -75,7 +86,7 @@ function P() {
|
|
|
75
86
|
})
|
|
76
87
|
});
|
|
77
88
|
let $ = F?.firstName || F?.name?.split(" ")[0];
|
|
78
|
-
if (V) return /* @__PURE__ */
|
|
89
|
+
if (V) return /* @__PURE__ */ D(re, {
|
|
79
90
|
greetingName: $ || void 0,
|
|
80
91
|
spend: {
|
|
81
92
|
monthly: J.monthlySpend,
|
|
@@ -90,13 +101,13 @@ function P() {
|
|
|
90
101
|
openInvoiceTotal: J.openInvoiceTotal,
|
|
91
102
|
navigateTo: P
|
|
92
103
|
});
|
|
93
|
-
let
|
|
104
|
+
let ce = [
|
|
94
105
|
{
|
|
95
106
|
labelKey: "dashboard.quickActions.addRelationship.label",
|
|
96
107
|
descriptionKey: "dashboard.quickActions.addRelationship.description",
|
|
97
108
|
fallbackLabel: "Add a relationship",
|
|
98
109
|
fallbackDescription: "Track a new subscription",
|
|
99
|
-
icon: /* @__PURE__ */
|
|
110
|
+
icon: /* @__PURE__ */ D(T, { className: "h-5 w-5" }),
|
|
100
111
|
path: "/relationships/new"
|
|
101
112
|
},
|
|
102
113
|
{
|
|
@@ -104,7 +115,7 @@ function P() {
|
|
|
104
115
|
descriptionKey: "dashboard.quickActions.discoverProviders.description",
|
|
105
116
|
fallbackLabel: "Discover providers",
|
|
106
117
|
fallbackDescription: "Browse the registry",
|
|
107
|
-
icon: /* @__PURE__ */
|
|
118
|
+
icon: /* @__PURE__ */ D(ie, { className: "h-5 w-5" }),
|
|
108
119
|
path: "/providers"
|
|
109
120
|
},
|
|
110
121
|
{
|
|
@@ -112,7 +123,7 @@ function P() {
|
|
|
112
123
|
descriptionKey: "dashboard.quickActions.openInbox.description",
|
|
113
124
|
fallbackLabel: "Open inbox",
|
|
114
125
|
fallbackDescription: "Merged communications",
|
|
115
|
-
icon: /* @__PURE__ */
|
|
126
|
+
icon: /* @__PURE__ */ D(w, { className: "h-5 w-5" }),
|
|
116
127
|
path: "/inbox"
|
|
117
128
|
},
|
|
118
129
|
{
|
|
@@ -120,151 +131,156 @@ function P() {
|
|
|
120
131
|
descriptionKey: "dashboard.quickActions.configureAgents.description",
|
|
121
132
|
fallbackLabel: "Configure agents",
|
|
122
133
|
fallbackDescription: "Automate your portfolio",
|
|
123
|
-
icon: /* @__PURE__ */
|
|
134
|
+
icon: /* @__PURE__ */ D(S, { className: "h-5 w-5" }),
|
|
124
135
|
path: "/agents"
|
|
125
136
|
}
|
|
126
137
|
];
|
|
127
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ O(r, {
|
|
139
|
+
dataTour: "subscriberbot-home",
|
|
128
140
|
title: $ ? I("dashboard.welcomeBack", "Welcome back, {{name}}", { name: $ }) : I("dashboard.title", "Overview"),
|
|
129
141
|
description: I("dashboard.description", "Everything you pay for on repeat — in one intelligent console."),
|
|
130
142
|
children: [
|
|
131
|
-
/* @__PURE__ */ A
|
|
143
|
+
/* @__PURE__ */ D(A, {
|
|
132
144
|
className: "mb-6",
|
|
133
145
|
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.")
|
|
134
146
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ O("div", {
|
|
136
148
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
149
|
+
"data-tour": "subscriberbot-home-metrics",
|
|
137
150
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ D(i, {
|
|
139
152
|
featured: !0,
|
|
140
|
-
icon: /* @__PURE__ */
|
|
141
|
-
value:
|
|
153
|
+
icon: /* @__PURE__ */ D(ae, {}),
|
|
154
|
+
value: j(J.monthlySpend, J.primaryCurrency, { maximumFractionDigits: 0 }),
|
|
142
155
|
label: I("dashboard.metrics.recurringSpend", "Recurring spend / month")
|
|
143
156
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
icon: /* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ D(i, {
|
|
158
|
+
icon: /* @__PURE__ */ D(T, {}),
|
|
146
159
|
value: J.activeCount,
|
|
147
160
|
label: I("dashboard.metrics.activeRelationships", "Active relationships")
|
|
148
161
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
icon: /* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ D(i, {
|
|
163
|
+
icon: /* @__PURE__ */ D(C, {}),
|
|
151
164
|
value: X.length,
|
|
152
165
|
label: I("dashboard.metrics.upcomingRenewals", "Upcoming renewals")
|
|
153
166
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
icon: /* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ D(i, {
|
|
168
|
+
icon: /* @__PURE__ */ D(y, {}),
|
|
156
169
|
value: J.actionRequired,
|
|
157
170
|
label: I("dashboard.metrics.needsAction", "Need your action"),
|
|
158
171
|
trend: J.actionRequired > 0 ? "down" : void 0
|
|
159
172
|
})
|
|
160
173
|
]
|
|
161
174
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ O("div", {
|
|
163
176
|
className: "mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ D("div", {
|
|
165
178
|
className: "lg:col-span-2",
|
|
166
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ D(s, {
|
|
167
180
|
title: I("dashboard.renewals.title", "Upcoming renewals"),
|
|
168
181
|
description: I("dashboard.renewals.description", "What's charging next across your portfolio"),
|
|
169
182
|
className: "mt-0",
|
|
170
|
-
|
|
183
|
+
dataTour: "subscriberbot-home-renewals",
|
|
184
|
+
action: /* @__PURE__ */ O("button", {
|
|
171
185
|
type: "button",
|
|
172
186
|
onClick: () => P("/relationships"),
|
|
173
187
|
className: "inline-flex items-center gap-1 text-sm font-medium text-text-link hover:underline",
|
|
174
188
|
children: [
|
|
175
189
|
I("common.viewAll", "View all"),
|
|
176
190
|
" ",
|
|
177
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ D(x, { className: "h-3.5 w-3.5" })
|
|
178
192
|
]
|
|
179
193
|
}),
|
|
180
|
-
children: /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ D(k, {
|
|
181
195
|
treatment: "plain",
|
|
182
196
|
className: "p-5",
|
|
183
|
-
children: Z.length === 0 ? /* @__PURE__ */
|
|
197
|
+
children: Z.length === 0 ? /* @__PURE__ */ D(o, {
|
|
184
198
|
illustration: "empty-calendar",
|
|
185
199
|
title: I("dashboard.renewals.emptyTitle", "No upcoming renewals"),
|
|
186
200
|
description: I("dashboard.renewals.emptyDescription", "Renewals you track will appear here ahead of time.")
|
|
187
|
-
}) : /* @__PURE__ */
|
|
201
|
+
}) : /* @__PURE__ */ D(u, { items: Z })
|
|
188
202
|
})
|
|
189
203
|
})
|
|
190
|
-
}), /* @__PURE__ */
|
|
204
|
+
}), /* @__PURE__ */ O("div", {
|
|
191
205
|
className: "flex flex-col gap-6",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ D(s, {
|
|
193
207
|
title: I("dashboard.portfolio.title", "Portfolio by status"),
|
|
194
208
|
description: I("dashboard.portfolio.description", "Where your relationships stand"),
|
|
195
209
|
className: "mt-0",
|
|
196
|
-
|
|
210
|
+
dataTour: "subscriberbot-home-portfolio",
|
|
211
|
+
children: /* @__PURE__ */ D(k, {
|
|
197
212
|
treatment: "glass",
|
|
198
213
|
className: "p-5",
|
|
199
|
-
children: Y.length === 0 ? /* @__PURE__ */
|
|
214
|
+
children: Y.length === 0 ? /* @__PURE__ */ D(o, {
|
|
200
215
|
illustration: "empty-data",
|
|
201
216
|
title: I("dashboard.portfolio.emptyTitle", "No relationships yet"),
|
|
202
217
|
description: I("dashboard.portfolio.emptyDescription", "Add your first subscription to see the breakdown."),
|
|
203
|
-
action: /* @__PURE__ */
|
|
218
|
+
action: /* @__PURE__ */ D("button", {
|
|
204
219
|
type: "button",
|
|
205
220
|
onClick: () => P("/relationships/new"),
|
|
206
221
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
207
222
|
children: I("dashboard.portfolio.addRelationship", "Add relationship")
|
|
208
223
|
})
|
|
209
|
-
}) : /* @__PURE__ */
|
|
224
|
+
}) : /* @__PURE__ */ O("div", {
|
|
210
225
|
className: "flex flex-col items-center gap-5 sm:flex-row sm:items-center lg:flex-col xl:flex-row",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ D(c, {
|
|
212
227
|
data: Y,
|
|
213
228
|
size: 148,
|
|
214
229
|
thickness: 20,
|
|
215
230
|
centerLabel: String(J.totalCount),
|
|
216
231
|
centerSub: I(J.totalCount === 1 ? "dashboard.portfolio.relationshipSingular" : "dashboard.portfolio.relationshipPlural", J.totalCount === 1 ? "relationship" : "relationships"),
|
|
217
232
|
className: "shrink-0"
|
|
218
|
-
}), /* @__PURE__ */
|
|
233
|
+
}), /* @__PURE__ */ D(l, {
|
|
219
234
|
data: Y,
|
|
220
235
|
className: "w-full min-w-0 flex-1"
|
|
221
236
|
})]
|
|
222
237
|
})
|
|
223
238
|
})
|
|
224
|
-
}), /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ D(s, {
|
|
225
240
|
title: I("dashboard.needsAttention.title", "Needs attention"),
|
|
226
241
|
description: I("dashboard.needsAttention.description", "Required actions from the Universal Inbox"),
|
|
227
242
|
className: "mt-0",
|
|
228
|
-
|
|
243
|
+
dataTour: "subscriberbot-home-needs-attention",
|
|
244
|
+
action: /* @__PURE__ */ D("button", {
|
|
229
245
|
type: "button",
|
|
230
246
|
onClick: () => P("/inbox"),
|
|
231
247
|
className: "text-sm font-medium text-text-link hover:underline",
|
|
232
248
|
children: I("dashboard.needsAttention.openInbox", "Open inbox")
|
|
233
249
|
}),
|
|
234
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ D(k, {
|
|
235
251
|
treatment: "plain",
|
|
236
252
|
className: "p-3",
|
|
237
|
-
children: Q.length === 0 ? /* @__PURE__ */
|
|
253
|
+
children: Q.length === 0 ? /* @__PURE__ */ O("div", {
|
|
238
254
|
className: "flex items-center gap-3 px-2 py-4",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ D("span", {
|
|
240
256
|
className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-status-success-bg-subtle text-status-success-text",
|
|
241
|
-
children: /* @__PURE__ */
|
|
242
|
-
}), /* @__PURE__ */
|
|
257
|
+
children: /* @__PURE__ */ D(E, { className: "h-5 w-5" })
|
|
258
|
+
}), /* @__PURE__ */ O("div", {
|
|
243
259
|
className: "min-w-0",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ D("p", {
|
|
245
261
|
className: "text-sm font-medium text-text-primary",
|
|
246
262
|
children: I("dashboard.needsAttention.allCaughtUp", "You're all caught up")
|
|
247
|
-
}), /* @__PURE__ */
|
|
263
|
+
}), /* @__PURE__ */ D("p", {
|
|
248
264
|
className: "text-xs text-text-secondary",
|
|
249
265
|
children: I("dashboard.needsAttention.allCaughtUpDescription", "Required actions across your channels will surface here.")
|
|
250
266
|
})]
|
|
251
267
|
})]
|
|
252
|
-
}) : /* @__PURE__ */
|
|
268
|
+
}) : /* @__PURE__ */ D("ul", {
|
|
253
269
|
className: "space-y-1",
|
|
254
|
-
children: Q.slice(0, 5).map((e) => /* @__PURE__ */
|
|
270
|
+
children: Q.slice(0, 5).map((e) => /* @__PURE__ */ D("li", { children: /* @__PURE__ */ O("button", {
|
|
255
271
|
type: "button",
|
|
256
272
|
onClick: () => P("/inbox"),
|
|
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-
|
|
258
|
-
children: [/* @__PURE__ */
|
|
273
|
+
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-start transition-colors hover:bg-status-warning-bg-subtle",
|
|
274
|
+
children: [/* @__PURE__ */ O("div", {
|
|
259
275
|
className: "min-w-0 flex-1",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ D("p", {
|
|
261
277
|
className: "truncate text-sm font-medium text-text-primary",
|
|
262
278
|
children: e.subject || I("dashboard.needsAttention.noSubject", "(no subject)")
|
|
263
|
-
}), e.preview && /* @__PURE__ */
|
|
279
|
+
}), e.preview && /* @__PURE__ */ D("p", {
|
|
264
280
|
className: "truncate text-xs text-text-secondary",
|
|
265
281
|
children: e.preview
|
|
266
282
|
})]
|
|
267
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ D(a, {
|
|
268
284
|
status: e.category,
|
|
269
285
|
className: "shrink-0"
|
|
270
286
|
})]
|
|
@@ -274,46 +290,47 @@ function P() {
|
|
|
274
290
|
})]
|
|
275
291
|
})]
|
|
276
292
|
}),
|
|
277
|
-
J.openInvoiceCount > 0 && /* @__PURE__ */
|
|
293
|
+
J.openInvoiceCount > 0 && /* @__PURE__ */ O("button", {
|
|
278
294
|
type: "button",
|
|
279
295
|
onClick: () => P("/invoices"),
|
|
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-
|
|
281
|
-
children: [/* @__PURE__ */
|
|
296
|
+
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-start transition-shadow hover:shadow-md",
|
|
297
|
+
children: [/* @__PURE__ */ O("div", {
|
|
282
298
|
className: "flex items-center gap-3",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ D(y, { className: "h-5 w-5 shrink-0 text-status-warning-text" }), /* @__PURE__ */ D("span", {
|
|
284
300
|
className: "text-sm font-medium text-status-warning-text",
|
|
285
301
|
children: I("dashboard.openInvoices.label", "{{count}} open invoice · {{amount}} outstanding", {
|
|
286
302
|
count: J.openInvoiceCount,
|
|
287
|
-
amount:
|
|
303
|
+
amount: j(J.openInvoiceTotal, J.primaryCurrency)
|
|
288
304
|
})
|
|
289
305
|
})]
|
|
290
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ D(b, { className: "rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text" })]
|
|
291
307
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ D(s, {
|
|
293
309
|
title: I("dashboard.quickActions.title", "Quick actions"),
|
|
294
310
|
description: I("dashboard.quickActions.description", "Jump straight into your workflow"),
|
|
295
|
-
|
|
311
|
+
dataTour: "subscriberbot-home-quick-actions",
|
|
312
|
+
children: /* @__PURE__ */ D("div", {
|
|
296
313
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
297
|
-
children:
|
|
314
|
+
children: ce.map((e) => /* @__PURE__ */ O("button", {
|
|
298
315
|
type: "button",
|
|
299
316
|
onClick: () => P(e.path),
|
|
300
|
-
className: "group flex items-center gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 text-
|
|
317
|
+
className: "group flex items-center gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 text-start transition-all hover:-translate-y-0.5 hover:border-border-seam hover:shadow-md",
|
|
301
318
|
children: [
|
|
302
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ D("span", {
|
|
303
320
|
className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
304
321
|
children: e.icon
|
|
305
322
|
}),
|
|
306
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ O("span", {
|
|
307
324
|
className: "min-w-0 flex-1",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ D("span", {
|
|
309
326
|
className: "block text-sm font-medium text-text-primary",
|
|
310
327
|
children: I(e.labelKey, e.fallbackLabel)
|
|
311
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ D("span", {
|
|
312
329
|
className: "block text-xs text-text-secondary",
|
|
313
330
|
children: I(e.descriptionKey, e.fallbackDescription)
|
|
314
331
|
})]
|
|
315
332
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ D(b, { className: "rtl:rotate-180 h-4 w-4 shrink-0 text-text-secondary transition-transform group-hover:translate-x-0.5" })
|
|
317
334
|
]
|
|
318
335
|
}, e.path))
|
|
319
336
|
})
|
|
@@ -322,6 +339,6 @@ function P() {
|
|
|
322
339
|
});
|
|
323
340
|
}
|
|
324
341
|
//#endregion
|
|
325
|
-
export {
|
|
342
|
+
export { j as DashboardPage };
|
|
326
343
|
|
|
327
344
|
//# sourceMappingURL=DashboardPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPage.js","names":[],"sources":["../../../src/subscriberbot/pages/DashboardPage.tsx"],"sourcesContent":["/**\n * Dashboard / Overview\n * @module subscriberbot/pages\n *\n * The Subscriber Bot landing page: a premium fintech console over every\n * recurring digital relationship — total recurring spend, portfolio-by-status,\n * upcoming renewals, the action-required inbox, and outstanding invoices. Every\n * number and chart is COMPUTED from real data returned by\n * `wspace-subscriberbot-svc` — nothing is mocked.\n */\n\nimport { useMemo } from 'react';\nimport {\n Repeat2,\n Wallet,\n CalendarClock,\n Inbox,\n AlertTriangle,\n ArrowRight,\n ArrowUpRight,\n Sparkles,\n Bot,\n ShieldCheck,\n} from 'lucide-react';\nimport { PagePurpose, GlassCard } from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n MetricsCard,\n StatusBadge,\n EmptyState,\n LoadingView,\n ErrorView,\n Section,\n Donut,\n Legend,\n Timeline,\n type Segment,\n type TimelineItem,\n} from '../components';\nimport { useSubscriberBot } from '../context/SubscriberBotContext';\nimport {\n useRelationships,\n useInvoices,\n useInboxMessages,\n useRenewalEvents,\n useDecisions,\n} from '../hooks/useSubscriberBotApi';\nimport { useTr } from '../hooks/useTr';\nimport { formatCurrency, formatRelativeTime, formatEnumLabel } from '../utils/formatters';\nimport { buildUpcomingRenewals, recurringSpend } from '../utils/portfolio';\nimport { useCompactViewport } from '../hooks/useCompactViewport';\nimport { MobileDashboard } from '../components/mobile';\nimport type { SubRelationship } from '../types';\n\nexport function DashboardPage() {\n const { navigateTo, currentUser } = useSubscriberBot();\n const tr = useTr();\n\n const relationshipsQ = useRelationships({ pagination: { limit: 100, offset: 0 } });\n const invoicesQ = useInvoices({ pagination: { limit: 50, offset: 0 } });\n const inboxQ = useInboxMessages({ pagination: { limit: 50, offset: 0 } });\n const renewalsQ = useRenewalEvents({ upcomingOnly: true });\n // Phone layout (BOFF-4010) also surfaces open AI recommendations; the\n // desktop console keeps them on the dedicated decisions page, so only\n // fetch them when the mobile overview will render them.\n const compact = useCompactViewport();\n const decisionsQ = useDecisions({ status: 'PROPOSED' }, { enabled: compact });\n\n const relationships = useMemo(() => relationshipsQ.data?.items ?? [], [relationshipsQ.data]);\n const invoices = useMemo(() => invoicesQ.data?.items ?? [], [invoicesQ.data]);\n const messages = useMemo(() => inboxQ.data?.items ?? [], [inboxQ.data]);\n const renewals = useMemo(() => renewalsQ.data ?? [], [renewalsQ.data]);\n\n // Fast label lookup so mobile AI-recommendation rows can name their relationship.\n const relationshipById = useMemo(() => {\n const map = new Map<string, SubRelationship>();\n relationships.forEach((r) => map.set(r.id, r));\n return map;\n }, [relationships]);\n\n const stats = useMemo(() => {\n const spend = recurringSpend(relationships);\n // BOFF-8660 — KPI must match the Universal Inbox \"need action\" counter\n // and the on-page Needs-attention list, both of which count by\n // `actionRequired` alone (read state is irrelevant). The previous\n // `&& !m.isRead` clause made the tile show 0 the moment the user read\n // the only action-required message, contradicting the surfaces below.\n const actionRequired = messages.filter((m) => m.actionRequired).length;\n const openInvoices = invoices.filter(\n (i) => i.status === 'ISSUED' || i.status === 'OVERDUE' || i.status === 'FAILED'\n );\n const openInvoiceTotal = openInvoices.reduce((sum, i) => sum + i.total, 0);\n const atRisk = relationships.filter(\n (r) => r.status === 'PAST_DUE' || r.status === 'LAPSED'\n ).length;\n\n return {\n activeCount: spend.activeCount,\n totalCount: relationships.length,\n monthlySpend: spend.monthly,\n primaryCurrency: spend.currency,\n actionRequired,\n openInvoiceCount: openInvoices.length,\n openInvoiceTotal,\n atRisk,\n };\n }, [relationships, messages, invoices]);\n\n // Portfolio-by-status → donut segments (grouped from real relationships).\n const statusSegments = useMemo<Segment[]>(() => {\n const counts = new Map<string, number>();\n relationships.forEach((r) => counts.set(r.status, (counts.get(r.status) ?? 0) + 1));\n return Array.from(counts.entries())\n .sort((a, b) => b[1] - a[1])\n .map(([status, value]) => ({ label: formatEnumLabel(status), value }));\n }, [relationships]);\n\n // Upcoming renewals, soonest first: real renewal events when present,\n // otherwise each relationship's own future `renewsAt` (shared with mobile).\n const upcoming = useMemo(\n () => buildUpcomingRenewals(relationships, renewals, (eventType) => formatEnumLabel(eventType)),\n [relationships, renewals]\n );\n\n const timelineItems = useMemo<TimelineItem[]>(\n () =>\n upcoming.slice(0, 6).map((u) => ({\n title: u.title,\n sub: formatRelativeTime(u.when),\n tone: u.soon ? 'warning' : 'default',\n meta:\n u.amount != null\n ? formatCurrency(u.amount, u.currency ?? stats.primaryCurrency, {\n maximumFractionDigits: 0,\n })\n : undefined,\n })),\n [upcoming, stats.primaryCurrency]\n );\n\n const actionMessages = useMemo(() => messages.filter((m) => m.actionRequired), [messages]);\n\n const isLoading =\n relationshipsQ.isLoading || invoicesQ.isLoading || inboxQ.isLoading || renewalsQ.isLoading;\n const isError =\n relationshipsQ.isError && invoicesQ.isError && inboxQ.isError && renewalsQ.isError;\n\n if (isLoading) {\n return (\n <PageLayout\n title={tr('dashboard.title', 'Overview')}\n description={tr(\n 'dashboard.description',\n 'Your recurring digital relationships at a glance'\n )}\n >\n <LoadingView label={tr('dashboard.loading', 'Loading your subscription portfolio…')} />\n </PageLayout>\n );\n }\n\n if (isError) {\n return (\n <PageLayout\n title={tr('dashboard.title', 'Overview')}\n description={tr(\n 'dashboard.description',\n 'Your recurring digital relationships at a glance'\n )}\n >\n <ErrorView\n message={tr(\n 'dashboard.error',\n \"We couldn't reach the Subscriber Bot service. Please try again.\"\n )}\n onRetry={() => {\n void relationshipsQ.refetch();\n void invoicesQ.refetch();\n void inboxQ.refetch();\n void renewalsQ.refetch();\n }}\n />\n </PageLayout>\n );\n }\n\n const greetingName = currentUser?.firstName || currentUser?.name?.split(' ')[0];\n\n if (compact) {\n return (\n <MobileDashboard\n greetingName={greetingName || undefined}\n spend={{\n monthly: stats.monthlySpend,\n currency: stats.primaryCurrency,\n activeCount: stats.activeCount,\n }}\n upcoming={upcoming}\n actionMessages={actionMessages}\n decisions={decisionsQ.data?.items ?? []}\n relationshipLabel={(id) => relationshipById.get(id)?.label}\n openInvoiceCount={stats.openInvoiceCount}\n openInvoiceTotal={stats.openInvoiceTotal}\n navigateTo={navigateTo}\n />\n );\n }\n\n const quickActions = [\n {\n labelKey: 'dashboard.quickActions.addRelationship.label',\n descriptionKey: 'dashboard.quickActions.addRelationship.description',\n fallbackLabel: 'Add a relationship',\n fallbackDescription: 'Track a new subscription',\n icon: <Repeat2 className=\"h-5 w-5\" />,\n path: '/relationships/new',\n },\n {\n labelKey: 'dashboard.quickActions.discoverProviders.label',\n descriptionKey: 'dashboard.quickActions.discoverProviders.description',\n fallbackLabel: 'Discover providers',\n fallbackDescription: 'Browse the registry',\n icon: <Sparkles className=\"h-5 w-5\" />,\n path: '/providers',\n },\n {\n labelKey: 'dashboard.quickActions.openInbox.label',\n descriptionKey: 'dashboard.quickActions.openInbox.description',\n fallbackLabel: 'Open inbox',\n fallbackDescription: 'Merged communications',\n icon: <Inbox className=\"h-5 w-5\" />,\n path: '/inbox',\n },\n {\n labelKey: 'dashboard.quickActions.configureAgents.label',\n descriptionKey: 'dashboard.quickActions.configureAgents.description',\n fallbackLabel: 'Configure agents',\n fallbackDescription: 'Automate your portfolio',\n icon: <Bot className=\"h-5 w-5\" />,\n path: '/agents',\n },\n ];\n\n return (\n <PageLayout\n title={\n greetingName\n ? tr('dashboard.welcomeBack', 'Welcome back, {{name}}', { name: greetingName })\n : tr('dashboard.title', 'Overview')\n }\n description={tr(\n 'dashboard.description',\n 'Everything you pay for on repeat — in one intelligent console.'\n )}\n >\n <PagePurpose className=\"mb-6\">\n {tr(\n 'dashboard.purpose',\n '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.'\n )}\n </PagePurpose>\n\n {/* KPI tiles */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <MetricsCard\n featured\n icon={<Wallet />}\n value={formatCurrency(stats.monthlySpend, stats.primaryCurrency, {\n maximumFractionDigits: 0,\n })}\n label={tr('dashboard.metrics.recurringSpend', 'Recurring spend / month')}\n />\n <MetricsCard\n icon={<Repeat2 />}\n value={stats.activeCount}\n label={tr('dashboard.metrics.activeRelationships', 'Active relationships')}\n />\n <MetricsCard\n icon={<CalendarClock />}\n value={upcoming.length}\n label={tr('dashboard.metrics.upcomingRenewals', 'Upcoming renewals')}\n />\n <MetricsCard\n icon={<AlertTriangle />}\n value={stats.actionRequired}\n label={tr('dashboard.metrics.needsAction', 'Need your action')}\n trend={stats.actionRequired > 0 ? 'down' : undefined}\n />\n </div>\n\n {/* Main console: renewals (left) + portfolio donut & needs-attention (right) */}\n <div className=\"mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Upcoming renewals timeline — spans two columns on desktop */}\n <div className=\"lg:col-span-2\">\n <Section\n title={tr('dashboard.renewals.title', 'Upcoming renewals')}\n description={tr(\n 'dashboard.renewals.description',\n \"What's charging next across your portfolio\"\n )}\n className=\"mt-0\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"inline-flex items-center gap-1 text-sm font-medium text-text-link hover:underline\"\n >\n {tr('common.viewAll', 'View all')} <ArrowUpRight className=\"h-3.5 w-3.5\" />\n </button>\n }\n >\n <GlassCard treatment=\"plain\" className=\"p-5\">\n {timelineItems.length === 0 ? (\n <EmptyState\n illustration=\"empty-calendar\"\n title={tr('dashboard.renewals.emptyTitle', 'No upcoming renewals')}\n description={tr(\n 'dashboard.renewals.emptyDescription',\n 'Renewals you track will appear here ahead of time.'\n )}\n />\n ) : (\n <Timeline items={timelineItems} />\n )}\n </GlassCard>\n </Section>\n </div>\n\n {/* Right rail: portfolio-by-status donut + needs-attention panel */}\n <div className=\"flex flex-col gap-6\">\n <Section\n title={tr('dashboard.portfolio.title', 'Portfolio by status')}\n description={tr('dashboard.portfolio.description', 'Where your relationships stand')}\n className=\"mt-0\"\n >\n <GlassCard treatment=\"glass\" className=\"p-5\">\n {statusSegments.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('dashboard.portfolio.emptyTitle', 'No relationships yet')}\n description={tr(\n 'dashboard.portfolio.emptyDescription',\n 'Add your first subscription to see the breakdown.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships/new')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n {tr('dashboard.portfolio.addRelationship', 'Add relationship')}\n </button>\n }\n />\n ) : (\n <div className=\"flex flex-col items-center gap-5 sm:flex-row sm:items-center lg:flex-col xl:flex-row\">\n <Donut\n data={statusSegments}\n size={148}\n thickness={20}\n centerLabel={String(stats.totalCount)}\n centerSub={tr(\n stats.totalCount === 1\n ? 'dashboard.portfolio.relationshipSingular'\n : 'dashboard.portfolio.relationshipPlural',\n stats.totalCount === 1 ? 'relationship' : 'relationships'\n )}\n className=\"shrink-0\"\n />\n <Legend data={statusSegments} className=\"w-full min-w-0 flex-1\" />\n </div>\n )}\n </GlassCard>\n </Section>\n\n <Section\n title={tr('dashboard.needsAttention.title', 'Needs attention')}\n description={tr(\n 'dashboard.needsAttention.description',\n 'Required actions from the Universal Inbox'\n )}\n className=\"mt-0\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/inbox')}\n className=\"text-sm font-medium text-text-link hover:underline\"\n >\n {tr('dashboard.needsAttention.openInbox', 'Open inbox')}\n </button>\n }\n >\n <GlassCard treatment=\"plain\" className=\"p-3\">\n {actionMessages.length === 0 ? (\n <div className=\"flex items-center gap-3 px-2 py-4\">\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-lg bg-status-success-bg-subtle text-status-success-text\">\n <ShieldCheck className=\"h-5 w-5\" />\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-text-primary\">\n {tr('dashboard.needsAttention.allCaughtUp', \"You're all caught up\")}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'dashboard.needsAttention.allCaughtUpDescription',\n 'Required actions across your channels will surface here.'\n )}\n </p>\n </div>\n </div>\n ) : (\n <ul className=\"space-y-1\">\n {actionMessages.slice(0, 5).map((message) => (\n <li key={message.id}>\n <button\n type=\"button\"\n onClick={() => navigateTo('/inbox')}\n 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\"\n >\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {message.subject ||\n tr('dashboard.needsAttention.noSubject', '(no subject)')}\n </p>\n {message.preview && (\n <p className=\"truncate text-xs text-text-secondary\">\n {message.preview}\n </p>\n )}\n </div>\n <StatusBadge status={message.category} className=\"shrink-0\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </GlassCard>\n </Section>\n </div>\n </div>\n\n {/* Open-invoice call-out (only when there is real outstanding balance) */}\n {stats.openInvoiceCount > 0 && (\n <button\n type=\"button\"\n onClick={() => navigateTo('/invoices')}\n 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\"\n >\n <div className=\"flex items-center gap-3\">\n <AlertTriangle className=\"h-5 w-5 shrink-0 text-status-warning-text\" />\n <span className=\"text-sm font-medium text-status-warning-text\">\n {tr(\n 'dashboard.openInvoices.label',\n '{{count}} open invoice · {{amount}} outstanding',\n {\n count: stats.openInvoiceCount,\n amount: formatCurrency(stats.openInvoiceTotal, stats.primaryCurrency),\n }\n )}\n </span>\n </div>\n <ArrowRight className=\"h-4 w-4 shrink-0 text-status-warning-text\" />\n </button>\n )}\n\n {/* Quick actions */}\n <Section\n title={tr('dashboard.quickActions.title', 'Quick actions')}\n description={tr('dashboard.quickActions.description', 'Jump straight into your workflow')}\n >\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n {quickActions.map((qa) => (\n <button\n key={qa.path}\n type=\"button\"\n onClick={() => navigateTo(qa.path)}\n 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\"\n >\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n {qa.icon}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block text-sm font-medium text-text-primary\">\n {tr(qa.labelKey, qa.fallbackLabel)}\n </span>\n <span className=\"block text-xs text-text-secondary\">\n {tr(qa.descriptionKey, qa.fallbackDescription)}\n </span>\n </span>\n <ArrowRight className=\"h-4 w-4 shrink-0 text-text-secondary transition-transform group-hover:translate-x-0.5\" />\n </button>\n ))}\n </div>\n </Section>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsDA,SAAgB,IAAgB;CAC9B,IAAM,EAAE,eAAY,mBAAgB,EAAiB,GAC/C,IAAK,EAAM,GAEX,IAAiB,EAAiB,EAAE,YAAY;EAAE,OAAO;EAAK,QAAQ;CAAE,EAAE,CAAC,GAC3E,IAAY,EAAY,EAAE,YAAY;EAAE,OAAO;EAAI,QAAQ;CAAE,EAAE,CAAC,GAChE,IAAS,EAAiB,EAAE,YAAY;EAAE,OAAO;EAAI,QAAQ;CAAE,EAAE,CAAC,GAClE,IAAY,EAAiB,EAAE,cAAc,GAAK,CAAC,GAInD,IAAU,GAAmB,GAC7B,IAAa,EAAa,EAAE,QAAQ,WAAW,GAAG,EAAE,SAAS,EAAQ,CAAC,GAEtE,IAAgB,QAAc,EAAe,MAAM,SAAS,CAAC,GAAG,CAAC,EAAe,IAAI,CAAC,GACrF,IAAW,QAAc,EAAU,MAAM,SAAS,CAAC,GAAG,CAAC,EAAU,IAAI,CAAC,GACtE,IAAW,QAAc,EAAO,MAAM,SAAS,CAAC,GAAG,CAAC,EAAO,IAAI,CAAC,GAChE,IAAW,QAAc,EAAU,QAAQ,CAAC,GAAG,CAAC,EAAU,IAAI,CAAC,GAG/D,IAAmB,QAAc;EACrC,IAAM,oBAAM,IAAI,IAA6B;EAE7C,OADA,EAAc,SAAS,MAAM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,kBAAC,GAAD,EAAe,WAAU,4CAA6C,CAAA,GACtE,kBAAC,QAAD;MAAM,WAAU;gBACb,EACC,gCACA,mDACA;OACE,OAAO,EAAM;OACb,QAAQ,EAAe,EAAM,kBAAkB,EAAM,eAAe;MACtE,CACF;KACI,CAAA,CACH;QACL,kBAAC,GAAD,EAAY,WAAU,4CAA6C,CAAA,CAC7D;;GAIV,kBAAC,GAAD;IACE,OAAO,EAAG,gCAAgC,eAAe;IACzD,aAAa,EAAG,sCAAsC,kCAAkC;cAExF,kBAAC,OAAD;KAAK,WAAU;eACZ,GAAa,KAAK,MACjB,kBAAC,UAAD;MAEE,MAAK;MACL,eAAe,EAAW,EAAG,IAAI;MACjC,WAAU;gBAJZ;OAME,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAG;OACA,CAAA;OACN,kBAAC,QAAD;QAAM,WAAU;kBAAhB,CACE,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAG,EAAG,UAAU,EAAG,aAAa;QAC7B,CAAA,GACN,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAG,EAAG,gBAAgB,EAAG,mBAAmB;QACzC,CAAA,CACF;;OACN,kBAAC,GAAD,EAAY,WAAU,wFAAyF,CAAA;MACzG;QAjBD,EAAG,IAiBF,CACT;IACE,CAAA;GACE,CAAA;EACC;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"DashboardPage.js","names":[],"sources":["../../../src/subscriberbot/pages/DashboardPage.tsx"],"sourcesContent":["import { useFormatters } from '../hooks/useFormatters';\n/**\n * Dashboard / Overview\n * @module subscriberbot/pages\n *\n * The Subscriber Bot landing page: a premium fintech console over every\n * recurring digital relationship — total recurring spend, portfolio-by-status,\n * upcoming renewals, the action-required inbox, and outstanding invoices. Every\n * number and chart is COMPUTED from real data returned by\n * `wspace-subscriberbot-svc` — nothing is mocked.\n */\n\nimport { useMemo } from 'react';\nimport {\n Repeat2,\n Wallet,\n CalendarClock,\n Inbox,\n AlertTriangle,\n ArrowRight,\n ArrowUpRight,\n Sparkles,\n Bot,\n ShieldCheck,\n} from 'lucide-react';\nimport { PagePurpose, GlassCard } from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n MetricsCard,\n StatusBadge,\n EmptyState,\n LoadingView,\n ErrorView,\n Section,\n Donut,\n Legend,\n Timeline,\n type Segment,\n type TimelineItem,\n} from '../components';\nimport { useSubscriberBot } from '../context/SubscriberBotContext';\nimport {\n useRelationships,\n useInvoices,\n useInboxMessages,\n useRenewalEvents,\n useDecisions,\n} from '../hooks/useSubscriberBotApi';\nimport { useTr } from '../hooks/useTr';\n\nimport { buildUpcomingRenewals, recurringSpend } from '../utils/portfolio';\nimport { useCompactViewport } from '../hooks/useCompactViewport';\nimport { MobileDashboard } from '../components/mobile';\nimport type { SubRelationship } from '../types';\n\nexport function DashboardPage() {\n const { formatCurrency, formatEnumLabel, formatRelativeTime } = useFormatters();\n\n const { navigateTo, currentUser } = useSubscriberBot();\n const tr = useTr();\n\n const relationshipsQ = useRelationships({ pagination: { limit: 100, offset: 0 } });\n const invoicesQ = useInvoices({ pagination: { limit: 50, offset: 0 } });\n const inboxQ = useInboxMessages({ pagination: { limit: 50, offset: 0 } });\n const renewalsQ = useRenewalEvents({ upcomingOnly: true });\n // Phone layout (BOFF-4010) also surfaces open AI recommendations; the\n // desktop console keeps them on the dedicated decisions page, so only\n // fetch them when the mobile overview will render them.\n const compact = useCompactViewport();\n const decisionsQ = useDecisions({ status: 'PROPOSED' }, { enabled: compact });\n\n const relationships = useMemo(() => relationshipsQ.data?.items ?? [], [relationshipsQ.data]);\n const invoices = useMemo(() => invoicesQ.data?.items ?? [], [invoicesQ.data]);\n const messages = useMemo(() => inboxQ.data?.items ?? [], [inboxQ.data]);\n const renewals = useMemo(() => renewalsQ.data ?? [], [renewalsQ.data]);\n\n // Fast label lookup so mobile AI-recommendation rows can name their relationship.\n const relationshipById = useMemo(() => {\n const map = new Map<string, SubRelationship>();\n relationships.forEach((r) => map.set(r.id, r));\n return map;\n }, [relationships]);\n\n const stats = useMemo(() => {\n const spend = recurringSpend(relationships);\n // BOFF-8660 — KPI must match the Universal Inbox \"need action\" counter\n // and the on-page Needs-attention list, both of which count by\n // `actionRequired` alone (read state is irrelevant). The previous\n // `&& !m.isRead` clause made the tile show 0 the moment the user read\n // the only action-required message, contradicting the surfaces below.\n const actionRequired = messages.filter((m) => m.actionRequired).length;\n const openInvoices = invoices.filter(\n (i) => i.status === 'ISSUED' || i.status === 'OVERDUE' || i.status === 'FAILED'\n );\n const openInvoiceTotal = openInvoices.reduce((sum, i) => sum + i.total, 0);\n const atRisk = relationships.filter(\n (r) => r.status === 'PAST_DUE' || r.status === 'LAPSED'\n ).length;\n\n return {\n activeCount: spend.activeCount,\n totalCount: relationships.length,\n monthlySpend: spend.monthly,\n primaryCurrency: spend.currency,\n actionRequired,\n openInvoiceCount: openInvoices.length,\n openInvoiceTotal,\n atRisk,\n };\n }, [relationships, messages, invoices]);\n\n // Portfolio-by-status → donut segments (grouped from real relationships).\n const statusSegments = useMemo<Segment[]>(() => {\n const counts = new Map<string, number>();\n relationships.forEach((r) => counts.set(r.status, (counts.get(r.status) ?? 0) + 1));\n return Array.from(counts.entries())\n .sort((a, b) => b[1] - a[1])\n .map(([status, value]) => ({ label: formatEnumLabel(status), value }));\n }, [relationships, formatEnumLabel]);\n\n // Upcoming renewals, soonest first: real renewal events when present,\n // otherwise each relationship's own future `renewsAt` (shared with mobile).\n const upcoming = useMemo(\n () => buildUpcomingRenewals(relationships, renewals, (eventType) => formatEnumLabel(eventType)),\n [relationships, renewals, formatEnumLabel]\n );\n\n const timelineItems = useMemo<TimelineItem[]>(\n () =>\n upcoming.slice(0, 6).map((u) => ({\n title: u.title,\n sub: formatRelativeTime(u.when),\n tone: u.soon ? 'warning' : 'default',\n meta:\n u.amount != null\n ? formatCurrency(u.amount, u.currency ?? stats.primaryCurrency, {\n maximumFractionDigits: 0,\n })\n : undefined,\n })),\n [upcoming, stats.primaryCurrency, formatCurrency, formatRelativeTime]\n );\n\n const actionMessages = useMemo(() => messages.filter((m) => m.actionRequired), [messages]);\n\n const isLoading =\n relationshipsQ.isLoading || invoicesQ.isLoading || inboxQ.isLoading || renewalsQ.isLoading;\n const isError =\n relationshipsQ.isError && invoicesQ.isError && inboxQ.isError && renewalsQ.isError;\n\n if (isLoading) {\n return (\n <PageLayout\n dataTour=\"subscriberbot-home\"\n title={tr('dashboard.title', 'Overview')}\n description={tr(\n 'dashboard.description',\n 'Your recurring digital relationships at a glance'\n )}\n >\n <LoadingView label={tr('dashboard.loading', 'Loading your subscription portfolio…')} />\n </PageLayout>\n );\n }\n\n if (isError) {\n return (\n <PageLayout\n dataTour=\"subscriberbot-home\"\n title={tr('dashboard.title', 'Overview')}\n description={tr(\n 'dashboard.description',\n 'Your recurring digital relationships at a glance'\n )}\n >\n <ErrorView\n message={tr(\n 'dashboard.error',\n \"We couldn't reach the Subscriber Bot service. Please try again.\"\n )}\n onRetry={() => {\n void relationshipsQ.refetch();\n void invoicesQ.refetch();\n void inboxQ.refetch();\n void renewalsQ.refetch();\n }}\n />\n </PageLayout>\n );\n }\n\n const greetingName = currentUser?.firstName || currentUser?.name?.split(' ')[0];\n\n if (compact) {\n return (\n <MobileDashboard\n greetingName={greetingName || undefined}\n spend={{\n monthly: stats.monthlySpend,\n currency: stats.primaryCurrency,\n activeCount: stats.activeCount,\n }}\n upcoming={upcoming}\n actionMessages={actionMessages}\n decisions={decisionsQ.data?.items ?? []}\n relationshipLabel={(id) => relationshipById.get(id)?.label}\n openInvoiceCount={stats.openInvoiceCount}\n openInvoiceTotal={stats.openInvoiceTotal}\n navigateTo={navigateTo}\n />\n );\n }\n\n const quickActions = [\n {\n labelKey: 'dashboard.quickActions.addRelationship.label',\n descriptionKey: 'dashboard.quickActions.addRelationship.description',\n fallbackLabel: 'Add a relationship',\n fallbackDescription: 'Track a new subscription',\n icon: <Repeat2 className=\"h-5 w-5\" />,\n path: '/relationships/new',\n },\n {\n labelKey: 'dashboard.quickActions.discoverProviders.label',\n descriptionKey: 'dashboard.quickActions.discoverProviders.description',\n fallbackLabel: 'Discover providers',\n fallbackDescription: 'Browse the registry',\n icon: <Sparkles className=\"h-5 w-5\" />,\n path: '/providers',\n },\n {\n labelKey: 'dashboard.quickActions.openInbox.label',\n descriptionKey: 'dashboard.quickActions.openInbox.description',\n fallbackLabel: 'Open inbox',\n fallbackDescription: 'Merged communications',\n icon: <Inbox className=\"h-5 w-5\" />,\n path: '/inbox',\n },\n {\n labelKey: 'dashboard.quickActions.configureAgents.label',\n descriptionKey: 'dashboard.quickActions.configureAgents.description',\n fallbackLabel: 'Configure agents',\n fallbackDescription: 'Automate your portfolio',\n icon: <Bot className=\"h-5 w-5\" />,\n path: '/agents',\n },\n ];\n\n return (\n <PageLayout\n dataTour=\"subscriberbot-home\"\n title={\n greetingName\n ? tr('dashboard.welcomeBack', 'Welcome back, {{name}}', { name: greetingName })\n : tr('dashboard.title', 'Overview')\n }\n description={tr(\n 'dashboard.description',\n 'Everything you pay for on repeat — in one intelligent console.'\n )}\n >\n <PagePurpose className=\"mb-6\">\n {tr(\n 'dashboard.purpose',\n '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.'\n )}\n </PagePurpose>\n\n {/* KPI tiles */}\n <div\n className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\"\n data-tour=\"subscriberbot-home-metrics\"\n >\n <MetricsCard\n featured\n icon={<Wallet />}\n value={formatCurrency(stats.monthlySpend, stats.primaryCurrency, {\n maximumFractionDigits: 0,\n })}\n label={tr('dashboard.metrics.recurringSpend', 'Recurring spend / month')}\n />\n <MetricsCard\n icon={<Repeat2 />}\n value={stats.activeCount}\n label={tr('dashboard.metrics.activeRelationships', 'Active relationships')}\n />\n <MetricsCard\n icon={<CalendarClock />}\n value={upcoming.length}\n label={tr('dashboard.metrics.upcomingRenewals', 'Upcoming renewals')}\n />\n <MetricsCard\n icon={<AlertTriangle />}\n value={stats.actionRequired}\n label={tr('dashboard.metrics.needsAction', 'Need your action')}\n trend={stats.actionRequired > 0 ? 'down' : undefined}\n />\n </div>\n\n {/* Main console: renewals (left) + portfolio donut & needs-attention (right) */}\n <div className=\"mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Upcoming renewals timeline — spans two columns on desktop */}\n <div className=\"lg:col-span-2\">\n <Section\n title={tr('dashboard.renewals.title', 'Upcoming renewals')}\n description={tr(\n 'dashboard.renewals.description',\n \"What's charging next across your portfolio\"\n )}\n className=\"mt-0\"\n dataTour=\"subscriberbot-home-renewals\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"inline-flex items-center gap-1 text-sm font-medium text-text-link hover:underline\"\n >\n {tr('common.viewAll', 'View all')} <ArrowUpRight className=\"h-3.5 w-3.5\" />\n </button>\n }\n >\n <GlassCard treatment=\"plain\" className=\"p-5\">\n {timelineItems.length === 0 ? (\n <EmptyState\n illustration=\"empty-calendar\"\n title={tr('dashboard.renewals.emptyTitle', 'No upcoming renewals')}\n description={tr(\n 'dashboard.renewals.emptyDescription',\n 'Renewals you track will appear here ahead of time.'\n )}\n />\n ) : (\n <Timeline items={timelineItems} />\n )}\n </GlassCard>\n </Section>\n </div>\n\n {/* Right rail: portfolio-by-status donut + needs-attention panel */}\n <div className=\"flex flex-col gap-6\">\n <Section\n title={tr('dashboard.portfolio.title', 'Portfolio by status')}\n description={tr('dashboard.portfolio.description', 'Where your relationships stand')}\n className=\"mt-0\"\n dataTour=\"subscriberbot-home-portfolio\"\n >\n <GlassCard treatment=\"glass\" className=\"p-5\">\n {statusSegments.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('dashboard.portfolio.emptyTitle', 'No relationships yet')}\n description={tr(\n 'dashboard.portfolio.emptyDescription',\n 'Add your first subscription to see the breakdown.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships/new')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n {tr('dashboard.portfolio.addRelationship', 'Add relationship')}\n </button>\n }\n />\n ) : (\n <div className=\"flex flex-col items-center gap-5 sm:flex-row sm:items-center lg:flex-col xl:flex-row\">\n <Donut\n data={statusSegments}\n size={148}\n thickness={20}\n centerLabel={String(stats.totalCount)}\n centerSub={tr(\n stats.totalCount === 1\n ? 'dashboard.portfolio.relationshipSingular'\n : 'dashboard.portfolio.relationshipPlural',\n stats.totalCount === 1 ? 'relationship' : 'relationships'\n )}\n className=\"shrink-0\"\n />\n <Legend data={statusSegments} className=\"w-full min-w-0 flex-1\" />\n </div>\n )}\n </GlassCard>\n </Section>\n\n <Section\n title={tr('dashboard.needsAttention.title', 'Needs attention')}\n description={tr(\n 'dashboard.needsAttention.description',\n 'Required actions from the Universal Inbox'\n )}\n className=\"mt-0\"\n dataTour=\"subscriberbot-home-needs-attention\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/inbox')}\n className=\"text-sm font-medium text-text-link hover:underline\"\n >\n {tr('dashboard.needsAttention.openInbox', 'Open inbox')}\n </button>\n }\n >\n <GlassCard treatment=\"plain\" className=\"p-3\">\n {actionMessages.length === 0 ? (\n <div className=\"flex items-center gap-3 px-2 py-4\">\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-lg bg-status-success-bg-subtle text-status-success-text\">\n <ShieldCheck className=\"h-5 w-5\" />\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-text-primary\">\n {tr('dashboard.needsAttention.allCaughtUp', \"You're all caught up\")}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'dashboard.needsAttention.allCaughtUpDescription',\n 'Required actions across your channels will surface here.'\n )}\n </p>\n </div>\n </div>\n ) : (\n <ul className=\"space-y-1\">\n {actionMessages.slice(0, 5).map((message) => (\n <li key={message.id}>\n <button\n type=\"button\"\n onClick={() => navigateTo('/inbox')}\n 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-start transition-colors hover:bg-status-warning-bg-subtle\"\n >\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {message.subject ||\n tr('dashboard.needsAttention.noSubject', '(no subject)')}\n </p>\n {message.preview && (\n <p className=\"truncate text-xs text-text-secondary\">\n {message.preview}\n </p>\n )}\n </div>\n <StatusBadge status={message.category} className=\"shrink-0\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </GlassCard>\n </Section>\n </div>\n </div>\n\n {/* Open-invoice call-out (only when there is real outstanding balance) */}\n {stats.openInvoiceCount > 0 && (\n <button\n type=\"button\"\n onClick={() => navigateTo('/invoices')}\n 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-start transition-shadow hover:shadow-md\"\n >\n <div className=\"flex items-center gap-3\">\n <AlertTriangle className=\"h-5 w-5 shrink-0 text-status-warning-text\" />\n <span className=\"text-sm font-medium text-status-warning-text\">\n {tr(\n 'dashboard.openInvoices.label',\n '{{count}} open invoice · {{amount}} outstanding',\n {\n count: stats.openInvoiceCount,\n amount: formatCurrency(stats.openInvoiceTotal, stats.primaryCurrency),\n }\n )}\n </span>\n </div>\n <ArrowRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text\" />\n </button>\n )}\n\n {/* Quick actions */}\n <Section\n title={tr('dashboard.quickActions.title', 'Quick actions')}\n description={tr('dashboard.quickActions.description', 'Jump straight into your workflow')}\n dataTour=\"subscriberbot-home-quick-actions\"\n >\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n {quickActions.map((qa) => (\n <button\n key={qa.path}\n type=\"button\"\n onClick={() => navigateTo(qa.path)}\n className=\"group flex items-center gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 text-start transition-all hover:-translate-y-0.5 hover:border-border-seam hover:shadow-md\"\n >\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n {qa.icon}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block text-sm font-medium text-text-primary\">\n {tr(qa.labelKey, qa.fallbackLabel)}\n </span>\n <span className=\"block text-xs text-text-secondary\">\n {tr(qa.descriptionKey, qa.fallbackDescription)}\n </span>\n </span>\n <ArrowRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-text-secondary transition-transform group-hover:translate-x-0.5\" />\n </button>\n ))}\n </div>\n </Section>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,IAAgB;CAC9B,IAAM,EAAE,mBAAgB,oBAAiB,0BAAuB,EAAc,GAExE,EAAE,eAAY,mBAAgB,EAAiB,GAC/C,IAAK,EAAM,GAEX,IAAiB,EAAiB,EAAE,YAAY;EAAE,OAAO;EAAK,QAAQ;CAAE,EAAE,CAAC,GAC3E,IAAY,EAAY,EAAE,YAAY;EAAE,OAAO;EAAI,QAAQ;CAAE,EAAE,CAAC,GAChE,IAAS,EAAiB,EAAE,YAAY;EAAE,OAAO;EAAI,QAAQ;CAAE,EAAE,CAAC,GAClE,IAAY,EAAiB,EAAE,cAAc,GAAK,CAAC,GAInD,IAAU,EAAmB,GAC7B,IAAa,EAAa,EAAE,QAAQ,WAAW,GAAG,EAAE,SAAS,EAAQ,CAAC,GAEtE,IAAgB,QAAc,EAAe,MAAM,SAAS,CAAC,GAAG,CAAC,EAAe,IAAI,CAAC,GACrF,IAAW,QAAc,EAAU,MAAM,SAAS,CAAC,GAAG,CAAC,EAAU,IAAI,CAAC,GACtE,IAAW,QAAc,EAAO,MAAM,SAAS,CAAC,GAAG,CAAC,EAAO,IAAI,CAAC,GAChE,IAAW,QAAc,EAAU,QAAQ,CAAC,GAAG,CAAC,EAAU,IAAI,CAAC,GAG/D,IAAmB,QAAc;EACrC,IAAM,oBAAM,IAAI,IAA6B;EAE7C,OADA,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BAAmB,KACxB,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,EAAW,WAAW;IACrC,WAAU;cAHZ,CAKE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD,EAAe,WAAU,4CAA6C,CAAA,GACtE,kBAAC,QAAD;MAAM,WAAU;gBACb,EACC,gCACA,mDACA;OACE,OAAO,EAAM;OACb,QAAQ,EAAe,EAAM,kBAAkB,EAAM,eAAe;MACtE,CACF;KACI,CAAA,CACH;QACL,kBAAC,GAAD,EAAY,WAAU,2DAA4D,CAAA,CAC5E;;GAIV,kBAAC,GAAD;IACE,OAAO,EAAG,gCAAgC,eAAe;IACzD,aAAa,EAAG,sCAAsC,kCAAkC;IACxF,UAAS;cAET,kBAAC,OAAD;KAAK,WAAU;eACZ,GAAa,KAAK,MACjB,kBAAC,UAAD;MAEE,MAAK;MACL,eAAe,EAAW,EAAG,IAAI;MACjC,WAAU;gBAJZ;OAME,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAG;OACA,CAAA;OACN,kBAAC,QAAD;QAAM,WAAU;kBAAhB,CACE,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAG,EAAG,UAAU,EAAG,aAAa;QAC7B,CAAA,GACN,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAG,EAAG,gBAAgB,EAAG,mBAAmB;QACzC,CAAA,CACF;;OACN,kBAAC,GAAD,EAAY,WAAU,uGAAwG,CAAA;MACxH;QAjBD,EAAG,IAiBF,CACT;IACE,CAAA;GACE,CAAA;EACC;;AAEhB"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Universal Inbox
|
|
3
|
-
* @module subscriberbot/pages
|
|
4
|
-
*
|
|
5
|
-
* Every merged subscription communication in one timeline, AI-categorized,
|
|
6
|
-
* plus management of the ingest channels that feed it. Filter by category /
|
|
7
|
-
* unread, mark messages read or unread, add & verify channels, and log a test message.
|
|
8
|
-
* Reads `subListInboxMessages` / `subListChannels`; writes `subMarkMessageRead`, `subMarkMessageUnread`,
|
|
9
|
-
* `subCreateChannel`, `subVerifyChannel`, `subIngestMessage`.
|
|
10
|
-
*/
|
|
11
1
|
export declare function InboxPage(): import("react").JSX.Element;
|
|
12
2
|
//# sourceMappingURL=InboxPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InboxPage.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot/pages/InboxPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InboxPage.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot/pages/InboxPage.tsx"],"names":[],"mappings":"AAm6BA,wBAAgB,SAAS,gCAgQxB"}
|