@burdenoff/microfe-housingvista 2026.709.2 → 2026.709.3
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/housingvista/HousingVistaRoutes.d.ts.map +1 -1
- package/dist/housingvista/HousingVistaRoutes.js +136 -37
- package/dist/housingvista/HousingVistaRoutes.js.map +1 -1
- package/dist/housingvista/hooks/useHousingVistaAnalytics.d.ts +1 -1
- package/dist/housingvista/hooks/useHousingVistaAnalytics.d.ts.map +1 -1
- package/dist/housingvista/hooks/useHousingVistaAnalytics.js +4 -4
- package/dist/housingvista/hooks/useHousingVistaAnalytics.js.map +1 -1
- package/dist/housingvista/pages/amc/AMCManagementPage.d.ts.map +1 -1
- package/dist/housingvista/pages/amc/AMCManagementPage.js +62 -60
- package/dist/housingvista/pages/amc/AMCManagementPage.js.map +1 -1
- package/dist/housingvista/pages/assets/AssetDetailPage.d.ts.map +1 -1
- package/dist/housingvista/pages/assets/AssetDetailPage.js +141 -138
- package/dist/housingvista/pages/assets/AssetDetailPage.js.map +1 -1
- package/dist/housingvista/pages/assets/AssetManagementPage.d.ts.map +1 -1
- package/dist/housingvista/pages/assets/AssetManagementPage.js +193 -191
- package/dist/housingvista/pages/assets/AssetManagementPage.js.map +1 -1
- package/dist/housingvista/pages/chat/ChatPage.d.ts.map +1 -1
- package/dist/housingvista/pages/chat/ChatPage.js +115 -113
- package/dist/housingvista/pages/chat/ChatPage.js.map +1 -1
- package/dist/housingvista/pages/finance/HomeLoanDetailPage.d.ts.map +1 -1
- package/dist/housingvista/pages/finance/HomeLoanDetailPage.js +152 -149
- package/dist/housingvista/pages/finance/HomeLoanDetailPage.js.map +1 -1
- package/dist/housingvista/pages/finance/HomeLoansPage.d.ts.map +1 -1
- package/dist/housingvista/pages/finance/HomeLoansPage.js +141 -139
- package/dist/housingvista/pages/finance/HomeLoansPage.js.map +1 -1
- package/dist/housingvista/pages/investments/InvestmentDetailPage.d.ts.map +1 -1
- package/dist/housingvista/pages/investments/InvestmentDetailPage.js +290 -287
- package/dist/housingvista/pages/investments/InvestmentDetailPage.js.map +1 -1
- package/dist/housingvista/pages/investments/InvestmentsPage.d.ts.map +1 -1
- package/dist/housingvista/pages/investments/InvestmentsPage.js +64 -62
- package/dist/housingvista/pages/investments/InvestmentsPage.js.map +1 -1
- package/dist/housingvista/pages/legal/LegalPage.d.ts.map +1 -1
- package/dist/housingvista/pages/legal/LegalPage.js +95 -93
- package/dist/housingvista/pages/legal/LegalPage.js.map +1 -1
- package/dist/housingvista/pages/legal/LegalServiceDetailPage.d.ts.map +1 -1
- package/dist/housingvista/pages/legal/LegalServiceDetailPage.js +129 -126
- package/dist/housingvista/pages/legal/LegalServiceDetailPage.js.map +1 -1
- package/dist/housingvista/pages/market/AreaInsightsPage.d.ts.map +1 -1
- package/dist/housingvista/pages/market/AreaInsightsPage.js +99 -97
- package/dist/housingvista/pages/market/AreaInsightsPage.js.map +1 -1
- package/dist/housingvista/pages/market/MarketAnalyticsPage.d.ts.map +1 -1
- package/dist/housingvista/pages/market/MarketAnalyticsPage.js +138 -136
- package/dist/housingvista/pages/market/MarketAnalyticsPage.js.map +1 -1
- package/dist/housingvista/pages/marketplace/MarketplacePage.d.ts.map +1 -1
- package/dist/housingvista/pages/marketplace/MarketplacePage.js +99 -97
- package/dist/housingvista/pages/marketplace/MarketplacePage.js.map +1 -1
- package/dist/housingvista/pages/marketplace/ServiceDetailPage.d.ts.map +1 -1
- package/dist/housingvista/pages/marketplace/ServiceDetailPage.js +137 -134
- package/dist/housingvista/pages/marketplace/ServiceDetailPage.js.map +1 -1
- package/dist/housingvista/pages/offers/OffersPage.d.ts.map +1 -1
- package/dist/housingvista/pages/offers/OffersPage.js +94 -92
- package/dist/housingvista/pages/offers/OffersPage.js.map +1 -1
- package/dist/housingvista/pages/properties/AddPropertyPage.d.ts.map +1 -1
- package/dist/housingvista/pages/properties/AddPropertyPage.js +280 -279
- package/dist/housingvista/pages/properties/AddPropertyPage.js.map +1 -1
- package/dist/housingvista/pages/rental/RentalManagementPage.d.ts.map +1 -1
- package/dist/housingvista/pages/rental/RentalManagementPage.js +153 -151
- package/dist/housingvista/pages/rental/RentalManagementPage.js.map +1 -1
- package/dist/housingvista/pages/settings/ProfilePage.d.ts.map +1 -1
- package/dist/housingvista/pages/settings/ProfilePage.js +52 -50
- package/dist/housingvista/pages/settings/ProfilePage.js.map +1 -1
- package/dist/housingvista/pages/settings/SettingsPage.d.ts.map +1 -1
- package/dist/housingvista/pages/settings/SettingsPage.js +54 -52
- package/dist/housingvista/pages/settings/SettingsPage.js.map +1 -1
- package/dist/housingvista/pages/shortlist/ShortlistPage.d.ts.map +1 -1
- package/dist/housingvista/pages/shortlist/ShortlistPage.js +43 -41
- package/dist/housingvista/pages/shortlist/ShortlistPage.js.map +1 -1
- package/dist/housingvista/pages/transactions/TransactionDetailPage.d.ts.map +1 -1
- package/dist/housingvista/pages/transactions/TransactionDetailPage.js +211 -208
- package/dist/housingvista/pages/transactions/TransactionDetailPage.js.map +1 -1
- package/dist/housingvista/pages/transactions/TransactionsPage.d.ts.map +1 -1
- package/dist/housingvista/pages/transactions/TransactionsPage.js +85 -83
- package/dist/housingvista/pages/transactions/TransactionsPage.js.map +1 -1
- package/dist/housingvista/pages/verification/VerificationDetailPage.d.ts.map +1 -1
- package/dist/housingvista/pages/verification/VerificationDetailPage.js +25 -22
- package/dist/housingvista/pages/verification/VerificationDetailPage.js.map +1 -1
- package/dist/housingvista/pages/verification/VerificationPage.d.ts.map +1 -1
- package/dist/housingvista/pages/verification/VerificationPage.js +123 -121
- package/dist/housingvista/pages/verification/VerificationPage.js.map +1 -1
- package/dist/housingvista/pages/viewings/ViewingsPage.d.ts.map +1 -1
- package/dist/housingvista/pages/viewings/ViewingsPage.js +128 -126
- package/dist/housingvista/pages/viewings/ViewingsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { cn as e, formatCurrency as t, formatDate as n } from "../../utils/helpers.js";
|
|
2
2
|
import { StatCard as r } from "../../components/StatCard.js";
|
|
3
3
|
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
4
|
-
import { EmptyState as
|
|
5
|
-
import { ChartCard as
|
|
6
|
-
import { Breadcrumbs as
|
|
7
|
-
import { LoadingSkeleton as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { EmptyState as ee } from "../../components/EmptyState.js";
|
|
5
|
+
import { ChartCard as te } from "../../components/ChartCard.js";
|
|
6
|
+
import { Breadcrumbs as ne } from "../../components/Breadcrumbs.js";
|
|
7
|
+
import { LoadingSkeleton as re } from "../../components/LoadingSkeleton.js";
|
|
8
|
+
import { useTrackPageView as ie } from "../../hooks/useHousingVistaAnalytics.js";
|
|
9
|
+
import { useDeleteInvestment as ae, useInvestment as oe, useUpdateInvestment as se } from "../../hooks/index.js";
|
|
10
|
+
import { notify as a } from "../../lib/toast.js";
|
|
10
11
|
import "../../components/index.js";
|
|
11
|
-
import { Tooltip as
|
|
12
|
-
import { ResponsiveContainer as
|
|
13
|
-
import { CartesianGrid as
|
|
14
|
-
import { Area as
|
|
15
|
-
import { XAxis as
|
|
16
|
-
import { YAxis as
|
|
17
|
-
import { AreaChart as
|
|
18
|
-
import { useState as
|
|
19
|
-
import { ArrowDownRight as
|
|
20
|
-
import { useNavigate as
|
|
21
|
-
import { jsx as
|
|
22
|
-
import { Button as
|
|
12
|
+
import { Tooltip as ce } from "../../../node_modules/recharts/es6/component/Tooltip.js";
|
|
13
|
+
import { ResponsiveContainer as le } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
|
|
14
|
+
import { CartesianGrid as ue } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
|
|
15
|
+
import { Area as de } from "../../../node_modules/recharts/es6/cartesian/Area.js";
|
|
16
|
+
import { XAxis as fe } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
|
|
17
|
+
import { YAxis as pe } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
|
|
18
|
+
import { AreaChart as me } from "../../../node_modules/recharts/es6/chart/AreaChart.js";
|
|
19
|
+
import { useState as o } from "react";
|
|
20
|
+
import { ArrowDownRight as he, ArrowLeft as ge, ArrowUpRight as _e, BarChart3 as ve, Building as s, Calendar as ye, Clock as be, DollarSign as c, MapPin as xe, Percent as Se, Target as Ce, Trash2 as we, TrendingUp as Te, Users as Ee } from "lucide-react";
|
|
21
|
+
import { useNavigate as De, useParams as Oe } from "react-router-dom";
|
|
22
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
23
|
+
import { Button as d, EmphasisPanel as ke, NextSteps as Ae, PagePurpose as je, ResponsiveDialog as Me, ResponsiveDialogContent as f, ResponsiveDialogDescription as p, ResponsiveDialogFooter as m, ResponsiveDialogHeader as h, ResponsiveDialogTitle as Ne } from "@burdenoff/fe-libs/ui";
|
|
23
24
|
//#region src/housingvista/pages/investments/InvestmentDetailPage.tsx
|
|
24
|
-
var
|
|
25
|
+
var g = "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", Pe = [
|
|
25
26
|
{
|
|
26
27
|
value: "full_ownership",
|
|
27
28
|
label: "Full ownership"
|
|
@@ -38,7 +39,7 @@ var y = "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 t
|
|
|
38
39
|
value: "fund",
|
|
39
40
|
label: "Fund"
|
|
40
41
|
}
|
|
41
|
-
],
|
|
42
|
+
], Fe = [
|
|
42
43
|
{
|
|
43
44
|
value: "draft",
|
|
44
45
|
label: "Draft"
|
|
@@ -63,7 +64,7 @@ var y = "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 t
|
|
|
63
64
|
value: "closed",
|
|
64
65
|
label: "Closed"
|
|
65
66
|
}
|
|
66
|
-
],
|
|
67
|
+
], Ie = [
|
|
67
68
|
{
|
|
68
69
|
value: "low",
|
|
69
70
|
label: "Low"
|
|
@@ -77,39 +78,39 @@ var y = "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 t
|
|
|
77
78
|
label: "High"
|
|
78
79
|
}
|
|
79
80
|
];
|
|
80
|
-
function
|
|
81
|
+
function _(e) {
|
|
81
82
|
return typeof e == "object" && e ? e : {};
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
+
function v(e) {
|
|
84
85
|
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function y(e) {
|
|
87
88
|
return typeof e == "string" ? e : "";
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
+
function b(e) {
|
|
90
91
|
return e instanceof Date ? Number.isNaN(e.getTime()) ? "" : e.toISOString() : typeof e == "string" ? e : "";
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
let t =
|
|
93
|
+
function x(e) {
|
|
94
|
+
let t = b(e);
|
|
94
95
|
if (!t) return null;
|
|
95
96
|
let n = new Date(t).getTime();
|
|
96
97
|
return Number.isNaN(n) ? null : n;
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
-
let t =
|
|
99
|
+
function S(e) {
|
|
100
|
+
let t = b(e);
|
|
100
101
|
if (!t) return "—";
|
|
101
102
|
let r = new Date(t).getTime();
|
|
102
103
|
return Number.isNaN(r) ? "—" : n(t);
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
-
let t =
|
|
105
|
+
function Le(e) {
|
|
106
|
+
let t = x(e);
|
|
106
107
|
return t === null ? "" : new Date(t).toISOString().slice(0, 10);
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
-
let t =
|
|
110
|
-
return `${
|
|
109
|
+
function Re(e) {
|
|
110
|
+
let t = _(e);
|
|
111
|
+
return `${y(t.firstName)} ${y(t.lastName)}`.trim() || y(t.name) || y(t.email) || "Investor";
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
+
function ze(e) {
|
|
113
114
|
switch (e) {
|
|
114
115
|
case "active": return "success";
|
|
115
116
|
case "funding": return "warning";
|
|
@@ -120,49 +121,51 @@ function Ne(e) {
|
|
|
120
121
|
default: return "default";
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function C(e) {
|
|
124
125
|
return e > 0 ? "text-status-success-text" : e < 0 ? "text-status-error-text" : "text-text-secondary";
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
-
let { id: n } =
|
|
128
|
-
|
|
127
|
+
function w() {
|
|
128
|
+
let { id: n } = Oe();
|
|
129
|
+
ie("housingvista.investment.viewed", n);
|
|
130
|
+
let b = De(), { data: w, loading: Be } = oe(n), { updateInvestment: Ve, loading: T } = se(), { deleteInvestment: He, loading: E } = ae(), [D, O] = o("overview"), [Ue, k] = o(!1), [We, A] = o(!1), [j, M] = o(""), [N, P] = o("draft"), [F, I] = o("medium"), [L, R] = o("full_ownership"), [z, B] = o(""), [V, H] = o(""), [U, Ge] = o("");
|
|
131
|
+
if (Be) return /* @__PURE__ */ l("div", {
|
|
129
132
|
className: "flex flex-col gap-6 p-6",
|
|
130
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ l(re, { variant: "detail" })
|
|
131
134
|
});
|
|
132
|
-
if (!
|
|
135
|
+
if (!w) return /* @__PURE__ */ l("div", {
|
|
133
136
|
className: "flex flex-col gap-6 p-6",
|
|
134
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ l(ee, {
|
|
135
138
|
illustration: "empty-search",
|
|
136
|
-
icon: /* @__PURE__ */
|
|
139
|
+
icon: /* @__PURE__ */ l(s, { className: "h-16 w-16" }),
|
|
137
140
|
title: "Investment Not Found",
|
|
138
141
|
description: "The investment you're looking for doesn't exist or has been removed.",
|
|
139
|
-
action: /* @__PURE__ */
|
|
140
|
-
onClick: () =>
|
|
142
|
+
action: /* @__PURE__ */ u("button", {
|
|
143
|
+
onClick: () => b("../investments"),
|
|
141
144
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ l(ge, { className: "h-4 w-4" }), "Back to Investments"]
|
|
143
146
|
})
|
|
144
147
|
})
|
|
145
148
|
});
|
|
146
|
-
let
|
|
147
|
-
let t =
|
|
149
|
+
let W = (Array.isArray(w.investors) ? w.investors : []).map((e) => {
|
|
150
|
+
let t = _(e);
|
|
148
151
|
return {
|
|
149
|
-
name:
|
|
150
|
-
investmentAmount:
|
|
151
|
-
shares:
|
|
152
|
+
name: Re(t.user),
|
|
153
|
+
investmentAmount: v(t.investmentAmount),
|
|
154
|
+
shares: v(t.shares),
|
|
152
155
|
joinedAt: t.joinedAt
|
|
153
156
|
};
|
|
154
|
-
}),
|
|
155
|
-
let n =
|
|
157
|
+
}), G = (Array.isArray(w.returns) ? w.returns : []).map((e, t) => {
|
|
158
|
+
let n = _(e);
|
|
156
159
|
return {
|
|
157
|
-
id:
|
|
158
|
-
type:
|
|
159
|
-
amount:
|
|
160
|
+
id: y(n.id) || `return-${t}`,
|
|
161
|
+
type: y(n.type) || "return",
|
|
162
|
+
amount: v(n.amount),
|
|
160
163
|
date: n.date,
|
|
161
|
-
investorName:
|
|
164
|
+
investorName: Re(n.investor)
|
|
162
165
|
};
|
|
163
|
-
}), Ke =
|
|
164
|
-
ts:
|
|
165
|
-
label:
|
|
166
|
+
}), Ke = G.map((e) => ({
|
|
167
|
+
ts: x(e.date) ?? 0,
|
|
168
|
+
label: S(e.date),
|
|
166
169
|
amount: e.amount
|
|
167
170
|
})).sort((e, t) => e.ts - t.ts).reduce((e, t) => {
|
|
168
171
|
let n = e.length > 0 ? e[e.length - 1].cumulative : 0;
|
|
@@ -171,80 +174,80 @@ function k() {
|
|
|
171
174
|
amount: t.amount,
|
|
172
175
|
cumulative: n + t.amount
|
|
173
176
|
}), e;
|
|
174
|
-
}, []),
|
|
177
|
+
}, []), K = _(w.property), q = y(K.title) || "Investment", J = _(K.location), qe = y(K.type), Je = [y(J.city), y(J.state)].filter(Boolean), Ye = y(J.neighborhood), Y = W.reduce((e, t) => e + t.investmentAmount, 0), X = G.reduce((e, t) => e + t.amount, 0), Xe = Y + X, Ze = Y > 0 ? X / Y * 100 : 0, Qe = x(w.startDate), $e = x(w.maturityDate), et = Qe !== null && $e !== null ? Math.max(0, Math.round(($e - Qe) / (1e3 * 60 * 60 * 24 * 30))) : null, Z = y(w.riskLevel), Q = Z ? Z.charAt(0).toUpperCase() + Z.slice(1) : "Unknown", tt = y(w.investmentType).replace("_", " ") || "Investment", nt = [{
|
|
175
178
|
id: "overview",
|
|
176
179
|
label: "Overview",
|
|
177
|
-
icon:
|
|
180
|
+
icon: s
|
|
178
181
|
}, {
|
|
179
182
|
id: "returns",
|
|
180
183
|
label: "Returns History",
|
|
181
|
-
icon:
|
|
184
|
+
icon: ve
|
|
182
185
|
}], $ = () => {
|
|
183
|
-
|
|
184
|
-
let e =
|
|
185
|
-
|
|
186
|
+
M(y(w.title) || q), P(y(w.status) || "draft"), I(y(w.riskLevel) || "medium"), R(y(w.investmentType) || "full_ownership");
|
|
187
|
+
let e = v(w.totalValue);
|
|
188
|
+
B(e > 0 ? String(e) : ""), H(Le(w.startDate)), Ge(Le(w.maturityDate)), k(!0);
|
|
186
189
|
};
|
|
187
|
-
return /* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ u("div", {
|
|
188
191
|
className: "flex flex-col gap-6 p-6",
|
|
189
192
|
children: [
|
|
190
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ l(ne, { items: [{
|
|
191
194
|
label: "Investments",
|
|
192
195
|
href: "../investments"
|
|
193
|
-
}, { label:
|
|
194
|
-
/* @__PURE__ */
|
|
196
|
+
}, { label: q }] }),
|
|
197
|
+
/* @__PURE__ */ u("div", {
|
|
195
198
|
className: "flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",
|
|
196
|
-
children: [/* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
onClick: () =>
|
|
199
|
+
children: [/* @__PURE__ */ u("div", { children: [
|
|
200
|
+
/* @__PURE__ */ u("button", {
|
|
201
|
+
onClick: () => b("../investments"),
|
|
199
202
|
className: "mb-2 inline-flex items-center gap-2 rounded-md px-2 py-1 text-sm text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
203
|
+
children: [/* @__PURE__ */ l(ge, { className: "h-4 w-4" }), "Back to Investments"]
|
|
201
204
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ l("h1", {
|
|
203
206
|
className: "text-2xl font-semibold text-text-primary",
|
|
204
|
-
children:
|
|
207
|
+
children: q
|
|
205
208
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ u("div", {
|
|
207
210
|
className: "mt-2 flex flex-wrap items-center gap-2",
|
|
208
211
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
label:
|
|
211
|
-
variant:
|
|
212
|
+
/* @__PURE__ */ l(i, {
|
|
213
|
+
label: w.status,
|
|
214
|
+
variant: ze(w.status)
|
|
212
215
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
label:
|
|
216
|
+
/* @__PURE__ */ l(i, {
|
|
217
|
+
label: tt,
|
|
215
218
|
variant: "muted"
|
|
216
219
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ l(i, {
|
|
218
221
|
label: `${Q} Risk`,
|
|
219
222
|
variant: "muted"
|
|
220
223
|
})
|
|
221
224
|
]
|
|
222
225
|
})
|
|
223
|
-
] }), /* @__PURE__ */
|
|
226
|
+
] }), /* @__PURE__ */ u("div", {
|
|
224
227
|
className: "flex gap-3",
|
|
225
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ u("button", {
|
|
226
229
|
onClick: $,
|
|
227
230
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
229
|
-
}), /* @__PURE__ */
|
|
230
|
-
onClick: () =>
|
|
231
|
+
children: [/* @__PURE__ */ l(c, { className: "h-4 w-4" }), "Manage Investment"]
|
|
232
|
+
}), /* @__PURE__ */ u("button", {
|
|
233
|
+
onClick: () => A(!0),
|
|
231
234
|
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
235
|
+
children: [/* @__PURE__ */ l(we, { className: "h-4 w-4" }), "Delete"]
|
|
233
236
|
})]
|
|
234
237
|
})]
|
|
235
238
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ l(je, {
|
|
237
240
|
className: "max-w-3xl",
|
|
238
241
|
children: "A full breakdown of one investment — how much was put in, what it is worth today, every return paid out, and the co-investors. Use it to judge performance and decide whether to hold, add, or exit."
|
|
239
242
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ l(Ae, {
|
|
241
244
|
storageKey: "housingvista-investment-detail",
|
|
242
245
|
steps: [
|
|
243
246
|
{
|
|
244
247
|
id: "returns",
|
|
245
248
|
label: "Review returns history",
|
|
246
249
|
description: "See every distribution paid and the performance trend.",
|
|
247
|
-
onClick: () =>
|
|
250
|
+
onClick: () => O("returns")
|
|
248
251
|
},
|
|
249
252
|
{
|
|
250
253
|
id: "manage",
|
|
@@ -256,139 +259,139 @@ function k() {
|
|
|
256
259
|
id: "back",
|
|
257
260
|
label: "Back to all investments",
|
|
258
261
|
description: "Return to your full investment portfolio.",
|
|
259
|
-
onClick: () =>
|
|
262
|
+
onClick: () => b("../investments")
|
|
260
263
|
}
|
|
261
264
|
]
|
|
262
265
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ l(ke, {
|
|
264
267
|
className: "p-4",
|
|
265
|
-
children: /* @__PURE__ */
|
|
268
|
+
children: /* @__PURE__ */ u("div", {
|
|
266
269
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
267
270
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ l(r, {
|
|
269
272
|
label: "Invested Amount",
|
|
270
273
|
value: Y,
|
|
271
274
|
prefix: "$",
|
|
272
|
-
icon: /* @__PURE__ */
|
|
275
|
+
icon: /* @__PURE__ */ l(c, { className: "h-4 w-4" })
|
|
273
276
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ l(r, {
|
|
275
278
|
label: "Current Value",
|
|
276
|
-
value:
|
|
279
|
+
value: Xe,
|
|
277
280
|
prefix: "$",
|
|
278
|
-
icon: /* @__PURE__ */
|
|
281
|
+
icon: /* @__PURE__ */ l(Te, { className: "h-4 w-4" })
|
|
279
282
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ l(r, {
|
|
281
284
|
label: "Total Returns",
|
|
282
285
|
value: X,
|
|
283
286
|
prefix: "$",
|
|
284
|
-
icon: /* @__PURE__ */
|
|
287
|
+
icon: /* @__PURE__ */ l(Se, { className: "h-4 w-4" })
|
|
285
288
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ l(r, {
|
|
287
290
|
label: "Risk Level",
|
|
288
291
|
value: Q,
|
|
289
|
-
icon: /* @__PURE__ */
|
|
292
|
+
icon: /* @__PURE__ */ l(Ce, { className: "h-4 w-4" })
|
|
290
293
|
})
|
|
291
294
|
]
|
|
292
295
|
})
|
|
293
296
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ u("div", {
|
|
295
298
|
className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
|
|
296
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ l("div", {
|
|
297
300
|
className: "flex gap-0 border-b border-border-subtle",
|
|
298
|
-
children:
|
|
301
|
+
children: nt.map((t) => {
|
|
299
302
|
let n = t.icon;
|
|
300
|
-
return /* @__PURE__ */
|
|
301
|
-
onClick: () =>
|
|
302
|
-
className: e("flex items-center gap-2 border-b-2 px-4 py-3 text-sm font-medium transition-colors",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ u("button", {
|
|
304
|
+
onClick: () => O(t.id),
|
|
305
|
+
className: e("flex items-center gap-2 border-b-2 px-4 py-3 text-sm font-medium transition-colors", D === t.id ? "border-action-primary-border text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
|
|
306
|
+
children: [/* @__PURE__ */ l(n, { className: "h-4 w-4" }), t.label]
|
|
304
307
|
}, t.id);
|
|
305
308
|
})
|
|
306
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ u("div", {
|
|
307
310
|
className: "p-6",
|
|
308
|
-
children: [
|
|
311
|
+
children: [D === "overview" && /* @__PURE__ */ u("div", {
|
|
309
312
|
className: "space-y-6",
|
|
310
313
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", {
|
|
312
315
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
313
316
|
children: "Investment Details"
|
|
314
|
-
}), /* @__PURE__ */
|
|
317
|
+
}), /* @__PURE__ */ u("div", {
|
|
315
318
|
className: "rounded-lg bg-bg-sunken/50 p-4 space-y-3",
|
|
316
319
|
children: [
|
|
317
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ u("div", {
|
|
318
321
|
className: "flex justify-between",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ l("span", {
|
|
320
323
|
className: "text-text-secondary",
|
|
321
324
|
children: "Investment Type"
|
|
322
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ l("span", {
|
|
323
326
|
className: "font-medium capitalize text-text-primary",
|
|
324
|
-
children:
|
|
327
|
+
children: tt
|
|
325
328
|
})]
|
|
326
329
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ u("div", {
|
|
328
331
|
className: "flex justify-between",
|
|
329
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ l("span", {
|
|
330
333
|
className: "text-text-secondary",
|
|
331
334
|
children: "Property"
|
|
332
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ l("span", {
|
|
333
336
|
className: "font-medium text-text-primary",
|
|
334
|
-
children:
|
|
337
|
+
children: q
|
|
335
338
|
})]
|
|
336
339
|
}),
|
|
337
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ u("div", {
|
|
338
341
|
className: "flex justify-between",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ l("span", {
|
|
340
343
|
className: "text-text-secondary",
|
|
341
344
|
children: "Total Property Value"
|
|
342
|
-
}), /* @__PURE__ */
|
|
345
|
+
}), /* @__PURE__ */ l("span", {
|
|
343
346
|
className: "font-medium text-text-primary",
|
|
344
|
-
children: t(
|
|
347
|
+
children: t(v(w.totalValue))
|
|
345
348
|
})]
|
|
346
349
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ u("div", {
|
|
348
351
|
className: "flex justify-between",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ l("span", {
|
|
350
353
|
className: "text-text-secondary",
|
|
351
354
|
children: "Risk Level"
|
|
352
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ l("span", {
|
|
353
356
|
className: "font-medium capitalize text-text-primary",
|
|
354
357
|
children: Q
|
|
355
358
|
})]
|
|
356
359
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ u("div", {
|
|
358
361
|
className: "flex justify-between",
|
|
359
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ l("span", {
|
|
360
363
|
className: "text-text-secondary",
|
|
361
364
|
children: "Start Date"
|
|
362
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ l("span", {
|
|
363
366
|
className: "font-medium text-text-primary",
|
|
364
|
-
children:
|
|
367
|
+
children: S(w.startDate)
|
|
365
368
|
})]
|
|
366
369
|
}),
|
|
367
|
-
|
|
370
|
+
w.maturityDate && /* @__PURE__ */ u("div", {
|
|
368
371
|
className: "flex justify-between",
|
|
369
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ l("span", {
|
|
370
373
|
className: "text-text-secondary",
|
|
371
374
|
children: "Maturity Date"
|
|
372
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ l("span", {
|
|
373
376
|
className: "font-medium text-text-primary",
|
|
374
|
-
children:
|
|
377
|
+
children: S(w.maturityDate)
|
|
375
378
|
})]
|
|
376
379
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ u("div", {
|
|
378
381
|
className: "flex justify-between border-t border-border-subtle pt-3",
|
|
379
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ l("span", {
|
|
380
383
|
className: "font-medium text-text-secondary",
|
|
381
384
|
children: "Total Return"
|
|
382
|
-
}), /* @__PURE__ */
|
|
383
|
-
className: e("font-bold",
|
|
384
|
-
children: /* @__PURE__ */
|
|
385
|
+
}), /* @__PURE__ */ l("div", {
|
|
386
|
+
className: e("font-bold", C(X)),
|
|
387
|
+
children: /* @__PURE__ */ u("div", {
|
|
385
388
|
className: "flex items-center gap-1",
|
|
386
389
|
children: [
|
|
387
|
-
X > 0 && /* @__PURE__ */
|
|
388
|
-
X < 0 && /* @__PURE__ */
|
|
390
|
+
X > 0 && /* @__PURE__ */ l(_e, { className: "h-4 w-4" }),
|
|
391
|
+
X < 0 && /* @__PURE__ */ l(he, { className: "h-4 w-4" }),
|
|
389
392
|
t(X),
|
|
390
393
|
" (",
|
|
391
|
-
|
|
394
|
+
Ze.toFixed(1),
|
|
392
395
|
"%)"
|
|
393
396
|
]
|
|
394
397
|
})
|
|
@@ -396,157 +399,157 @@ function k() {
|
|
|
396
399
|
})
|
|
397
400
|
]
|
|
398
401
|
})] }),
|
|
399
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", {
|
|
400
403
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
401
404
|
children: "Property Information"
|
|
402
|
-
}), /* @__PURE__ */
|
|
405
|
+
}), /* @__PURE__ */ u("div", {
|
|
403
406
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
404
407
|
children: [
|
|
405
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ u("div", {
|
|
406
409
|
className: "rounded-lg bg-bg-sunken/50 p-4",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ u("div", {
|
|
408
411
|
className: "mb-1 flex items-center gap-2 text-sm text-text-secondary",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
410
|
-
}), /* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ l(s, { className: "h-4 w-4" }), "Property Type"]
|
|
413
|
+
}), /* @__PURE__ */ l("div", {
|
|
411
414
|
className: "font-semibold capitalize text-text-primary",
|
|
412
|
-
children:
|
|
415
|
+
children: qe ? qe.replace("_", " ") : "Not specified"
|
|
413
416
|
})]
|
|
414
417
|
}),
|
|
415
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ u("div", {
|
|
416
419
|
className: "rounded-lg bg-bg-sunken/50 p-4",
|
|
417
420
|
children: [
|
|
418
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ u("div", {
|
|
419
422
|
className: "mb-1 flex items-center gap-2 text-sm text-text-secondary",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ l(xe, { className: "h-4 w-4" }), "Location"]
|
|
421
424
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ l("div", {
|
|
423
426
|
className: "font-semibold text-text-primary",
|
|
424
|
-
children:
|
|
427
|
+
children: Je.length > 0 ? Je.join(", ") : "Location not available"
|
|
425
428
|
}),
|
|
426
|
-
|
|
429
|
+
Ye && /* @__PURE__ */ l("div", {
|
|
427
430
|
className: "text-sm text-text-secondary",
|
|
428
|
-
children:
|
|
431
|
+
children: Ye
|
|
429
432
|
})
|
|
430
433
|
]
|
|
431
434
|
}),
|
|
432
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ u("div", {
|
|
433
436
|
className: "rounded-lg bg-bg-sunken/50 p-4",
|
|
434
|
-
children: [/* @__PURE__ */
|
|
437
|
+
children: [/* @__PURE__ */ u("div", {
|
|
435
438
|
className: "mb-1 flex items-center gap-2 text-sm text-text-secondary",
|
|
436
|
-
children: [/* @__PURE__ */
|
|
437
|
-
}), /* @__PURE__ */
|
|
439
|
+
children: [/* @__PURE__ */ l(ye, { className: "h-4 w-4" }), "Start Date"]
|
|
440
|
+
}), /* @__PURE__ */ l("div", {
|
|
438
441
|
className: "font-semibold text-text-primary",
|
|
439
|
-
children:
|
|
442
|
+
children: S(w.startDate)
|
|
440
443
|
})]
|
|
441
444
|
}),
|
|
442
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ u("div", {
|
|
443
446
|
className: "rounded-lg bg-bg-sunken/50 p-4",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
447
|
+
children: [/* @__PURE__ */ u("div", {
|
|
445
448
|
className: "mb-1 flex items-center gap-2 text-sm text-text-secondary",
|
|
446
|
-
children: [/* @__PURE__ */
|
|
447
|
-
}), /* @__PURE__ */
|
|
449
|
+
children: [/* @__PURE__ */ l(be, { className: "h-4 w-4" }), "Duration"]
|
|
450
|
+
}), /* @__PURE__ */ l("div", {
|
|
448
451
|
className: "font-semibold text-text-primary",
|
|
449
|
-
children:
|
|
452
|
+
children: et === null ? "Ongoing" : `${et} months`
|
|
450
453
|
})]
|
|
451
454
|
})
|
|
452
455
|
]
|
|
453
456
|
})] }),
|
|
454
|
-
|
|
457
|
+
W.length > 0 && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("h3", {
|
|
455
458
|
className: "mb-4 flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
456
459
|
children: [
|
|
457
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ l(Ee, { className: "h-5 w-5" }),
|
|
458
461
|
"Investors (",
|
|
459
|
-
|
|
462
|
+
W.length,
|
|
460
463
|
")"
|
|
461
464
|
]
|
|
462
|
-
}), /* @__PURE__ */
|
|
465
|
+
}), /* @__PURE__ */ l("div", {
|
|
463
466
|
className: "space-y-2",
|
|
464
|
-
children:
|
|
467
|
+
children: W.map((e, n) => /* @__PURE__ */ u("div", {
|
|
465
468
|
className: "flex items-center justify-between rounded-lg bg-bg-sunken/50 p-4",
|
|
466
|
-
children: [/* @__PURE__ */
|
|
469
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("div", {
|
|
467
470
|
className: "font-medium text-text-primary",
|
|
468
471
|
children: e.name
|
|
469
|
-
}), /* @__PURE__ */
|
|
472
|
+
}), /* @__PURE__ */ u("div", {
|
|
470
473
|
className: "text-sm text-text-secondary",
|
|
471
474
|
children: ["Invested: ", t(e.investmentAmount)]
|
|
472
|
-
})] }), /* @__PURE__ */
|
|
475
|
+
})] }), /* @__PURE__ */ u("div", {
|
|
473
476
|
className: "text-right",
|
|
474
|
-
children: [/* @__PURE__ */
|
|
477
|
+
children: [/* @__PURE__ */ u("div", {
|
|
475
478
|
className: "font-semibold text-text-primary",
|
|
476
479
|
children: [e.shares, "% share"]
|
|
477
|
-
}), /* @__PURE__ */
|
|
480
|
+
}), /* @__PURE__ */ u("div", {
|
|
478
481
|
className: "text-sm text-text-secondary",
|
|
479
|
-
children: ["Joined: ",
|
|
482
|
+
children: ["Joined: ", S(e.joinedAt)]
|
|
480
483
|
})]
|
|
481
484
|
})]
|
|
482
485
|
}, n))
|
|
483
486
|
})] })
|
|
484
487
|
]
|
|
485
|
-
}),
|
|
488
|
+
}), D === "returns" && /* @__PURE__ */ u("div", {
|
|
486
489
|
className: "space-y-6",
|
|
487
|
-
children: [/* @__PURE__ */
|
|
490
|
+
children: [/* @__PURE__ */ u("div", {
|
|
488
491
|
className: "flex items-center justify-between",
|
|
489
|
-
children: [/* @__PURE__ */
|
|
492
|
+
children: [/* @__PURE__ */ l("h3", {
|
|
490
493
|
className: "text-lg font-semibold text-text-primary",
|
|
491
494
|
children: "Returns History"
|
|
492
|
-
}), /* @__PURE__ */
|
|
495
|
+
}), /* @__PURE__ */ u("div", {
|
|
493
496
|
className: "text-right",
|
|
494
|
-
children: [/* @__PURE__ */
|
|
497
|
+
children: [/* @__PURE__ */ l("div", {
|
|
495
498
|
className: "text-sm text-text-secondary",
|
|
496
499
|
children: "Total Returns"
|
|
497
|
-
}), /* @__PURE__ */
|
|
498
|
-
className: e("text-2xl font-bold",
|
|
500
|
+
}), /* @__PURE__ */ l("div", {
|
|
501
|
+
className: e("text-2xl font-bold", C(X)),
|
|
499
502
|
children: t(X)
|
|
500
503
|
})]
|
|
501
504
|
})]
|
|
502
|
-
}),
|
|
505
|
+
}), G.length > 0 ? /* @__PURE__ */ u("div", {
|
|
503
506
|
className: "space-y-6",
|
|
504
|
-
children: [/* @__PURE__ */
|
|
507
|
+
children: [/* @__PURE__ */ l(te, {
|
|
505
508
|
title: "Performance Over Time",
|
|
506
509
|
description: "Cumulative returns paid out over time",
|
|
507
|
-
children: /* @__PURE__ */
|
|
510
|
+
children: /* @__PURE__ */ l("div", {
|
|
508
511
|
className: "h-64",
|
|
509
|
-
children: /* @__PURE__ */
|
|
512
|
+
children: /* @__PURE__ */ l(le, {
|
|
510
513
|
width: "100%",
|
|
511
514
|
height: "100%",
|
|
512
|
-
children: /* @__PURE__ */
|
|
515
|
+
children: /* @__PURE__ */ u(me, {
|
|
513
516
|
data: Ke,
|
|
514
517
|
children: [
|
|
515
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ l("defs", { children: /* @__PURE__ */ u("linearGradient", {
|
|
516
519
|
id: "returnsGrad",
|
|
517
520
|
x1: "0",
|
|
518
521
|
y1: "0",
|
|
519
522
|
x2: "0",
|
|
520
523
|
y2: "1",
|
|
521
|
-
children: [/* @__PURE__ */
|
|
524
|
+
children: [/* @__PURE__ */ l("stop", {
|
|
522
525
|
offset: "5%",
|
|
523
526
|
stopColor: "var(--color-chart-1)",
|
|
524
527
|
stopOpacity: .3
|
|
525
|
-
}), /* @__PURE__ */
|
|
528
|
+
}), /* @__PURE__ */ l("stop", {
|
|
526
529
|
offset: "95%",
|
|
527
530
|
stopColor: "var(--color-chart-1)",
|
|
528
531
|
stopOpacity: 0
|
|
529
532
|
})]
|
|
530
533
|
}) }),
|
|
531
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ l(ue, {
|
|
532
535
|
strokeDasharray: "3 3",
|
|
533
536
|
className: "stroke-border"
|
|
534
537
|
}),
|
|
535
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ l(fe, {
|
|
536
539
|
dataKey: "label",
|
|
537
540
|
tick: { fontSize: 11 },
|
|
538
541
|
className: "text-text-secondary"
|
|
539
542
|
}),
|
|
540
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ l(pe, {
|
|
541
544
|
tick: { fontSize: 11 },
|
|
542
545
|
tickFormatter: (e) => `$${(e / 1e3).toFixed(0)}K`,
|
|
543
546
|
className: "text-text-secondary"
|
|
544
547
|
}),
|
|
545
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ l(ce, {
|
|
546
549
|
formatter: (e) => [t(e), "Cumulative returns"],
|
|
547
550
|
labelClassName: "text-text-primary"
|
|
548
551
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ l(de, {
|
|
550
553
|
type: "monotone",
|
|
551
554
|
dataKey: "cumulative",
|
|
552
555
|
stroke: "var(--color-chart-1)",
|
|
@@ -557,29 +560,29 @@ function k() {
|
|
|
557
560
|
})
|
|
558
561
|
})
|
|
559
562
|
})
|
|
560
|
-
}), /* @__PURE__ */
|
|
563
|
+
}), /* @__PURE__ */ l("div", {
|
|
561
564
|
className: "space-y-3",
|
|
562
|
-
children:
|
|
565
|
+
children: G.map((e) => /* @__PURE__ */ u("div", {
|
|
563
566
|
className: "flex items-center justify-between rounded-lg bg-bg-sunken/50 p-4",
|
|
564
|
-
children: [/* @__PURE__ */
|
|
567
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("div", {
|
|
565
568
|
className: "font-medium capitalize text-text-primary",
|
|
566
569
|
children: e.type
|
|
567
|
-
}), /* @__PURE__ */
|
|
570
|
+
}), /* @__PURE__ */ l("div", {
|
|
568
571
|
className: "text-sm text-text-secondary",
|
|
569
|
-
children:
|
|
570
|
-
})] }), /* @__PURE__ */
|
|
572
|
+
children: S(e.date)
|
|
573
|
+
})] }), /* @__PURE__ */ u("div", {
|
|
571
574
|
className: "text-right",
|
|
572
|
-
children: [/* @__PURE__ */
|
|
575
|
+
children: [/* @__PURE__ */ u("div", {
|
|
573
576
|
className: "font-bold text-status-success-text",
|
|
574
577
|
children: ["+", t(e.amount)]
|
|
575
|
-
}), /* @__PURE__ */
|
|
578
|
+
}), /* @__PURE__ */ l("div", {
|
|
576
579
|
className: "text-sm text-text-secondary",
|
|
577
580
|
children: e.investorName
|
|
578
581
|
})]
|
|
579
582
|
})]
|
|
580
583
|
}, e.id))
|
|
581
584
|
})]
|
|
582
|
-
}) : /* @__PURE__ */
|
|
585
|
+
}) : /* @__PURE__ */ l(ee, {
|
|
583
586
|
illustration: "empty-data",
|
|
584
587
|
title: "No returns recorded yet",
|
|
585
588
|
description: "Returns will appear here once distributions are made."
|
|
@@ -587,166 +590,166 @@ function k() {
|
|
|
587
590
|
})]
|
|
588
591
|
})]
|
|
589
592
|
}),
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
-
open:
|
|
592
|
-
onOpenChange:
|
|
593
|
-
children: /* @__PURE__ */
|
|
593
|
+
/* @__PURE__ */ l(Me, {
|
|
594
|
+
open: Ue,
|
|
595
|
+
onOpenChange: k,
|
|
596
|
+
children: /* @__PURE__ */ l(f, {
|
|
594
597
|
className: "sm:max-w-md",
|
|
595
|
-
children: /* @__PURE__ */
|
|
598
|
+
children: /* @__PURE__ */ u("form", {
|
|
596
599
|
onSubmit: async (e) => {
|
|
597
600
|
if (e.preventDefault(), !n) return;
|
|
598
|
-
if (!
|
|
599
|
-
|
|
601
|
+
if (!j.trim()) {
|
|
602
|
+
a.warning("Enter an investment title");
|
|
600
603
|
return;
|
|
601
604
|
}
|
|
602
|
-
let t = Number(
|
|
605
|
+
let t = Number(z);
|
|
603
606
|
if (!Number.isFinite(t) || t <= 0) {
|
|
604
|
-
|
|
607
|
+
a.warning("Enter a valid total value");
|
|
605
608
|
return;
|
|
606
609
|
}
|
|
607
610
|
try {
|
|
608
|
-
await
|
|
609
|
-
title:
|
|
610
|
-
status:
|
|
611
|
-
riskLevel:
|
|
612
|
-
investmentType:
|
|
611
|
+
await Ve(n, {
|
|
612
|
+
title: j.trim(),
|
|
613
|
+
status: N,
|
|
614
|
+
riskLevel: F,
|
|
615
|
+
investmentType: L,
|
|
613
616
|
totalValue: t,
|
|
614
617
|
startDate: V ? new Date(V).toISOString() : void 0,
|
|
615
|
-
maturityDate:
|
|
616
|
-
}),
|
|
618
|
+
maturityDate: U ? new Date(U).toISOString() : void 0
|
|
619
|
+
}), a.success("Investment updated", `${j.trim()} was saved.`), k(!1);
|
|
617
620
|
} catch (e) {
|
|
618
|
-
|
|
621
|
+
a.error("Could not update investment", e.message);
|
|
619
622
|
}
|
|
620
623
|
},
|
|
621
624
|
children: [
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ u(h, { children: [/* @__PURE__ */ l(Ne, { children: "Manage investment" }), /* @__PURE__ */ l(p, { children: "Update the details of this holding. Changes apply immediately." })] }),
|
|
626
|
+
/* @__PURE__ */ u("div", {
|
|
624
627
|
className: "space-y-3 py-2",
|
|
625
628
|
children: [
|
|
626
|
-
/* @__PURE__ */
|
|
629
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
627
630
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
628
631
|
children: "Title *"
|
|
629
|
-
}), /* @__PURE__ */
|
|
632
|
+
}), /* @__PURE__ */ l("input", {
|
|
630
633
|
type: "text",
|
|
631
634
|
required: !0,
|
|
632
|
-
value:
|
|
633
|
-
onChange: (e) =>
|
|
634
|
-
className:
|
|
635
|
+
value: j,
|
|
636
|
+
onChange: (e) => M(e.target.value),
|
|
637
|
+
className: g
|
|
635
638
|
})] }),
|
|
636
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ u("div", {
|
|
637
640
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
638
|
-
children: [/* @__PURE__ */
|
|
641
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
639
642
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
640
643
|
children: "Type"
|
|
641
|
-
}), /* @__PURE__ */
|
|
642
|
-
value:
|
|
643
|
-
onChange: (e) =>
|
|
644
|
-
className:
|
|
645
|
-
children:
|
|
644
|
+
}), /* @__PURE__ */ l("select", {
|
|
645
|
+
value: L,
|
|
646
|
+
onChange: (e) => R(e.target.value),
|
|
647
|
+
className: g,
|
|
648
|
+
children: Pe.map((e) => /* @__PURE__ */ l("option", {
|
|
646
649
|
value: e.value,
|
|
647
650
|
children: e.label
|
|
648
651
|
}, e.value))
|
|
649
|
-
})] }), /* @__PURE__ */
|
|
652
|
+
})] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
650
653
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
651
654
|
children: "Status"
|
|
652
|
-
}), /* @__PURE__ */
|
|
653
|
-
value:
|
|
654
|
-
onChange: (e) =>
|
|
655
|
-
className:
|
|
656
|
-
children:
|
|
655
|
+
}), /* @__PURE__ */ l("select", {
|
|
656
|
+
value: N,
|
|
657
|
+
onChange: (e) => P(e.target.value),
|
|
658
|
+
className: g,
|
|
659
|
+
children: Fe.map((e) => /* @__PURE__ */ l("option", {
|
|
657
660
|
value: e.value,
|
|
658
661
|
children: e.label
|
|
659
662
|
}, e.value))
|
|
660
663
|
})] })]
|
|
661
664
|
}),
|
|
662
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ u("div", {
|
|
663
666
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
664
|
-
children: [/* @__PURE__ */
|
|
667
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
665
668
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
666
669
|
children: "Risk level"
|
|
667
|
-
}), /* @__PURE__ */
|
|
668
|
-
value:
|
|
669
|
-
onChange: (e) =>
|
|
670
|
-
className:
|
|
671
|
-
children:
|
|
670
|
+
}), /* @__PURE__ */ l("select", {
|
|
671
|
+
value: F,
|
|
672
|
+
onChange: (e) => I(e.target.value),
|
|
673
|
+
className: g,
|
|
674
|
+
children: Ie.map((e) => /* @__PURE__ */ l("option", {
|
|
672
675
|
value: e.value,
|
|
673
676
|
children: e.label
|
|
674
677
|
}, e.value))
|
|
675
|
-
})] }), /* @__PURE__ */
|
|
678
|
+
})] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
676
679
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
677
680
|
children: "Total value (USD) *"
|
|
678
|
-
}), /* @__PURE__ */
|
|
681
|
+
}), /* @__PURE__ */ l("input", {
|
|
679
682
|
type: "number",
|
|
680
683
|
required: !0,
|
|
681
684
|
min: 1,
|
|
682
685
|
step: "any",
|
|
683
|
-
value:
|
|
684
|
-
onChange: (e) =>
|
|
685
|
-
className:
|
|
686
|
+
value: z,
|
|
687
|
+
onChange: (e) => B(e.target.value),
|
|
688
|
+
className: g
|
|
686
689
|
})] })]
|
|
687
690
|
}),
|
|
688
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ u("div", {
|
|
689
692
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
690
|
-
children: [/* @__PURE__ */
|
|
693
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
691
694
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
692
695
|
children: "Start date"
|
|
693
|
-
}), /* @__PURE__ */
|
|
696
|
+
}), /* @__PURE__ */ l("input", {
|
|
694
697
|
type: "date",
|
|
695
698
|
value: V,
|
|
696
|
-
onChange: (e) =>
|
|
697
|
-
className:
|
|
698
|
-
})] }), /* @__PURE__ */
|
|
699
|
+
onChange: (e) => H(e.target.value),
|
|
700
|
+
className: g
|
|
701
|
+
})] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
699
702
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
700
703
|
children: "Maturity date"
|
|
701
|
-
}), /* @__PURE__ */
|
|
704
|
+
}), /* @__PURE__ */ l("input", {
|
|
702
705
|
type: "date",
|
|
703
|
-
value:
|
|
706
|
+
value: U,
|
|
704
707
|
onChange: (e) => Ge(e.target.value),
|
|
705
|
-
className:
|
|
708
|
+
className: g
|
|
706
709
|
})] })]
|
|
707
710
|
})
|
|
708
711
|
]
|
|
709
712
|
}),
|
|
710
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ u(m, { children: [/* @__PURE__ */ l(d, {
|
|
711
714
|
type: "button",
|
|
712
715
|
variant: "outline",
|
|
713
|
-
onClick: () =>
|
|
716
|
+
onClick: () => k(!1),
|
|
714
717
|
children: "Cancel"
|
|
715
|
-
}), /* @__PURE__ */
|
|
718
|
+
}), /* @__PURE__ */ l(d, {
|
|
716
719
|
type: "submit",
|
|
717
|
-
disabled:
|
|
718
|
-
children:
|
|
720
|
+
disabled: T || !j.trim() || !z,
|
|
721
|
+
children: T ? "Saving…" : "Save changes"
|
|
719
722
|
})] })
|
|
720
723
|
]
|
|
721
724
|
})
|
|
722
725
|
})
|
|
723
726
|
}),
|
|
724
|
-
/* @__PURE__ */
|
|
725
|
-
open:
|
|
726
|
-
onOpenChange:
|
|
727
|
-
children: /* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ l(Me, {
|
|
728
|
+
open: We,
|
|
729
|
+
onOpenChange: A,
|
|
730
|
+
children: /* @__PURE__ */ u(f, {
|
|
728
731
|
className: "sm:max-w-sm",
|
|
729
|
-
children: [/* @__PURE__ */
|
|
732
|
+
children: [/* @__PURE__ */ u(h, { children: [/* @__PURE__ */ l(Ne, { children: "Delete investment?" }), /* @__PURE__ */ u(p, { children: [
|
|
730
733
|
"This permanently removes “",
|
|
731
|
-
|
|
734
|
+
q,
|
|
732
735
|
"” from your portfolio. This action cannot be undone."
|
|
733
|
-
] })] }), /* @__PURE__ */
|
|
736
|
+
] })] }), /* @__PURE__ */ u(m, { children: [/* @__PURE__ */ l(d, {
|
|
734
737
|
type: "button",
|
|
735
738
|
variant: "outline",
|
|
736
|
-
onClick: () =>
|
|
739
|
+
onClick: () => A(!1),
|
|
737
740
|
children: "Cancel"
|
|
738
|
-
}), /* @__PURE__ */
|
|
741
|
+
}), /* @__PURE__ */ l(d, {
|
|
739
742
|
type: "button",
|
|
740
743
|
variant: "destructive",
|
|
741
744
|
onClick: async () => {
|
|
742
745
|
if (n) try {
|
|
743
|
-
await
|
|
746
|
+
await He(n), a.success("Investment deleted"), A(!1), b("../investments");
|
|
744
747
|
} catch (e) {
|
|
745
|
-
|
|
748
|
+
a.error("Could not delete investment", e.message);
|
|
746
749
|
}
|
|
747
750
|
},
|
|
748
|
-
disabled:
|
|
749
|
-
children:
|
|
751
|
+
disabled: E,
|
|
752
|
+
children: E ? "Deleting…" : "Delete investment"
|
|
750
753
|
})] })]
|
|
751
754
|
})
|
|
752
755
|
})
|
|
@@ -754,6 +757,6 @@ function k() {
|
|
|
754
757
|
});
|
|
755
758
|
}
|
|
756
759
|
//#endregion
|
|
757
|
-
export {
|
|
760
|
+
export { w as InvestmentDetailPage };
|
|
758
761
|
|
|
759
762
|
//# sourceMappingURL=InvestmentDetailPage.js.map
|