@burdenoff/microfe-subscriberbot 2026.1103.1 → 2026.1105.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/AgentDetailPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/AgentsListPage.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/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/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.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +45 -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 +127 -127
- 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.js +1 -1
- 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 +107 -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 +267 -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 +104 -90
- 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,317 +1,319 @@
|
|
|
1
1
|
import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useApplyDecision as
|
|
8
|
-
import { DECISION_KIND_LABEL as
|
|
9
|
-
import { useState as
|
|
10
|
-
import { CheckCircle2 as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { GlassCard as
|
|
2
|
+
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
+
import { useFormatters as n } from "../../hooks/useFormatters.js";
|
|
4
|
+
import { cn as r } from "../../utils/cn.js";
|
|
5
|
+
import { StatusBadge as i } from "../StatusBadge.js";
|
|
6
|
+
import { Modal as a } from "../Modal.js";
|
|
7
|
+
import { useApplyDecision as o, useDismissDecision as s } from "../../hooks/useSubscriberBotApi.js";
|
|
8
|
+
import { DECISION_KIND_LABEL as c, RECOMMENDATION_LABEL as l, confidencePercent as u, evidenceSources as d, isActionable as f, isDestructive as p, relationshipSnapshot as m } from "./decisionModel.js";
|
|
9
|
+
import { useState as h } from "react";
|
|
10
|
+
import { CheckCircle2 as g, ExternalLink as _, Gauge as v, PiggyBank as y, ShieldAlert as b, XCircle as x } from "lucide-react";
|
|
11
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
12
|
+
import { GlassCard as w } from "@burdenoff/fe-libs/ui";
|
|
13
13
|
//#region src/subscriberbot/components/decisions/DecisionCard.tsx
|
|
14
|
-
function
|
|
14
|
+
function T(e, t) {
|
|
15
15
|
return e instanceof Error && e.message ? e.message : t;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
let t =
|
|
17
|
+
function E(e) {
|
|
18
|
+
let { formatCurrency: t, formatEnumLabel: r } = n(), i = m(e), a = i.amount === null ? null : `${t(i.amount, i.currency ?? e.currency)}${i.interval ? ` / ${r(i.interval).toLowerCase()}` : ""}`;
|
|
19
19
|
return {
|
|
20
|
-
label:
|
|
21
|
-
amount:
|
|
20
|
+
label: i.label ?? e.relationshipId,
|
|
21
|
+
amount: a
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
var
|
|
25
|
-
let
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
title:
|
|
28
|
-
description:
|
|
24
|
+
var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
25
|
+
let s = t(), c = o(), [u, d] = h(!1), [f, m] = h(null), g = p(e.recommendation), _ = E(e), v = l[e.recommendation], y = !c.isPending && (!g || u);
|
|
26
|
+
return /* @__PURE__ */ S(a, {
|
|
27
|
+
title: s("decisions.apply.title", "Apply: {{action}}", { action: s(v.key, v.fallback) }),
|
|
28
|
+
description: s("decisions.apply.description", "This runs the same change you could make by hand on the relationship page."),
|
|
29
29
|
onClose: n,
|
|
30
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ C("div", {
|
|
31
31
|
className: "space-y-4",
|
|
32
32
|
"data-testid": "apply-decision-dialog",
|
|
33
33
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ C("div", {
|
|
35
35
|
className: "rounded-lg border border-border-subtle bg-bg-sunken px-4 py-3",
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ S("p", {
|
|
38
38
|
className: "text-xs text-text-secondary",
|
|
39
|
-
children:
|
|
39
|
+
children: s("decisions.apply.relationship", "Subscription")
|
|
40
40
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ S("p", {
|
|
42
42
|
className: "text-sm font-semibold text-text-primary",
|
|
43
43
|
"data-testid": "confirm-label",
|
|
44
|
-
children:
|
|
44
|
+
children: _.label
|
|
45
45
|
}),
|
|
46
|
-
|
|
46
|
+
_.amount && /* @__PURE__ */ S("p", {
|
|
47
47
|
className: "text-sm tabular-nums text-text-primary",
|
|
48
48
|
"data-testid": "confirm-amount",
|
|
49
|
-
children:
|
|
49
|
+
children: _.amount
|
|
50
50
|
})
|
|
51
51
|
]
|
|
52
52
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ S("p", {
|
|
54
54
|
className: "text-sm text-text-secondary",
|
|
55
55
|
children: e.rationale
|
|
56
56
|
}),
|
|
57
|
-
|
|
57
|
+
g && /* @__PURE__ */ C("label", {
|
|
58
58
|
className: "flex items-start gap-2.5 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ S("input", {
|
|
60
60
|
type: "checkbox",
|
|
61
|
-
checked:
|
|
62
|
-
onChange: (e) =>
|
|
61
|
+
checked: u,
|
|
62
|
+
onChange: (e) => d(e.target.checked),
|
|
63
63
|
className: "mt-0.5 size-4 shrink-0 rounded border-border-subtle",
|
|
64
64
|
"data-testid": "confirm-destructive"
|
|
65
|
-
}), /* @__PURE__ */
|
|
66
|
-
label:
|
|
67
|
-
amount:
|
|
65
|
+
}), /* @__PURE__ */ S("span", { children: s("decisions.apply.acknowledgeCancel", "I want to cancel \"{{label}}\"{{amount}}. I understand the subscription will stop.", {
|
|
66
|
+
label: _.label,
|
|
67
|
+
amount: _.amount ? ` (${_.amount})` : ""
|
|
68
68
|
}) })]
|
|
69
69
|
}),
|
|
70
|
-
f && /* @__PURE__ */
|
|
70
|
+
f && /* @__PURE__ */ S("div", {
|
|
71
|
+
role: "alert",
|
|
71
72
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
72
73
|
children: f
|
|
73
74
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ C("div", {
|
|
75
76
|
className: "flex justify-end gap-3",
|
|
76
|
-
children: [/* @__PURE__ */
|
|
77
|
+
children: [/* @__PURE__ */ S("button", {
|
|
77
78
|
type: "button",
|
|
78
79
|
onClick: n,
|
|
79
80
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
80
|
-
children:
|
|
81
|
-
}), /* @__PURE__ */
|
|
81
|
+
children: s("decisions.apply.back", "Not now")
|
|
82
|
+
}), /* @__PURE__ */ S("button", {
|
|
82
83
|
type: "button",
|
|
83
84
|
onClick: () => {
|
|
84
|
-
y && (
|
|
85
|
+
y && (m(null), c.mutate(e.id, {
|
|
85
86
|
onSuccess: (e) => {
|
|
86
|
-
|
|
87
|
+
i?.(e.decision), n();
|
|
87
88
|
},
|
|
88
|
-
onError: (e) =>
|
|
89
|
+
onError: (e) => m(T(e, s("decisions.apply.error", "Could not apply this decision.")))
|
|
89
90
|
}));
|
|
90
91
|
},
|
|
91
92
|
disabled: !y,
|
|
92
93
|
"data-testid": "confirm-apply",
|
|
93
|
-
className:
|
|
94
|
-
children:
|
|
94
|
+
className: r("rounded-lg px-4 py-2 text-sm font-medium hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50", g ? "bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bg-hover" : "bg-action-primary-bg text-action-primary-text"),
|
|
95
|
+
children: c.isPending ? s("decisions.apply.applying", "Applying…") : s("decisions.apply.submit", "Apply")
|
|
95
96
|
})]
|
|
96
97
|
})
|
|
97
98
|
]
|
|
98
99
|
})
|
|
99
100
|
});
|
|
100
|
-
},
|
|
101
|
-
let
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
title:
|
|
101
|
+
}, O = ({ decision: e, onClose: n }) => {
|
|
102
|
+
let r = t(), i = s(), [o, c] = h(""), [l, u] = h(null), d = E(e);
|
|
103
|
+
return /* @__PURE__ */ S(a, {
|
|
104
|
+
title: r("decisions.dismiss.title", "Dismiss recommendation"),
|
|
104
105
|
description: d.label,
|
|
105
|
-
onClose:
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
onSubmit: (
|
|
108
|
-
|
|
106
|
+
onClose: n,
|
|
107
|
+
children: /* @__PURE__ */ C("form", {
|
|
108
|
+
onSubmit: (t) => {
|
|
109
|
+
t.preventDefault(), u(null), i.mutate({
|
|
109
110
|
id: e.id,
|
|
110
|
-
reason:
|
|
111
|
+
reason: o
|
|
111
112
|
}, {
|
|
112
|
-
onSuccess: () =>
|
|
113
|
-
onError: (e) => u(
|
|
113
|
+
onSuccess: () => n(),
|
|
114
|
+
onError: (e) => u(T(e, r("decisions.dismiss.error", "Could not dismiss this decision.")))
|
|
114
115
|
});
|
|
115
116
|
},
|
|
116
117
|
className: "space-y-4",
|
|
117
118
|
"data-testid": "dismiss-decision-dialog",
|
|
118
119
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
120
121
|
htmlFor: `dismiss-reason-${e.id}`,
|
|
121
122
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
122
|
-
children:
|
|
123
|
-
}), /* @__PURE__ */
|
|
123
|
+
children: r("decisions.dismiss.reason", "Reason (optional)")
|
|
124
|
+
}), /* @__PURE__ */ S("textarea", {
|
|
124
125
|
id: `dismiss-reason-${e.id}`,
|
|
125
|
-
value:
|
|
126
|
-
onChange: (e) =>
|
|
126
|
+
value: o,
|
|
127
|
+
onChange: (e) => c(e.target.value),
|
|
127
128
|
rows: 3,
|
|
128
129
|
maxLength: 500,
|
|
129
|
-
placeholder:
|
|
130
|
+
placeholder: r("decisions.dismiss.placeholder", "e.g. We still use this every week"),
|
|
130
131
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
131
132
|
})] }),
|
|
132
|
-
|
|
133
|
+
l && /* @__PURE__ */ S("div", {
|
|
134
|
+
role: "alert",
|
|
133
135
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
134
|
-
children:
|
|
136
|
+
children: l
|
|
135
137
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ C("div", {
|
|
137
139
|
className: "flex justify-end gap-3",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ S("button", {
|
|
139
141
|
type: "button",
|
|
140
|
-
onClick:
|
|
142
|
+
onClick: n,
|
|
141
143
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
142
|
-
children:
|
|
143
|
-
}), /* @__PURE__ */
|
|
144
|
+
children: r("decisions.dismiss.back", "Back")
|
|
145
|
+
}), /* @__PURE__ */ S("button", {
|
|
144
146
|
type: "submit",
|
|
145
|
-
disabled:
|
|
147
|
+
disabled: i.isPending,
|
|
146
148
|
"data-testid": "confirm-dismiss",
|
|
147
149
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
148
|
-
children:
|
|
150
|
+
children: i.isPending ? r("decisions.dismiss.dismissing", "Dismissing…") : r("decisions.dismiss.submit", "Dismiss")
|
|
149
151
|
})]
|
|
150
152
|
})
|
|
151
153
|
]
|
|
152
154
|
})
|
|
153
155
|
});
|
|
154
|
-
},
|
|
155
|
-
let
|
|
156
|
-
relationship:
|
|
157
|
-
keptRelationship:
|
|
158
|
-
plan:
|
|
159
|
-
alternativePlan:
|
|
160
|
-
renewalEvent:
|
|
161
|
-
entitlement:
|
|
156
|
+
}, k = ({ decision: n, limit: r }) => {
|
|
157
|
+
let i = t(), { navigateTo: a } = e(), o = d(n), s = r ? o.slice(0, r) : o, c = {
|
|
158
|
+
relationship: i("decisions.sources.relationship", "Subscription"),
|
|
159
|
+
keptRelationship: i("decisions.sources.keptRelationship", "Keep instead"),
|
|
160
|
+
plan: i("decisions.sources.plan", "Current plan"),
|
|
161
|
+
alternativePlan: i("decisions.sources.alternativePlan", "Suggested plan"),
|
|
162
|
+
renewalEvent: i("decisions.sources.renewalEvent", "Renewal event"),
|
|
163
|
+
entitlement: i("decisions.sources.entitlement", "Entitlement usage")
|
|
162
164
|
};
|
|
163
|
-
return /* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
|
|
164
166
|
className: "text-[10px] font-medium uppercase tracking-wide text-text-secondary",
|
|
165
|
-
children:
|
|
166
|
-
}), /* @__PURE__ */
|
|
167
|
+
children: i("decisions.sources.title", "Based on")
|
|
168
|
+
}), /* @__PURE__ */ C("ul", {
|
|
167
169
|
className: "mt-1.5 flex flex-wrap gap-1.5",
|
|
168
170
|
"data-testid": "decision-sources",
|
|
169
|
-
children: [
|
|
171
|
+
children: [s.map((e) => /* @__PURE__ */ S("li", { children: /* @__PURE__ */ C("button", {
|
|
170
172
|
type: "button",
|
|
171
|
-
onClick: () =>
|
|
173
|
+
onClick: () => a(e.path),
|
|
172
174
|
"data-source-kind": e.kind,
|
|
173
|
-
className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-subtle bg-bg-sunken px-2 py-0.5 text-
|
|
175
|
+
className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-subtle bg-bg-sunken px-2 py-0.5 text-start text-[11px] text-text-secondary hover:text-text-primary",
|
|
174
176
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ S("span", {
|
|
176
178
|
className: "font-medium text-text-primary",
|
|
177
179
|
children: c[e.kind]
|
|
178
180
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ S("span", {
|
|
180
182
|
className: "truncate",
|
|
181
183
|
children: e.title
|
|
182
184
|
}),
|
|
183
|
-
e.detail && /* @__PURE__ */
|
|
185
|
+
e.detail && /* @__PURE__ */ S("span", {
|
|
184
186
|
className: "tabular-nums",
|
|
185
187
|
children: e.detail
|
|
186
188
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ S(_, {
|
|
188
190
|
className: "h-3 w-3 shrink-0",
|
|
189
191
|
"aria-hidden": !0
|
|
190
192
|
})
|
|
191
193
|
]
|
|
192
|
-
}) }, `${e.kind}-${e.id}`)),
|
|
194
|
+
}) }, `${e.kind}-${e.id}`)), r && o.length > r && /* @__PURE__ */ S("li", {
|
|
193
195
|
className: "px-1 py-0.5 text-[11px] text-text-secondary",
|
|
194
|
-
children:
|
|
196
|
+
children: i("decisions.sources.more", "+{{count}} more", { count: o.length - r })
|
|
195
197
|
})]
|
|
196
198
|
})] });
|
|
197
|
-
},
|
|
198
|
-
let
|
|
199
|
-
return /* @__PURE__ */
|
|
199
|
+
}, A = ({ decision: a, hideAgent: o = !1 }) => {
|
|
200
|
+
let { formatCurrency: s, formatRelativeTime: d } = n(), m = t(), { navigateTo: _ } = e(), [T, A] = h(null), j = c[a.kind], M = l[a.recommendation], N = p(a.recommendation), P = f(a), F = E(a);
|
|
201
|
+
return /* @__PURE__ */ C(w, {
|
|
200
202
|
treatment: "metric",
|
|
201
203
|
className: "flex flex-col gap-3 p-4",
|
|
202
204
|
"data-testid": "decision-card",
|
|
203
|
-
"data-decision-id":
|
|
204
|
-
"data-recommendation":
|
|
205
|
-
"data-status":
|
|
205
|
+
"data-decision-id": a.id,
|
|
206
|
+
"data-recommendation": a.recommendation,
|
|
207
|
+
"data-status": a.status,
|
|
206
208
|
children: [
|
|
207
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ C("div", {
|
|
208
210
|
className: "flex flex-wrap items-start justify-between gap-2",
|
|
209
|
-
children: [/* @__PURE__ */
|
|
211
|
+
children: [/* @__PURE__ */ C("div", {
|
|
210
212
|
className: "min-w-0",
|
|
211
213
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ C("p", {
|
|
213
215
|
className: "text-[11px] font-medium uppercase tracking-wide text-text-secondary",
|
|
214
|
-
children: [
|
|
216
|
+
children: [m(j.key, j.fallback), !o && a.agent ? ` · ${a.agent.name}` : ""]
|
|
215
217
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ C("button", {
|
|
217
219
|
type: "button",
|
|
218
|
-
onClick: () =>
|
|
219
|
-
className: "mt-0.5 flex items-center gap-1.5 text-
|
|
220
|
+
onClick: () => _(`/decisions/${a.id}`),
|
|
221
|
+
className: "mt-0.5 flex items-center gap-1.5 text-start text-sm font-semibold text-text-primary hover:underline",
|
|
220
222
|
children: [
|
|
221
|
-
|
|
223
|
+
N && /* @__PURE__ */ S(b, {
|
|
222
224
|
className: "h-4 w-4 shrink-0 text-status-error-text",
|
|
223
225
|
"aria-hidden": !0
|
|
224
226
|
}),
|
|
225
|
-
|
|
227
|
+
m(M.key, M.fallback),
|
|
226
228
|
": ",
|
|
227
|
-
|
|
229
|
+
F.label
|
|
228
230
|
]
|
|
229
231
|
}),
|
|
230
|
-
|
|
232
|
+
F.amount && /* @__PURE__ */ S("p", {
|
|
231
233
|
className: "text-xs tabular-nums text-text-secondary",
|
|
232
|
-
children:
|
|
234
|
+
children: F.amount
|
|
233
235
|
})
|
|
234
236
|
]
|
|
235
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ S(i, { status: a.status })]
|
|
236
238
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ S("p", {
|
|
238
240
|
className: "text-sm text-text-secondary",
|
|
239
|
-
children:
|
|
241
|
+
children: a.rationale
|
|
240
242
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ C("div", {
|
|
242
244
|
className: "flex flex-wrap gap-2 text-xs",
|
|
243
245
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ C("span", {
|
|
245
247
|
className: "inline-flex items-center gap-1.5 rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ S(v, {
|
|
247
249
|
className: "h-3.5 w-3.5",
|
|
248
250
|
"aria-hidden": !0
|
|
249
|
-
}),
|
|
251
|
+
}), m("decisions.card.confidence", "Confidence {{pct}}%", { pct: u(a.confidence) })]
|
|
250
252
|
}),
|
|
251
|
-
|
|
253
|
+
a.estimatedSavings > 0 && /* @__PURE__ */ C("span", {
|
|
252
254
|
className: "inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-2 py-0.5 font-medium text-status-success-text tabular-nums",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ S(y, {
|
|
254
256
|
className: "h-3.5 w-3.5",
|
|
255
257
|
"aria-hidden": !0
|
|
256
|
-
}),
|
|
258
|
+
}), m("decisions.card.savings", "Saves {{amount}} a year", { amount: s(a.estimatedSavings, a.currency) })]
|
|
257
259
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ S("span", {
|
|
259
261
|
className: "inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary",
|
|
260
|
-
children:
|
|
262
|
+
children: d(a.createdAt)
|
|
261
263
|
})
|
|
262
264
|
]
|
|
263
265
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
decision:
|
|
266
|
+
/* @__PURE__ */ S(k, {
|
|
267
|
+
decision: a,
|
|
266
268
|
limit: 4
|
|
267
269
|
}),
|
|
268
|
-
|
|
270
|
+
a.status === "FLAGGED" && a.validationErrors.length > 0 && /* @__PURE__ */ C("p", {
|
|
269
271
|
className: "rounded-md bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text",
|
|
270
272
|
children: [
|
|
271
|
-
|
|
273
|
+
m("decisions.card.flagged", "Held back: failed validation"),
|
|
272
274
|
" —",
|
|
273
275
|
" ",
|
|
274
|
-
|
|
276
|
+
a.validationErrors.join("; ")
|
|
275
277
|
]
|
|
276
278
|
}),
|
|
277
|
-
|
|
279
|
+
a.status === "DISMISSED" && a.dismissedReason && /* @__PURE__ */ S("p", {
|
|
278
280
|
className: "text-xs text-text-secondary",
|
|
279
|
-
children:
|
|
281
|
+
children: m("decisions.card.dismissedReason", "Dismissed: {{reason}}", { reason: a.dismissedReason })
|
|
280
282
|
}),
|
|
281
|
-
|
|
283
|
+
P && /* @__PURE__ */ C("div", {
|
|
282
284
|
className: "flex flex-wrap justify-end gap-2 border-t border-border-subtle pt-3",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ C("button", {
|
|
284
286
|
type: "button",
|
|
285
|
-
onClick: () =>
|
|
287
|
+
onClick: () => A("dismiss"),
|
|
286
288
|
"data-testid": "dismiss-decision",
|
|
287
289
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ S(x, {
|
|
289
291
|
className: "h-3.5 w-3.5",
|
|
290
292
|
"aria-hidden": !0
|
|
291
|
-
}),
|
|
292
|
-
}), /* @__PURE__ */
|
|
293
|
+
}), m("decisions.card.dismiss", "Dismiss")]
|
|
294
|
+
}), /* @__PURE__ */ C("button", {
|
|
293
295
|
type: "button",
|
|
294
|
-
onClick: () =>
|
|
296
|
+
onClick: () => A("apply"),
|
|
295
297
|
"data-testid": "apply-decision",
|
|
296
|
-
className:
|
|
297
|
-
children: [/* @__PURE__ */
|
|
298
|
+
className: r("inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium hover:opacity-90", N ? "border border-status-error-text/40 bg-status-error-bg-subtle text-status-error-text" : "bg-action-primary-bg text-action-primary-text"),
|
|
299
|
+
children: [/* @__PURE__ */ S(g, {
|
|
298
300
|
className: "h-3.5 w-3.5",
|
|
299
301
|
"aria-hidden": !0
|
|
300
|
-
}),
|
|
302
|
+
}), m("decisions.card.apply", "Review and apply")]
|
|
301
303
|
})]
|
|
302
304
|
}),
|
|
303
|
-
|
|
304
|
-
decision:
|
|
305
|
-
onClose: () =>
|
|
305
|
+
T === "apply" && /* @__PURE__ */ S(D, {
|
|
306
|
+
decision: a,
|
|
307
|
+
onClose: () => A(null)
|
|
306
308
|
}),
|
|
307
|
-
|
|
308
|
-
decision:
|
|
309
|
-
onClose: () =>
|
|
309
|
+
T === "dismiss" && /* @__PURE__ */ S(O, {
|
|
310
|
+
decision: a,
|
|
311
|
+
onClose: () => A(null)
|
|
310
312
|
})
|
|
311
313
|
]
|
|
312
314
|
});
|
|
313
315
|
};
|
|
314
316
|
//#endregion
|
|
315
|
-
export {
|
|
317
|
+
export { D as ApplyDecisionDialog, A as DecisionCard, k as DecisionSources, O as DismissDecisionDialog };
|
|
316
318
|
|
|
317
319
|
//# sourceMappingURL=DecisionCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionCard.js","names":[],"sources":["../../../../src/subscriberbot/components/decisions/DecisionCard.tsx"],"sourcesContent":["/**\n * Decision card + apply / dismiss dialogs\n * @module subscriberbot/components/decisions\n *\n * Renders one `SubDecision` from the decision engine: the recommendation, the\n * rationale, confidence, estimated annual saving, the relationship it concerns\n * and the source rows it reasoned over. Apply and dismiss go through\n * `subApplyDecision` / `subDismissDecision`.\n *\n * Apply always opens a confirmation dialog that names the relationship and its\n * amount. For a destructive recommendation (cancel) the Apply button stays\n * disabled until the user ticks an acknowledgement that names the same\n * relationship and amount, so a cancellation can never happen on a misclick.\n */\n\nimport { useState, type FC } from 'react';\nimport { CheckCircle2, ExternalLink, Gauge, PiggyBank, ShieldAlert, XCircle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { Modal } from '../Modal';\nimport { StatusBadge } from '../StatusBadge';\nimport { useTr } from '../../hooks/useTr';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useApplyDecision, useDismissDecision } from '../../hooks/useSubscriberBotApi';\nimport { formatCurrency, formatEnumLabel, formatRelativeTime } from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type { SubDecision } from '../../types';\nimport {\n DECISION_KIND_LABEL,\n RECOMMENDATION_LABEL,\n confidencePercent,\n evidenceSources,\n isActionable,\n isDestructive,\n relationshipSnapshot,\n} from './decisionModel';\n\nfunction errorText(err: unknown, fallback: string): string {\n return err instanceof Error && err.message ? err.message : fallback;\n}\n\n/** \"Netflix Premium · 15.49 USD / monthly\" — the identity a confirmation must name. */\nfunction useRelationshipIdentity(decision: SubDecision): { label: string; amount: string | null } {\n const snap = relationshipSnapshot(decision);\n const amount =\n snap.amount !== null\n ? `${formatCurrency(snap.amount, snap.currency ?? decision.currency)}${snap.interval ? ` / ${formatEnumLabel(snap.interval).toLowerCase()}` : ''}`\n : null;\n return { label: snap.label ?? decision.relationshipId, amount };\n}\n\n// ---------------------------------------------------------------------------\n// Apply confirmation\n// ---------------------------------------------------------------------------\n\nexport const ApplyDecisionDialog: FC<{\n decision: SubDecision;\n onClose: () => void;\n onApplied?: (decision: SubDecision) => void;\n}> = ({ decision, onClose, onApplied }) => {\n const tr = useTr();\n const apply = useApplyDecision();\n const [acknowledged, setAcknowledged] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const destructive = isDestructive(decision.recommendation);\n const identity = useRelationshipIdentity(decision);\n const rec = RECOMMENDATION_LABEL[decision.recommendation];\n const canSubmit = !apply.isPending && (!destructive || acknowledged);\n\n const submit = () => {\n if (!canSubmit) return;\n setError(null);\n apply.mutate(decision.id, {\n onSuccess: (result) => {\n onApplied?.(result.decision);\n onClose();\n },\n onError: (err) =>\n setError(errorText(err, tr('decisions.apply.error', 'Could not apply this decision.'))),\n });\n };\n\n return (\n <Modal\n title={tr('decisions.apply.title', 'Apply: {{action}}', {\n action: tr(rec.key, rec.fallback),\n })}\n description={tr(\n 'decisions.apply.description',\n 'This runs the same change you could make by hand on the relationship page.'\n )}\n onClose={onClose}\n >\n <div className=\"space-y-4\" data-testid=\"apply-decision-dialog\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken px-4 py-3\">\n <p className=\"text-xs text-text-secondary\">\n {tr('decisions.apply.relationship', 'Subscription')}\n </p>\n <p className=\"text-sm font-semibold text-text-primary\" data-testid=\"confirm-label\">\n {identity.label}\n </p>\n {identity.amount && (\n <p className=\"text-sm tabular-nums text-text-primary\" data-testid=\"confirm-amount\">\n {identity.amount}\n </p>\n )}\n </div>\n <p className=\"text-sm text-text-secondary\">{decision.rationale}</p>\n\n {destructive && (\n <label className=\"flex items-start gap-2.5 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text\">\n <input\n type=\"checkbox\"\n checked={acknowledged}\n onChange={(e) => setAcknowledged(e.target.checked)}\n className=\"mt-0.5 size-4 shrink-0 rounded border-border-subtle\"\n data-testid=\"confirm-destructive\"\n />\n <span>\n {tr(\n 'decisions.apply.acknowledgeCancel',\n 'I want to cancel \"{{label}}\"{{amount}}. I understand the subscription will stop.',\n {\n label: identity.label,\n amount: identity.amount ? ` (${identity.amount})` : '',\n }\n )}\n </span>\n </label>\n )}\n\n {error && (\n <div className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\">\n {error}\n </div>\n )}\n\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.apply.back', 'Not now')}\n </button>\n <button\n type=\"button\"\n onClick={submit}\n disabled={!canSubmit}\n data-testid=\"confirm-apply\"\n className={cn(\n 'rounded-lg px-4 py-2 text-sm font-medium hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50',\n destructive\n ? 'bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bg-hover'\n : 'bg-action-primary-bg text-action-primary-text'\n )}\n >\n {apply.isPending\n ? tr('decisions.apply.applying', 'Applying…')\n : tr('decisions.apply.submit', 'Apply')}\n </button>\n </div>\n </div>\n </Modal>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Dismiss\n// ---------------------------------------------------------------------------\n\nexport const DismissDecisionDialog: FC<{ decision: SubDecision; onClose: () => void }> = ({\n decision,\n onClose,\n}) => {\n const tr = useTr();\n const dismiss = useDismissDecision();\n const [reason, setReason] = useState('');\n const [error, setError] = useState<string | null>(null);\n const identity = useRelationshipIdentity(decision);\n\n const submit = (e: React.FormEvent) => {\n e.preventDefault();\n setError(null);\n dismiss.mutate(\n { id: decision.id, reason },\n {\n onSuccess: () => onClose(),\n onError: (err) =>\n setError(\n errorText(err, tr('decisions.dismiss.error', 'Could not dismiss this decision.'))\n ),\n }\n );\n };\n\n return (\n <Modal\n title={tr('decisions.dismiss.title', 'Dismiss recommendation')}\n description={identity.label}\n onClose={onClose}\n >\n <form onSubmit={submit} className=\"space-y-4\" data-testid=\"dismiss-decision-dialog\">\n <div>\n <label\n htmlFor={`dismiss-reason-${decision.id}`}\n className=\"mb-1 block text-xs font-medium text-text-secondary\"\n >\n {tr('decisions.dismiss.reason', 'Reason (optional)')}\n </label>\n <textarea\n id={`dismiss-reason-${decision.id}`}\n value={reason}\n onChange={(e) => setReason(e.target.value)}\n rows={3}\n maxLength={500}\n placeholder={tr('decisions.dismiss.placeholder', 'e.g. We still use this every week')}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n {error && (\n <div className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\">\n {error}\n </div>\n )}\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.dismiss.back', 'Back')}\n </button>\n <button\n type=\"submit\"\n disabled={dismiss.isPending}\n data-testid=\"confirm-dismiss\"\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50\"\n >\n {dismiss.isPending\n ? tr('decisions.dismiss.dismissing', 'Dismissing…')\n : tr('decisions.dismiss.submit', 'Dismiss')}\n </button>\n </div>\n </form>\n </Modal>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Source rows\n// ---------------------------------------------------------------------------\n\nexport const DecisionSources: FC<{ decision: SubDecision; limit?: number }> = ({\n decision,\n limit,\n}) => {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const all = evidenceSources(decision);\n const shown = limit ? all.slice(0, limit) : all;\n const kindLabel: Record<string, string> = {\n relationship: tr('decisions.sources.relationship', 'Subscription'),\n keptRelationship: tr('decisions.sources.keptRelationship', 'Keep instead'),\n plan: tr('decisions.sources.plan', 'Current plan'),\n alternativePlan: tr('decisions.sources.alternativePlan', 'Suggested plan'),\n renewalEvent: tr('decisions.sources.renewalEvent', 'Renewal event'),\n entitlement: tr('decisions.sources.entitlement', 'Entitlement usage'),\n };\n return (\n <div>\n <p className=\"text-[10px] font-medium uppercase tracking-wide text-text-secondary\">\n {tr('decisions.sources.title', 'Based on')}\n </p>\n <ul className=\"mt-1.5 flex flex-wrap gap-1.5\" data-testid=\"decision-sources\">\n {shown.map((source) => (\n <li key={`${source.kind}-${source.id}`}>\n <button\n type=\"button\"\n onClick={() => navigateTo(source.path)}\n data-source-kind={source.kind}\n className=\"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-subtle bg-bg-sunken px-2 py-0.5 text-left text-[11px] text-text-secondary hover:text-text-primary\"\n >\n <span className=\"font-medium text-text-primary\">{kindLabel[source.kind]}</span>\n <span className=\"truncate\">{source.title}</span>\n {source.detail && <span className=\"tabular-nums\">{source.detail}</span>}\n <ExternalLink className=\"h-3 w-3 shrink-0\" aria-hidden />\n </button>\n </li>\n ))}\n {limit && all.length > limit && (\n <li className=\"px-1 py-0.5 text-[11px] text-text-secondary\">\n {tr('decisions.sources.more', '+{{count}} more', { count: all.length - limit })}\n </li>\n )}\n </ul>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Card\n// ---------------------------------------------------------------------------\n\nexport const DecisionCard: FC<{\n decision: SubDecision;\n /** Hide the agent name (e.g. on the agent's own page). */\n hideAgent?: boolean;\n}> = ({ decision, hideAgent = false }) => {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const [dialog, setDialog] = useState<'apply' | 'dismiss' | null>(null);\n const kind = DECISION_KIND_LABEL[decision.kind];\n const rec = RECOMMENDATION_LABEL[decision.recommendation];\n const destructive = isDestructive(decision.recommendation);\n const actionable = isActionable(decision);\n const identity = useRelationshipIdentity(decision);\n\n return (\n <GlassCard\n treatment=\"metric\"\n className=\"flex flex-col gap-3 p-4\"\n data-testid=\"decision-card\"\n data-decision-id={decision.id}\n data-recommendation={decision.recommendation}\n data-status={decision.status}\n >\n <div className=\"flex flex-wrap items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"text-[11px] font-medium uppercase tracking-wide text-text-secondary\">\n {tr(kind.key, kind.fallback)}\n {!hideAgent && decision.agent ? ` · ${decision.agent.name}` : ''}\n </p>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/decisions/${decision.id}`)}\n className=\"mt-0.5 flex items-center gap-1.5 text-left text-sm font-semibold text-text-primary hover:underline\"\n >\n {destructive && (\n <ShieldAlert className=\"h-4 w-4 shrink-0 text-status-error-text\" aria-hidden />\n )}\n {tr(rec.key, rec.fallback)}: {identity.label}\n </button>\n {identity.amount && (\n <p className=\"text-xs tabular-nums text-text-secondary\">{identity.amount}</p>\n )}\n </div>\n <StatusBadge status={decision.status} />\n </div>\n\n <p className=\"text-sm text-text-secondary\">{decision.rationale}</p>\n\n <div className=\"flex flex-wrap gap-2 text-xs\">\n <span className=\"inline-flex items-center gap-1.5 rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary\">\n <Gauge className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.confidence', 'Confidence {{pct}}%', {\n pct: confidencePercent(decision.confidence),\n })}\n </span>\n {decision.estimatedSavings > 0 && (\n <span className=\"inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-2 py-0.5 font-medium text-status-success-text tabular-nums\">\n <PiggyBank className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.savings', 'Saves {{amount}} a year', {\n amount: formatCurrency(decision.estimatedSavings, decision.currency),\n })}\n </span>\n )}\n <span className=\"inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary\">\n {formatRelativeTime(decision.createdAt)}\n </span>\n </div>\n\n <DecisionSources decision={decision} limit={4} />\n\n {decision.status === 'FLAGGED' && decision.validationErrors.length > 0 && (\n <p className=\"rounded-md bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text\">\n {tr('decisions.card.flagged', 'Held back: failed validation')} —{' '}\n {decision.validationErrors.join('; ')}\n </p>\n )}\n {decision.status === 'DISMISSED' && decision.dismissedReason && (\n <p className=\"text-xs text-text-secondary\">\n {tr('decisions.card.dismissedReason', 'Dismissed: {{reason}}', {\n reason: decision.dismissedReason,\n })}\n </p>\n )}\n\n {actionable && (\n <div className=\"flex flex-wrap justify-end gap-2 border-t border-border-subtle pt-3\">\n <button\n type=\"button\"\n onClick={() => setDialog('dismiss')}\n data-testid=\"dismiss-decision\"\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <XCircle className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.dismiss', 'Dismiss')}\n </button>\n <button\n type=\"button\"\n onClick={() => setDialog('apply')}\n data-testid=\"apply-decision\"\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium hover:opacity-90',\n destructive\n ? 'border border-status-error-text/40 bg-status-error-bg-subtle text-status-error-text'\n : 'bg-action-primary-bg text-action-primary-text'\n )}\n >\n <CheckCircle2 className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.apply', 'Review and apply')}\n </button>\n </div>\n )}\n\n {dialog === 'apply' && (\n <ApplyDecisionDialog decision={decision} onClose={() => setDialog(null)} />\n )}\n {dialog === 'dismiss' && (\n <DismissDecisionDialog decision={decision} onClose={() => setDialog(null)} />\n )}\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAoCA,SAAS,EAAU,GAAc,GAA0B;CACzD,OAAO,aAAe,SAAS,EAAI,UAAU,EAAI,UAAU;AAC7D;AAGA,SAAS,EAAwB,GAAiE;CAChG,IAAM,IAAO,EAAqB,CAAQ,GACpC,IACJ,EAAK,WAAW,OAEZ,OADA,GAAG,EAAe,EAAK,QAAQ,EAAK,YAAY,EAAS,QAAQ,IAAI,EAAK,WAAW,MAAM,EAAgB,EAAK,QAAQ,EAAE,YAAY,MAAM;CAElJ,OAAO;EAAE,OAAO,EAAK,SAAS,EAAS;EAAgB;CAAO;AAChE;AAMA,IAAa,KAIP,EAAE,aAAU,YAAS,mBAAgB;CACzC,IAAM,IAAK,EAAM,GACX,IAAQ,EAAiB,GACzB,CAAC,GAAc,KAAmB,EAAS,EAAK,GAChD,CAAC,GAAO,KAAY,EAAwB,IAAI,GAChD,IAAc,EAAc,EAAS,cAAc,GACnD,IAAW,EAAwB,CAAQ,GAC3C,IAAM,EAAqB,EAAS,iBACpC,IAAY,CAAC,EAAM,cAAc,CAAC,KAAe;CAevD,OACE,kBAAC,GAAD;EACE,OAAO,EAAG,yBAAyB,qBAAqB,EACtD,QAAQ,EAAG,EAAI,KAAK,EAAI,QAAQ,EAClC,CAAC;EACD,aAAa,EACX,+BACA,4EACF;EACS;YAET,kBAAC,OAAD;GAAK,WAAU;GAAY,eAAY;aAAvC;IACE,kBAAC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kB,EAAS,QAAQ,EACrE,CAAC,CACG;;KAER,kBAAC,QAAD;MAAM,WAAU;gBACb,EAAmB,EAAS,SAAS;KAClC,CAAA;IACH;;GAEL,kBAAC,GAAD;IAA2B;IAAU,OAAO;GAAI,CAAA;GAE/C,EAAS,WAAW,aAAa,EAAS,iBAAiB,SAAS,KACnE,kBAAC,KAAD;IAAG,WAAU;cAAb;KACG,EAAG,0BAA0B,8BAA8B;KAAE;KAAG;KAChE,EAAS,iBAAiB,KAAK,IAAI;IACnC;;GAEJ,EAAS,WAAW,eAAe,EAAS,mBAC3C,kBAAC,KAAD;IAAG,WAAU;cACV,EAAG,kCAAkC,yBAAyB,EAC7D,QAAQ,EAAS,gBACnB,CAAC;GACA,CAAA;GAGJ,KACC,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,UAAD;KACE,MAAK;KACL,eAAe,EAAU,SAAS;KAClC,eAAY;KACZ,WAAU;eAJZ,CAME,kBAAC,GAAD;MAAS,WAAU;MAAc,eAAA;KAAa,CAAA,GAC7C,EAAG,0BAA0B,SAAS,CACjC;QACR,kBAAC,UAAD;KACE,MAAK;KACL,eAAe,EAAU,OAAO;KAChC,eAAY;KACZ,WAAW,EACT,gGACA,IACI,wFACA,+CACN;eATF,CAWE,kBAAC,GAAD;MAAc,WAAU;MAAc,eAAA;KAAa,CAAA,GAClD,EAAG,wBAAwB,kBAAkB,CACxC;MACL;;GAGN,MAAW,WACV,kBAAC,GAAD;IAA+B;IAAU,eAAe,EAAU,IAAI;GAAI,CAAA;GAE3E,MAAW,aACV,kBAAC,GAAD;IAAiC;IAAU,eAAe,EAAU,IAAI;GAAI,CAAA;EAErE;;AAEf"}
|
|
1
|
+
{"version":3,"file":"DecisionCard.js","names":[],"sources":["../../../../src/subscriberbot/components/decisions/DecisionCard.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Decision card + apply / dismiss dialogs\n * @module subscriberbot/components/decisions\n *\n * Renders one `SubDecision` from the decision engine: the recommendation, the\n * rationale, confidence, estimated annual saving, the relationship it concerns\n * and the source rows it reasoned over. Apply and dismiss go through\n * `subApplyDecision` / `subDismissDecision`.\n *\n * Apply always opens a confirmation dialog that names the relationship and its\n * amount. For a destructive recommendation (cancel) the Apply button stays\n * disabled until the user ticks an acknowledgement that names the same\n * relationship and amount, so a cancellation can never happen on a misclick.\n */\n\nimport { useState, type FC } from 'react';\nimport { CheckCircle2, ExternalLink, Gauge, PiggyBank, ShieldAlert, XCircle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { Modal } from '../Modal';\nimport { StatusBadge } from '../StatusBadge';\nimport { useTr } from '../../hooks/useTr';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useApplyDecision, useDismissDecision } from '../../hooks/useSubscriberBotApi';\n\nimport { cn } from '../../utils/cn';\nimport type { SubDecision } from '../../types';\nimport {\n DECISION_KIND_LABEL,\n RECOMMENDATION_LABEL,\n confidencePercent,\n evidenceSources,\n isActionable,\n isDestructive,\n relationshipSnapshot,\n} from './decisionModel';\n\nfunction errorText(err: unknown, fallback: string): string {\n return err instanceof Error && err.message ? err.message : fallback;\n}\n\n/** \"Netflix Premium · 15.49 USD / monthly\" — the identity a confirmation must name. */\nfunction useRelationshipIdentity(decision: SubDecision): { label: string; amount: string | null } {\n const { formatCurrency, formatEnumLabel } = useFormatters();\n\n const snap = relationshipSnapshot(decision);\n const amount =\n snap.amount !== null\n ? `${formatCurrency(snap.amount, snap.currency ?? decision.currency)}${snap.interval ? ` / ${formatEnumLabel(snap.interval).toLowerCase()}` : ''}`\n : null;\n return { label: snap.label ?? decision.relationshipId, amount };\n}\n\n// ---------------------------------------------------------------------------\n// Apply confirmation\n// ---------------------------------------------------------------------------\n\nexport const ApplyDecisionDialog: FC<{\n decision: SubDecision;\n onClose: () => void;\n onApplied?: (decision: SubDecision) => void;\n}> = ({ decision, onClose, onApplied }) => {\n const tr = useTr();\n const apply = useApplyDecision();\n const [acknowledged, setAcknowledged] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const destructive = isDestructive(decision.recommendation);\n const identity = useRelationshipIdentity(decision);\n const rec = RECOMMENDATION_LABEL[decision.recommendation];\n const canSubmit = !apply.isPending && (!destructive || acknowledged);\n\n const submit = () => {\n if (!canSubmit) return;\n setError(null);\n apply.mutate(decision.id, {\n onSuccess: (result) => {\n onApplied?.(result.decision);\n onClose();\n },\n onError: (err) =>\n setError(errorText(err, tr('decisions.apply.error', 'Could not apply this decision.'))),\n });\n };\n\n return (\n <Modal\n title={tr('decisions.apply.title', 'Apply: {{action}}', {\n action: tr(rec.key, rec.fallback),\n })}\n description={tr(\n 'decisions.apply.description',\n 'This runs the same change you could make by hand on the relationship page.'\n )}\n onClose={onClose}\n >\n <div className=\"space-y-4\" data-testid=\"apply-decision-dialog\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken px-4 py-3\">\n <p className=\"text-xs text-text-secondary\">\n {tr('decisions.apply.relationship', 'Subscription')}\n </p>\n <p className=\"text-sm font-semibold text-text-primary\" data-testid=\"confirm-label\">\n {identity.label}\n </p>\n {identity.amount && (\n <p className=\"text-sm tabular-nums text-text-primary\" data-testid=\"confirm-amount\">\n {identity.amount}\n </p>\n )}\n </div>\n <p className=\"text-sm text-text-secondary\">{decision.rationale}</p>\n\n {destructive && (\n <label className=\"flex items-start gap-2.5 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text\">\n <input\n type=\"checkbox\"\n checked={acknowledged}\n onChange={(e) => setAcknowledged(e.target.checked)}\n className=\"mt-0.5 size-4 shrink-0 rounded border-border-subtle\"\n data-testid=\"confirm-destructive\"\n />\n <span>\n {tr(\n 'decisions.apply.acknowledgeCancel',\n 'I want to cancel \"{{label}}\"{{amount}}. I understand the subscription will stop.',\n {\n label: identity.label,\n amount: identity.amount ? ` (${identity.amount})` : '',\n }\n )}\n </span>\n </label>\n )}\n\n {error && (\n <div\n role=\"alert\"\n className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {error}\n </div>\n )}\n\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.apply.back', 'Not now')}\n </button>\n <button\n type=\"button\"\n onClick={submit}\n disabled={!canSubmit}\n data-testid=\"confirm-apply\"\n className={cn(\n 'rounded-lg px-4 py-2 text-sm font-medium hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50',\n destructive\n ? 'bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bg-hover'\n : 'bg-action-primary-bg text-action-primary-text'\n )}\n >\n {apply.isPending\n ? tr('decisions.apply.applying', 'Applying…')\n : tr('decisions.apply.submit', 'Apply')}\n </button>\n </div>\n </div>\n </Modal>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Dismiss\n// ---------------------------------------------------------------------------\n\nexport const DismissDecisionDialog: FC<{ decision: SubDecision; onClose: () => void }> = ({\n decision,\n onClose,\n}) => {\n const tr = useTr();\n const dismiss = useDismissDecision();\n const [reason, setReason] = useState('');\n const [error, setError] = useState<string | null>(null);\n const identity = useRelationshipIdentity(decision);\n\n const submit = (e: React.FormEvent) => {\n e.preventDefault();\n setError(null);\n dismiss.mutate(\n { id: decision.id, reason },\n {\n onSuccess: () => onClose(),\n onError: (err) =>\n setError(\n errorText(err, tr('decisions.dismiss.error', 'Could not dismiss this decision.'))\n ),\n }\n );\n };\n\n return (\n <Modal\n title={tr('decisions.dismiss.title', 'Dismiss recommendation')}\n description={identity.label}\n onClose={onClose}\n >\n <form onSubmit={submit} className=\"space-y-4\" data-testid=\"dismiss-decision-dialog\">\n <div>\n <label\n htmlFor={`dismiss-reason-${decision.id}`}\n className=\"mb-1 block text-xs font-medium text-text-secondary\"\n >\n {tr('decisions.dismiss.reason', 'Reason (optional)')}\n </label>\n <textarea\n id={`dismiss-reason-${decision.id}`}\n value={reason}\n onChange={(e) => setReason(e.target.value)}\n rows={3}\n maxLength={500}\n placeholder={tr('decisions.dismiss.placeholder', 'e.g. We still use this every week')}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n {error && (\n <div\n role=\"alert\"\n className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {error}\n </div>\n )}\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.dismiss.back', 'Back')}\n </button>\n <button\n type=\"submit\"\n disabled={dismiss.isPending}\n data-testid=\"confirm-dismiss\"\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50\"\n >\n {dismiss.isPending\n ? tr('decisions.dismiss.dismissing', 'Dismissing…')\n : tr('decisions.dismiss.submit', 'Dismiss')}\n </button>\n </div>\n </form>\n </Modal>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Source rows\n// ---------------------------------------------------------------------------\n\nexport const DecisionSources: FC<{ decision: SubDecision; limit?: number }> = ({\n decision,\n limit,\n}) => {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const all = evidenceSources(decision);\n const shown = limit ? all.slice(0, limit) : all;\n const kindLabel: Record<string, string> = {\n relationship: tr('decisions.sources.relationship', 'Subscription'),\n keptRelationship: tr('decisions.sources.keptRelationship', 'Keep instead'),\n plan: tr('decisions.sources.plan', 'Current plan'),\n alternativePlan: tr('decisions.sources.alternativePlan', 'Suggested plan'),\n renewalEvent: tr('decisions.sources.renewalEvent', 'Renewal event'),\n entitlement: tr('decisions.sources.entitlement', 'Entitlement usage'),\n };\n return (\n <div>\n <p className=\"text-[10px] font-medium uppercase tracking-wide text-text-secondary\">\n {tr('decisions.sources.title', 'Based on')}\n </p>\n <ul className=\"mt-1.5 flex flex-wrap gap-1.5\" data-testid=\"decision-sources\">\n {shown.map((source) => (\n <li key={`${source.kind}-${source.id}`}>\n <button\n type=\"button\"\n onClick={() => navigateTo(source.path)}\n data-source-kind={source.kind}\n className=\"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-subtle bg-bg-sunken px-2 py-0.5 text-start text-[11px] text-text-secondary hover:text-text-primary\"\n >\n <span className=\"font-medium text-text-primary\">{kindLabel[source.kind]}</span>\n <span className=\"truncate\">{source.title}</span>\n {source.detail && <span className=\"tabular-nums\">{source.detail}</span>}\n <ExternalLink className=\"h-3 w-3 shrink-0\" aria-hidden />\n </button>\n </li>\n ))}\n {limit && all.length > limit && (\n <li className=\"px-1 py-0.5 text-[11px] text-text-secondary\">\n {tr('decisions.sources.more', '+{{count}} more', { count: all.length - limit })}\n </li>\n )}\n </ul>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Card\n// ---------------------------------------------------------------------------\n\nexport const DecisionCard: FC<{\n decision: SubDecision;\n /** Hide the agent name (e.g. on the agent's own page). */\n hideAgent?: boolean;\n}> = ({ decision, hideAgent = false }) => {\n const { formatCurrency, formatRelativeTime } = useFormatters();\n\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const [dialog, setDialog] = useState<'apply' | 'dismiss' | null>(null);\n const kind = DECISION_KIND_LABEL[decision.kind];\n const rec = RECOMMENDATION_LABEL[decision.recommendation];\n const destructive = isDestructive(decision.recommendation);\n const actionable = isActionable(decision);\n const identity = useRelationshipIdentity(decision);\n\n return (\n <GlassCard\n treatment=\"metric\"\n className=\"flex flex-col gap-3 p-4\"\n data-testid=\"decision-card\"\n data-decision-id={decision.id}\n data-recommendation={decision.recommendation}\n data-status={decision.status}\n >\n <div className=\"flex flex-wrap items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"text-[11px] font-medium uppercase tracking-wide text-text-secondary\">\n {tr(kind.key, kind.fallback)}\n {!hideAgent && decision.agent ? ` · ${decision.agent.name}` : ''}\n </p>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/decisions/${decision.id}`)}\n className=\"mt-0.5 flex items-center gap-1.5 text-start text-sm font-semibold text-text-primary hover:underline\"\n >\n {destructive && (\n <ShieldAlert className=\"h-4 w-4 shrink-0 text-status-error-text\" aria-hidden />\n )}\n {tr(rec.key, rec.fallback)}: {identity.label}\n </button>\n {identity.amount && (\n <p className=\"text-xs tabular-nums text-text-secondary\">{identity.amount}</p>\n )}\n </div>\n <StatusBadge status={decision.status} />\n </div>\n\n <p className=\"text-sm text-text-secondary\">{decision.rationale}</p>\n\n <div className=\"flex flex-wrap gap-2 text-xs\">\n <span className=\"inline-flex items-center gap-1.5 rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary\">\n <Gauge className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.confidence', 'Confidence {{pct}}%', {\n pct: confidencePercent(decision.confidence),\n })}\n </span>\n {decision.estimatedSavings > 0 && (\n <span className=\"inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-2 py-0.5 font-medium text-status-success-text tabular-nums\">\n <PiggyBank className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.savings', 'Saves {{amount}} a year', {\n amount: formatCurrency(decision.estimatedSavings, decision.currency),\n })}\n </span>\n )}\n <span className=\"inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary\">\n {formatRelativeTime(decision.createdAt)}\n </span>\n </div>\n\n <DecisionSources decision={decision} limit={4} />\n\n {decision.status === 'FLAGGED' && decision.validationErrors.length > 0 && (\n <p className=\"rounded-md bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text\">\n {tr('decisions.card.flagged', 'Held back: failed validation')} —{' '}\n {decision.validationErrors.join('; ')}\n </p>\n )}\n {decision.status === 'DISMISSED' && decision.dismissedReason && (\n <p className=\"text-xs text-text-secondary\">\n {tr('decisions.card.dismissedReason', 'Dismissed: {{reason}}', {\n reason: decision.dismissedReason,\n })}\n </p>\n )}\n\n {actionable && (\n <div className=\"flex flex-wrap justify-end gap-2 border-t border-border-subtle pt-3\">\n <button\n type=\"button\"\n onClick={() => setDialog('dismiss')}\n data-testid=\"dismiss-decision\"\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <XCircle className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.dismiss', 'Dismiss')}\n </button>\n <button\n type=\"button\"\n onClick={() => setDialog('apply')}\n data-testid=\"apply-decision\"\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium hover:opacity-90',\n destructive\n ? 'border border-status-error-text/40 bg-status-error-bg-subtle text-status-error-text'\n : 'bg-action-primary-bg text-action-primary-text'\n )}\n >\n <CheckCircle2 className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.apply', 'Review and apply')}\n </button>\n </div>\n )}\n\n {dialog === 'apply' && (\n <ApplyDecisionDialog decision={decision} onClose={() => setDialog(null)} />\n )}\n {dialog === 'dismiss' && (\n <DismissDecisionDialog decision={decision} onClose={() => setDialog(null)} />\n )}\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAqCA,SAAS,EAAU,GAAc,GAA0B;CACzD,OAAO,aAAe,SAAS,EAAI,UAAU,EAAI,UAAU;AAC7D;AAGA,SAAS,EAAwB,GAAiE;CAChG,IAAM,EAAE,mBAAgB,uBAAoB,EAAc,GAEpD,IAAO,EAAqB,CAAQ,GACpC,IACJ,EAAK,WAAW,OAEZ,OADA,GAAG,EAAe,EAAK,QAAQ,EAAK,YAAY,EAAS,QAAQ,IAAI,EAAK,WAAW,MAAM,EAAgB,EAAK,QAAQ,EAAE,YAAY,MAAM;CAElJ,OAAO;EAA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,GAC7C,EAAG,0BAA0B,SAAS,CACjC;QACR,kBAAC,UAAD;KACE,MAAK;KACL,eAAe,EAAU,OAAO;KAChC,eAAY;KACZ,WAAW,EACT,gGACA,IACI,wFACA,+CACN;eATF,CAWE,kBAAC,GAAD;MAAc,WAAU;MAAc,eAAA;KAAa,CAAA,GAClD,EAAG,wBAAwB,kBAAkB,CACxC;MACL;;GAGN,MAAW,WACV,kBAAC,GAAD;IAA+B;IAAU,eAAe,EAAU,IAAI;GAAI,CAAA;GAE3E,MAAW,aACV,kBAAC,GAAD;IAAiC;IAAU,eAAe,EAAU,IAAI;GAAI,CAAA;EAErE;;AAEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileDashboard.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/mobile/MobileDashboard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MobileDashboard.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/mobile/MobileDashboard.tsx"],"names":[],"mappings":"AACA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAmB3C,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,cAAc,EAAE,eAAe,EAAE,CAAC;IAClC,2CAA2C;IAC3C,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,iBAAiB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAClE,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAOD,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAkRpD,CAAC"}
|