@burdenoff/microfe-brainyrich 2026.705.1 → 2026.706.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/brainyrich/BrainyRichRoot.js +13 -13
- package/dist/brainyrich/components/ActorName.js +38 -0
- package/dist/brainyrich/components/ActorName.js.map +1 -0
- package/dist/brainyrich/components/ConfirmDialog.js +25 -0
- package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
- package/dist/brainyrich/components/LoadMore.js +24 -0
- package/dist/brainyrich/components/LoadMore.js.map +1 -0
- package/dist/brainyrich/components/index.js +5 -0
- package/dist/brainyrich/components/notify.js +38 -0
- package/dist/brainyrich/components/notify.js.map +1 -0
- package/dist/brainyrich/components/pickers.js +232 -0
- package/dist/brainyrich/components/pickers.js.map +1 -0
- package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
- package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
- package/dist/brainyrich/components/reuse/TagField.js +206 -0
- package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
- package/dist/brainyrich/components/reuse/transport.js +24 -0
- package/dist/brainyrich/components/reuse/transport.js.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js +644 -372
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
- package/dist/brainyrich/pages/AccountsPage.js +346 -293
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.js +339 -320
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +178 -164
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +195 -169
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +247 -198
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +478 -442
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
- package/dist/brainyrich/pages/PortfoliosPage.js +438 -396
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +246 -213
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +321 -173
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +258 -225
- package/dist/brainyrich/pages/TaxPage.js.map +1 -1
- package/dist/brainyrich/pages/_shared.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +3 -2
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
2
|
import { useAcknowledgeInsight as t, useCreateAccount as n, useDismissInsight as r, useGoals as i, useInsights as a, useNetWorthSummary as o, usePortfolios as s, useResolveInsight as c } from "../hooks/useBrainyRichApi.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { ConfirmDialog as l } from "../components/ConfirmDialog.js";
|
|
4
|
+
import { HouseholdPicker as u } from "../components/pickers.js";
|
|
5
|
+
import "../components/index.js";
|
|
6
|
+
import { AllocationBars as d, EmptyState as f, ErrorState as p, KpiGrid as m, LoadingState as h, SectionShell as g, formatDate as _, formatMoney as v, statusBadgeVariant as y } from "./_shared.js";
|
|
7
|
+
import { useMemo as b, useState as x } from "react";
|
|
8
|
+
import { Bell as S, Briefcase as C, Check as w, CircleCheck as T, MoreHorizontal as E, PlusCircle as D, Target as O, Wallet as k, X as A } from "lucide-react";
|
|
9
|
+
import { useI18n as j } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
10
|
+
import { jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
11
|
+
import { Badge as P, Button as F, Card as I, CardContent as L, CardDescription as R, CardHeader as z, CardTitle as B, Dialog as V, DialogContent as H, DialogDescription as U, DialogFooter as W, DialogHeader as G, DialogTitle as K, DropdownMenu as q, DropdownMenuContent as J, DropdownMenuItem as Y, DropdownMenuTrigger as X, Input as Z, Label as Q, Select as $, SelectContent as ee, SelectItem as te, SelectTrigger as ne, SelectValue as re } from "@burdenoff/fe-libs/ui";
|
|
9
12
|
//#region src/brainyrich/pages/DashboardPage.tsx
|
|
10
|
-
var
|
|
13
|
+
var ie = [
|
|
11
14
|
"BANK",
|
|
12
15
|
"BROKERAGE",
|
|
13
16
|
"RETIREMENT",
|
|
@@ -17,100 +20,100 @@ var ne = [
|
|
|
17
20
|
"ALTERNATIVE",
|
|
18
21
|
"LIABILITY"
|
|
19
22
|
];
|
|
20
|
-
function
|
|
21
|
-
let { t } =
|
|
23
|
+
function ae() {
|
|
24
|
+
let { t } = j(), n = (n, r, i) => e(t, n, r, i), r = o(), c = s(), l = i(), u = a({ status: "OPEN" }), x = r.data, w = x?.currency ?? "USD", E = x ? [
|
|
22
25
|
{
|
|
23
26
|
label: n("brainyrich.dashboard.metrics.netWorth", "Net Worth"),
|
|
24
|
-
value:
|
|
27
|
+
value: v(x.totalNetWorth, w)
|
|
25
28
|
},
|
|
26
29
|
{
|
|
27
30
|
label: n("brainyrich.dashboard.metrics.investedAssets", "Invested Assets"),
|
|
28
|
-
value:
|
|
31
|
+
value: v(x.totalMarketValue, w)
|
|
29
32
|
},
|
|
30
33
|
{
|
|
31
34
|
label: n("brainyrich.dashboard.metrics.liquidity", "Cash & Liquidity"),
|
|
32
|
-
value:
|
|
35
|
+
value: v(x.totalCash, w)
|
|
33
36
|
},
|
|
34
37
|
{
|
|
35
38
|
label: n("brainyrich.dashboard.metrics.accounts", "Linked Accounts"),
|
|
36
|
-
value: String(
|
|
39
|
+
value: String(x.accountCount)
|
|
37
40
|
}
|
|
38
|
-
] : [],
|
|
39
|
-
if (!
|
|
40
|
-
let e =
|
|
41
|
-
return e <= 0 ? [] :
|
|
41
|
+
] : [], D = b(() => {
|
|
42
|
+
if (!x) return [];
|
|
43
|
+
let e = x.byAssetClass.reduce((e, t) => e + t.marketValue, 0);
|
|
44
|
+
return e <= 0 ? [] : x.byAssetClass.slice().sort((e, t) => t.marketValue - e.marketValue).map((t) => ({
|
|
42
45
|
label: t.assetClass.replace(/_/g, " "),
|
|
43
46
|
value: t.marketValue / e * 100,
|
|
44
|
-
caption:
|
|
47
|
+
caption: v(t.marketValue, w)
|
|
45
48
|
}));
|
|
46
|
-
}, [
|
|
47
|
-
return /* @__PURE__ */
|
|
49
|
+
}, [x, w]), A = c.data.slice(0, 5), F = l.data.slice(0, 5), V = u.data.slice(0, 6);
|
|
50
|
+
return /* @__PURE__ */ N(g, {
|
|
48
51
|
title: n("brainyrich.dashboard.title", "Wealth Dashboard"),
|
|
49
52
|
description: n("brainyrich.dashboard.description", "Your consolidated financial overview at a glance"),
|
|
50
|
-
actions: /* @__PURE__ */
|
|
53
|
+
actions: /* @__PURE__ */ M(se, { translate: n }),
|
|
51
54
|
children: [
|
|
52
|
-
r.isLoading ? /* @__PURE__ */
|
|
55
|
+
r.isLoading ? /* @__PURE__ */ M(h, { rows: 1 }) : r.isError ? /* @__PURE__ */ M(p, {
|
|
53
56
|
title: n("brainyrich.dashboard.netWorthError", "Could not load net worth"),
|
|
54
57
|
onRetry: () => r.refetch()
|
|
55
|
-
}) :
|
|
56
|
-
icon: /* @__PURE__ */
|
|
58
|
+
}) : x ? /* @__PURE__ */ M(m, { items: E }) : /* @__PURE__ */ M(f, {
|
|
59
|
+
icon: /* @__PURE__ */ M(k, {
|
|
57
60
|
className: "size-6",
|
|
58
61
|
"aria-hidden": "true"
|
|
59
62
|
}),
|
|
60
63
|
title: n("brainyrich.dashboard.noSummary", "No financial data yet"),
|
|
61
64
|
description: n("brainyrich.dashboard.noSummaryDesc", "Link your first account to see your net worth here.")
|
|
62
65
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ N("div", {
|
|
64
67
|
className: "grid gap-6 lg:grid-cols-3",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
68
|
+
children: [/* @__PURE__ */ N(I, {
|
|
66
69
|
className: "lg:col-span-2",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(B, {
|
|
68
71
|
className: "flex items-center gap-2",
|
|
69
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ M(C, {
|
|
70
73
|
className: "h-5 w-5",
|
|
71
74
|
"aria-hidden": "true"
|
|
72
75
|
}), n("brainyrich.dashboard.sections.assetAllocation", "Asset Allocation")]
|
|
73
|
-
}), /* @__PURE__ */
|
|
74
|
-
icon: /* @__PURE__ */
|
|
76
|
+
}), /* @__PURE__ */ M(R, { children: n("brainyrich.dashboard.sections.assetAllocationDescription", "Market value distributed across asset classes") })] }), /* @__PURE__ */ M(L, { children: r.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : r.isError ? /* @__PURE__ */ M(p, { onRetry: () => r.refetch() }) : D.length > 0 ? /* @__PURE__ */ M(d, { data: D }) : /* @__PURE__ */ M(f, {
|
|
77
|
+
icon: /* @__PURE__ */ M(C, {
|
|
75
78
|
className: "size-6",
|
|
76
79
|
"aria-hidden": "true"
|
|
77
80
|
}),
|
|
78
81
|
title: n("brainyrich.dashboard.noAllocation", "No holdings to allocate"),
|
|
79
82
|
description: n("brainyrich.dashboard.noAllocationDesc", "Add holdings to your accounts to see how your wealth is allocated.")
|
|
80
83
|
}) })]
|
|
81
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ N(I, { children: [/* @__PURE__ */ M(z, {
|
|
82
85
|
className: "pb-3",
|
|
83
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ N(B, {
|
|
84
87
|
className: "flex items-center gap-2 text-base",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ M(O, {
|
|
86
89
|
className: "h-4 w-4",
|
|
87
90
|
"aria-hidden": "true"
|
|
88
91
|
}), n("brainyrich.dashboard.sections.goals", "Goals")]
|
|
89
92
|
})
|
|
90
|
-
}), /* @__PURE__ */
|
|
93
|
+
}), /* @__PURE__ */ M(L, {
|
|
91
94
|
className: "space-y-3",
|
|
92
|
-
children:
|
|
95
|
+
children: l.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : l.isError ? /* @__PURE__ */ M(p, { onRetry: () => l.refetch() }) : F.length > 0 ? F.map((e) => /* @__PURE__ */ N("div", {
|
|
93
96
|
className: "flex items-start justify-between gap-2 rounded-lg border border-border-subtle p-3",
|
|
94
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ N("div", {
|
|
95
98
|
className: "min-w-0 space-y-0.5",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ M("p", {
|
|
97
100
|
className: "truncate text-sm font-medium text-text-primary",
|
|
98
101
|
children: e.name
|
|
99
|
-
}), /* @__PURE__ */
|
|
102
|
+
}), /* @__PURE__ */ N("p", {
|
|
100
103
|
className: "text-xs text-text-secondary",
|
|
101
104
|
children: [
|
|
102
|
-
|
|
105
|
+
v(e.targetAmount, e.currency),
|
|
103
106
|
" · ",
|
|
104
|
-
|
|
107
|
+
_(e.targetDate)
|
|
105
108
|
]
|
|
106
109
|
})]
|
|
107
|
-
}), /* @__PURE__ */
|
|
108
|
-
variant:
|
|
110
|
+
}), /* @__PURE__ */ M(P, {
|
|
111
|
+
variant: y(e.projection),
|
|
109
112
|
className: "shrink-0",
|
|
110
113
|
children: e.projection.replace(/_/g, " ")
|
|
111
114
|
})]
|
|
112
|
-
}, e.id)) : /* @__PURE__ */
|
|
113
|
-
icon: /* @__PURE__ */
|
|
115
|
+
}, e.id)) : /* @__PURE__ */ M(f, {
|
|
116
|
+
icon: /* @__PURE__ */ M(O, {
|
|
114
117
|
className: "size-6",
|
|
115
118
|
"aria-hidden": "true"
|
|
116
119
|
}),
|
|
@@ -119,55 +122,55 @@ function re() {
|
|
|
119
122
|
})
|
|
120
123
|
})] })]
|
|
121
124
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ N(I, { children: [/* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(B, {
|
|
123
126
|
className: "flex items-center gap-2",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ M(k, {
|
|
125
128
|
className: "h-5 w-5",
|
|
126
129
|
"aria-hidden": "true"
|
|
127
130
|
}), n("brainyrich.dashboard.sections.portfolios", "Portfolios")]
|
|
128
|
-
}), /* @__PURE__ */
|
|
131
|
+
}), /* @__PURE__ */ M(R, { children: n("brainyrich.dashboard.sections.portfoliosDescription", "Your active investment strategies") })] }), /* @__PURE__ */ M(L, { children: c.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : c.isError ? /* @__PURE__ */ M(p, { onRetry: () => c.refetch() }) : A.length > 0 ? /* @__PURE__ */ M("div", {
|
|
129
132
|
className: "grid gap-3 sm:grid-cols-2",
|
|
130
|
-
children:
|
|
133
|
+
children: A.map((e) => /* @__PURE__ */ N("div", {
|
|
131
134
|
className: "flex items-start justify-between gap-2 rounded-lg border border-border-subtle p-3",
|
|
132
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ N("div", {
|
|
133
136
|
className: "min-w-0 space-y-0.5",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ M("p", {
|
|
135
138
|
className: "truncate text-sm font-medium text-text-primary",
|
|
136
139
|
children: e.name
|
|
137
|
-
}), e.description ? /* @__PURE__ */
|
|
140
|
+
}), e.description ? /* @__PURE__ */ M("p", {
|
|
138
141
|
className: "truncate text-xs text-text-secondary",
|
|
139
142
|
children: e.description
|
|
140
|
-
}) : /* @__PURE__ */
|
|
143
|
+
}) : /* @__PURE__ */ M("p", {
|
|
141
144
|
className: "text-xs text-text-secondary",
|
|
142
145
|
children: e.baseCurrency
|
|
143
146
|
})]
|
|
144
|
-
}), /* @__PURE__ */
|
|
145
|
-
variant:
|
|
147
|
+
}), /* @__PURE__ */ M(P, {
|
|
148
|
+
variant: y(e.status),
|
|
146
149
|
className: "shrink-0",
|
|
147
150
|
children: e.status
|
|
148
151
|
})]
|
|
149
152
|
}, e.id))
|
|
150
|
-
}) : /* @__PURE__ */
|
|
151
|
-
icon: /* @__PURE__ */
|
|
153
|
+
}) : /* @__PURE__ */ M(f, {
|
|
154
|
+
icon: /* @__PURE__ */ M(k, {
|
|
152
155
|
className: "size-6",
|
|
153
156
|
"aria-hidden": "true"
|
|
154
157
|
}),
|
|
155
158
|
title: n("brainyrich.dashboard.noPortfolios", "No portfolios yet"),
|
|
156
159
|
description: n("brainyrich.dashboard.noPortfoliosDesc", "Create a portfolio to organize your investment strategy.")
|
|
157
160
|
}) })] }),
|
|
158
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ N(I, { children: [/* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(B, {
|
|
159
162
|
className: "flex items-center gap-2",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ M(S, {
|
|
161
164
|
className: "h-5 w-5",
|
|
162
165
|
"aria-hidden": "true"
|
|
163
166
|
}), n("brainyrich.dashboard.sections.needsAttention", "Needs Attention")]
|
|
164
|
-
}), /* @__PURE__ */
|
|
167
|
+
}), /* @__PURE__ */ M(R, { children: n("brainyrich.dashboard.sections.needsAttentionDescription", "Open insights that may require action") })] }), /* @__PURE__ */ M(L, {
|
|
165
168
|
className: "space-y-3",
|
|
166
|
-
children:
|
|
169
|
+
children: u.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : u.isError ? /* @__PURE__ */ M(p, { onRetry: () => u.refetch() }) : V.length > 0 ? V.map((e) => /* @__PURE__ */ M(oe, {
|
|
167
170
|
insight: e,
|
|
168
171
|
translate: n
|
|
169
|
-
}, e.id)) : /* @__PURE__ */
|
|
170
|
-
icon: /* @__PURE__ */
|
|
172
|
+
}, e.id)) : /* @__PURE__ */ M(f, {
|
|
173
|
+
icon: /* @__PURE__ */ M(T, {
|
|
171
174
|
className: "size-6",
|
|
172
175
|
"aria-hidden": "true"
|
|
173
176
|
}),
|
|
@@ -178,113 +181,128 @@ function re() {
|
|
|
178
181
|
]
|
|
179
182
|
});
|
|
180
183
|
}
|
|
181
|
-
function
|
|
182
|
-
let i = t(), a = r(), o = c(), s = i.isPending || a.isPending || o.isPending;
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
+
function oe({ insight: e, translate: n }) {
|
|
185
|
+
let i = t(), a = r(), o = c(), [s, u] = x(!1), d = i.isPending || a.isPending || o.isPending;
|
|
186
|
+
return /* @__PURE__ */ N("div", {
|
|
184
187
|
className: "flex items-start justify-between gap-3 rounded-lg border border-border-subtle p-3",
|
|
185
|
-
children: [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ N("div", {
|
|
190
|
+
className: "min-w-0 space-y-1",
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ N("div", {
|
|
193
|
+
className: "flex items-center gap-2",
|
|
194
|
+
children: [/* @__PURE__ */ M(P, {
|
|
195
|
+
variant: y(e.severity),
|
|
196
|
+
children: e.severity
|
|
197
|
+
}), /* @__PURE__ */ M("span", {
|
|
198
|
+
className: "text-xs text-text-secondary",
|
|
199
|
+
children: e.type.replace(/_/g, " ")
|
|
200
|
+
})]
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ M("p", {
|
|
203
|
+
className: "text-sm font-medium text-text-primary",
|
|
204
|
+
children: e.title
|
|
205
|
+
}),
|
|
206
|
+
e.detail ? /* @__PURE__ */ M("p", {
|
|
194
207
|
className: "text-xs text-text-secondary",
|
|
195
|
-
children: e.
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
asChild: !0,
|
|
209
|
-
children: /* @__PURE__ */ A(N, {
|
|
210
|
-
variant: "ghost",
|
|
211
|
-
size: "icon",
|
|
212
|
-
className: "shrink-0",
|
|
213
|
-
disabled: s,
|
|
214
|
-
"aria-label": n("brainyrich.dashboard.insightActions", "Insight actions"),
|
|
215
|
-
children: /* @__PURE__ */ A(w, {
|
|
216
|
-
className: "size-4",
|
|
217
|
-
"aria-hidden": "true"
|
|
218
|
-
})
|
|
219
|
-
})
|
|
220
|
-
}), /* @__PURE__ */ j(K, {
|
|
221
|
-
align: "end",
|
|
222
|
-
children: [
|
|
223
|
-
/* @__PURE__ */ j(q, {
|
|
224
|
-
onSelect: () => i.mutate(e.id),
|
|
225
|
-
children: [/* @__PURE__ */ A(S, {
|
|
226
|
-
className: "size-4",
|
|
227
|
-
"aria-hidden": "true"
|
|
228
|
-
}), n("brainyrich.dashboard.insight.acknowledge", "Acknowledge")]
|
|
229
|
-
}),
|
|
230
|
-
/* @__PURE__ */ j(q, {
|
|
231
|
-
onSelect: () => o.mutate(e.id),
|
|
232
|
-
children: [/* @__PURE__ */ A(C, {
|
|
233
|
-
className: "size-4",
|
|
234
|
-
"aria-hidden": "true"
|
|
235
|
-
}), n("brainyrich.dashboard.insight.resolve", "Resolve")]
|
|
236
|
-
}),
|
|
237
|
-
/* @__PURE__ */ j(q, {
|
|
238
|
-
onSelect: () => a.mutate(e.id),
|
|
239
|
-
children: [/* @__PURE__ */ A(O, {
|
|
208
|
+
children: e.detail
|
|
209
|
+
}) : null
|
|
210
|
+
]
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ N(q, { children: [/* @__PURE__ */ M(X, {
|
|
213
|
+
asChild: !0,
|
|
214
|
+
children: /* @__PURE__ */ M(F, {
|
|
215
|
+
variant: "ghost",
|
|
216
|
+
size: "icon",
|
|
217
|
+
className: "shrink-0",
|
|
218
|
+
disabled: d,
|
|
219
|
+
"aria-label": n("brainyrich.dashboard.insightActions", "Insight actions"),
|
|
220
|
+
children: /* @__PURE__ */ M(E, {
|
|
240
221
|
className: "size-4",
|
|
241
222
|
"aria-hidden": "true"
|
|
242
|
-
})
|
|
223
|
+
})
|
|
243
224
|
})
|
|
244
|
-
|
|
245
|
-
|
|
225
|
+
}), /* @__PURE__ */ N(J, {
|
|
226
|
+
align: "end",
|
|
227
|
+
children: [
|
|
228
|
+
/* @__PURE__ */ N(Y, {
|
|
229
|
+
onSelect: () => i.mutate(e.id),
|
|
230
|
+
children: [/* @__PURE__ */ M(w, {
|
|
231
|
+
className: "size-4",
|
|
232
|
+
"aria-hidden": "true"
|
|
233
|
+
}), n("brainyrich.dashboard.insight.acknowledge", "Acknowledge")]
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ N(Y, {
|
|
236
|
+
onSelect: () => o.mutate(e.id),
|
|
237
|
+
children: [/* @__PURE__ */ M(T, {
|
|
238
|
+
className: "size-4",
|
|
239
|
+
"aria-hidden": "true"
|
|
240
|
+
}), n("brainyrich.dashboard.insight.resolve", "Resolve")]
|
|
241
|
+
}),
|
|
242
|
+
/* @__PURE__ */ N(Y, {
|
|
243
|
+
onSelect: () => u(!0),
|
|
244
|
+
children: [/* @__PURE__ */ M(A, {
|
|
245
|
+
className: "size-4",
|
|
246
|
+
"aria-hidden": "true"
|
|
247
|
+
}), n("brainyrich.dashboard.insight.dismiss", "Dismiss")]
|
|
248
|
+
})
|
|
249
|
+
]
|
|
250
|
+
})] }),
|
|
251
|
+
/* @__PURE__ */ M(l, {
|
|
252
|
+
open: s,
|
|
253
|
+
onOpenChange: u,
|
|
254
|
+
title: n("brainyrich.dashboard.insight.dismissTitle", "Dismiss this insight?"),
|
|
255
|
+
description: n("brainyrich.dashboard.insight.dismissDescription", "It will be removed from Needs Attention. You can still find it in the full insights list."),
|
|
256
|
+
confirmLabel: n("brainyrich.dashboard.insight.dismiss", "Dismiss"),
|
|
257
|
+
pendingLabel: n("brainyrich.dashboard.insight.dismissing", "Dismissing…"),
|
|
258
|
+
destructive: !0,
|
|
259
|
+
pending: a.isPending,
|
|
260
|
+
onConfirm: () => a.mutate(e.id, { onSuccess: () => u(!1) })
|
|
261
|
+
})
|
|
262
|
+
]
|
|
246
263
|
});
|
|
247
264
|
}
|
|
248
|
-
function
|
|
249
|
-
let [t, r] =
|
|
250
|
-
a(""), s("BROKERAGE"), l(""),
|
|
265
|
+
function se({ translate: e }) {
|
|
266
|
+
let [t, r] = x(!1), [i, a] = x(""), [o, s] = x("BROKERAGE"), [c, l] = x(""), [d, f] = x(""), [p, m] = x("USD"), [h, g] = x(null), _ = n(), v = i.trim(), y = v.length > 0 && !_.isPending, b = () => {
|
|
267
|
+
a(""), s("BROKERAGE"), l(""), f(""), m("USD"), g(null), _.reset();
|
|
251
268
|
};
|
|
252
|
-
return /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ N(V, {
|
|
253
270
|
open: t,
|
|
254
271
|
onOpenChange: (e) => {
|
|
255
|
-
r(e), e ||
|
|
272
|
+
r(e), e || b();
|
|
256
273
|
},
|
|
257
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ N(F, {
|
|
258
275
|
size: "sm",
|
|
259
276
|
onClick: () => r(!0),
|
|
260
|
-
children: [/* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ M(D, {
|
|
261
278
|
className: "size-4",
|
|
262
279
|
"aria-hidden": "true"
|
|
263
280
|
}), e("brainyrich.dashboard.actions.newAccount", "New Account")]
|
|
264
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ M(H, { children: /* @__PURE__ */ N("form", {
|
|
265
282
|
onSubmit: (e) => {
|
|
266
|
-
if (e.preventDefault(), !
|
|
267
|
-
let t = Number.parseFloat(
|
|
268
|
-
name:
|
|
283
|
+
if (e.preventDefault(), !y) return;
|
|
284
|
+
let t = Number.parseFloat(d), n = {
|
|
285
|
+
name: v,
|
|
269
286
|
type: o,
|
|
270
|
-
currency:
|
|
287
|
+
currency: p.trim() || "USD",
|
|
271
288
|
isManual: !0,
|
|
272
289
|
...c.trim() ? { institution: c.trim() } : {},
|
|
273
|
-
...Number.isFinite(t) ? { cashBalance: t } : {}
|
|
290
|
+
...Number.isFinite(t) ? { cashBalance: t } : {},
|
|
291
|
+
...h ? { householdId: h } : {}
|
|
274
292
|
};
|
|
275
|
-
|
|
276
|
-
|
|
293
|
+
_.mutate(n, { onSuccess: () => {
|
|
294
|
+
b(), r(!1);
|
|
277
295
|
} });
|
|
278
296
|
},
|
|
279
297
|
className: "space-y-4",
|
|
280
298
|
children: [
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ N(G, { children: [/* @__PURE__ */ M(K, { children: e("brainyrich.dashboard.newAccount.title", "New Account") }), /* @__PURE__ */ M(U, { children: e("brainyrich.dashboard.newAccount.description", "Add a manual account to track alongside your linked institutions.") })] }),
|
|
300
|
+
/* @__PURE__ */ N("div", {
|
|
283
301
|
className: "space-y-2",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ M(Q, {
|
|
285
303
|
htmlFor: "bra-account-name",
|
|
286
304
|
children: e("brainyrich.dashboard.newAccount.name", "Account name")
|
|
287
|
-
}), /* @__PURE__ */
|
|
305
|
+
}), /* @__PURE__ */ M(Z, {
|
|
288
306
|
id: "bra-account-name",
|
|
289
307
|
value: i,
|
|
290
308
|
onChange: (e) => a(e.target.value),
|
|
@@ -293,84 +311,92 @@ function ae({ translate: e }) {
|
|
|
293
311
|
autoFocus: !0
|
|
294
312
|
})]
|
|
295
313
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ N("div", {
|
|
297
315
|
className: "grid gap-4 sm:grid-cols-2",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ N("div", {
|
|
299
317
|
className: "space-y-2",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
318
|
+
children: [/* @__PURE__ */ M(Q, {
|
|
301
319
|
htmlFor: "bra-account-type",
|
|
302
320
|
children: e("brainyrich.dashboard.newAccount.type", "Type")
|
|
303
|
-
}), /* @__PURE__ */
|
|
321
|
+
}), /* @__PURE__ */ N($, {
|
|
304
322
|
value: o,
|
|
305
323
|
onValueChange: (e) => s(e),
|
|
306
|
-
children: [/* @__PURE__ */
|
|
324
|
+
children: [/* @__PURE__ */ M(ne, {
|
|
307
325
|
id: "bra-account-type",
|
|
308
|
-
children: /* @__PURE__ */
|
|
309
|
-
}), /* @__PURE__ */
|
|
326
|
+
children: /* @__PURE__ */ M(re, {})
|
|
327
|
+
}), /* @__PURE__ */ M(ee, { children: ie.map((e) => /* @__PURE__ */ M(te, {
|
|
310
328
|
value: e,
|
|
311
329
|
children: e.replace(/_/g, " ")
|
|
312
330
|
}, e)) })]
|
|
313
331
|
})]
|
|
314
|
-
}), /* @__PURE__ */
|
|
332
|
+
}), /* @__PURE__ */ N("div", {
|
|
315
333
|
className: "space-y-2",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ M(Q, {
|
|
317
335
|
htmlFor: "bra-account-currency",
|
|
318
336
|
children: e("brainyrich.dashboard.newAccount.currency", "Currency")
|
|
319
|
-
}), /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ M(Z, {
|
|
320
338
|
id: "bra-account-currency",
|
|
321
|
-
value:
|
|
322
|
-
onChange: (e) =>
|
|
339
|
+
value: p,
|
|
340
|
+
onChange: (e) => m(e.target.value.toUpperCase()),
|
|
323
341
|
maxLength: 3
|
|
324
342
|
})]
|
|
325
343
|
})]
|
|
326
344
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ N("div", {
|
|
328
346
|
className: "space-y-2",
|
|
329
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ M(Q, {
|
|
330
348
|
htmlFor: "bra-account-institution",
|
|
331
349
|
children: e("brainyrich.dashboard.newAccount.institution", "Institution (optional)")
|
|
332
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ M(Z, {
|
|
333
351
|
id: "bra-account-institution",
|
|
334
352
|
value: c,
|
|
335
353
|
onChange: (e) => l(e.target.value),
|
|
336
354
|
placeholder: e("brainyrich.dashboard.newAccount.institutionPlaceholder", "e.g. Fidelity")
|
|
337
355
|
})]
|
|
338
356
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ M(u, {
|
|
358
|
+
id: "bra-account-household",
|
|
359
|
+
value: h,
|
|
360
|
+
onChange: g,
|
|
361
|
+
label: e("brainyrich.dashboard.newAccount.household", "Household (optional)"),
|
|
362
|
+
noneLabel: e("brainyrich.dashboard.newAccount.noHousehold", "No household"),
|
|
363
|
+
disabled: _.isPending
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ N("div", {
|
|
340
366
|
className: "space-y-2",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ M(Q, {
|
|
342
368
|
htmlFor: "bra-account-cash",
|
|
343
369
|
children: e("brainyrich.dashboard.newAccount.cash", "Cash balance (optional)")
|
|
344
|
-
}), /* @__PURE__ */
|
|
370
|
+
}), /* @__PURE__ */ M(Z, {
|
|
345
371
|
id: "bra-account-cash",
|
|
346
372
|
type: "number",
|
|
347
373
|
inputMode: "decimal",
|
|
348
374
|
step: "0.01",
|
|
349
|
-
value:
|
|
350
|
-
onChange: (e) =>
|
|
375
|
+
value: d,
|
|
376
|
+
onChange: (e) => f(e.target.value),
|
|
351
377
|
placeholder: "0.00"
|
|
352
378
|
})]
|
|
353
379
|
}),
|
|
354
|
-
|
|
380
|
+
_.isError ? /* @__PURE__ */ M("p", {
|
|
355
381
|
className: "text-sm text-status-error-text",
|
|
356
|
-
children:
|
|
382
|
+
children: _.error instanceof Error ? _.error.message : e("brainyrich.dashboard.newAccount.error", "Could not create account.")
|
|
357
383
|
}) : null,
|
|
358
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ N(W, { children: [/* @__PURE__ */ M(F, {
|
|
359
385
|
type: "button",
|
|
360
386
|
variant: "outline",
|
|
361
387
|
onClick: () => r(!1),
|
|
362
|
-
disabled:
|
|
388
|
+
disabled: _.isPending,
|
|
363
389
|
children: e("brainyrich.common.cancel", "Cancel")
|
|
364
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ M(F, {
|
|
365
391
|
type: "submit",
|
|
366
|
-
disabled: !
|
|
367
|
-
children:
|
|
392
|
+
disabled: !y,
|
|
393
|
+
children: _.isPending ? e("brainyrich.dashboard.newAccount.creating", "Creating…") : e("brainyrich.dashboard.newAccount.create", "Create account")
|
|
368
394
|
})] })
|
|
369
395
|
]
|
|
370
396
|
}) })]
|
|
371
397
|
});
|
|
372
398
|
}
|
|
373
399
|
//#endregion
|
|
374
|
-
export {
|
|
400
|
+
export { ae as DashboardPage };
|
|
375
401
|
|
|
376
402
|
//# sourceMappingURL=DashboardPage.js.map
|