@burdenoff/microfe-kadaikodi 2026.704.4 → 2026.704.5
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/kadaikodi/KadaikodiRoutes.js +30 -26
- package/dist/kadaikodi/KadaikodiRoutes.js.map +1 -1
- package/dist/kadaikodi/components/viz/AllocationBar.js +68 -0
- package/dist/kadaikodi/components/viz/AllocationBar.js.map +1 -0
- package/dist/kadaikodi/components/viz/AreaChart.js +102 -0
- package/dist/kadaikodi/components/viz/AreaChart.js.map +1 -0
- package/dist/kadaikodi/components/viz/AvatarStack.js +36 -0
- package/dist/kadaikodi/components/viz/AvatarStack.js.map +1 -0
- package/dist/kadaikodi/components/viz/BarChart.js +83 -0
- package/dist/kadaikodi/components/viz/BarChart.js.map +1 -0
- package/dist/kadaikodi/components/viz/CertificateCard.js +4 -0
- package/dist/kadaikodi/components/viz/DonutChart.js +109 -0
- package/dist/kadaikodi/components/viz/DonutChart.js.map +1 -0
- package/dist/kadaikodi/components/viz/HBarFunnel.js +54 -0
- package/dist/kadaikodi/components/viz/HBarFunnel.js.map +1 -0
- package/dist/kadaikodi/components/viz/Heatmap.js +3 -0
- package/dist/kadaikodi/components/viz/KanbanBoard.js +50 -0
- package/dist/kadaikodi/components/viz/KanbanBoard.js.map +1 -0
- package/dist/kadaikodi/components/viz/LineChart.js +4 -0
- package/dist/kadaikodi/components/viz/OrgTree.js +2 -0
- package/dist/kadaikodi/components/viz/PathSteps.js +3 -0
- package/dist/kadaikodi/components/viz/ProgressRing.js +68 -0
- package/dist/kadaikodi/components/viz/ProgressRing.js.map +1 -0
- package/dist/kadaikodi/components/viz/RatingStars.js +51 -0
- package/dist/kadaikodi/components/viz/RatingStars.js.map +1 -0
- package/dist/kadaikodi/components/viz/SegmentedTabs.js +69 -0
- package/dist/kadaikodi/components/viz/SegmentedTabs.js.map +1 -0
- package/dist/kadaikodi/components/viz/SkillBar.js +3 -0
- package/dist/kadaikodi/components/viz/Sparkline.js +74 -0
- package/dist/kadaikodi/components/viz/Sparkline.js.map +1 -0
- package/dist/kadaikodi/components/viz/StatCard.js +60 -0
- package/dist/kadaikodi/components/viz/StatCard.js.map +1 -0
- package/dist/kadaikodi/components/viz/StepProgress.js +64 -0
- package/dist/kadaikodi/components/viz/StepProgress.js.map +1 -0
- package/dist/kadaikodi/components/viz/Timeline.js +66 -0
- package/dist/kadaikodi/components/viz/Timeline.js.map +1 -0
- package/dist/kadaikodi/components/viz/index.js +23 -0
- package/dist/kadaikodi/components/viz/lib/Avatar.js +30 -0
- package/dist/kadaikodi/components/viz/lib/Avatar.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/CartesianFrame.js +119 -0
- package/dist/kadaikodi/components/viz/lib/CartesianFrame.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/ResponsiveSvg.js +35 -0
- package/dist/kadaikodi/components/viz/lib/ResponsiveSvg.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/format.js +21 -0
- package/dist/kadaikodi/components/viz/lib/format.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/geometry.js +61 -0
- package/dist/kadaikodi/components/viz/lib/geometry.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/hooks.js +39 -0
- package/dist/kadaikodi/components/viz/lib/hooks.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/palette.js +27 -0
- package/dist/kadaikodi/components/viz/lib/palette.js.map +1 -0
- package/dist/kadaikodi/hooks/useKadaikodiApi.js +18 -10
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/HomePage.js +373 -631
- package/dist/kadaikodi/pages/HomePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +304 -169
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminDashboard.js +255 -271
- package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +185 -125
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +141 -102
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/CartManagementPage.js +558 -718
- package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +142 -55
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +129 -164
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +379 -361
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js +266 -166
- package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js +373 -0
- package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js.map +1 -0
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +288 -161
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +180 -181
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +17 -34
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDetailPage.js +405 -248
- package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +258 -232
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CheckoutPage.js +254 -205
- package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js +270 -230
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/FavoritesPage.js +149 -412
- package/dist/kadaikodi/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js +173 -134
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +176 -175
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/ReviewsPage.js +295 -438
- package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/shared.js +181 -0
- package/dist/kadaikodi/pages/customer/shared.js.map +1 -0
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +438 -311
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +320 -293
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js +159 -91
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js +137 -107
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +157 -135
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js +280 -206
- package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +424 -448
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js +328 -445
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +141 -164
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +300 -296
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +284 -309
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,252 +1,326 @@
|
|
|
1
1
|
import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
4
|
+
import { EmptyState as r } from "../../components/EmptyState.js";
|
|
5
|
+
import { useInvestments as i } from "../../hooks/useKadaikodiApi.js";
|
|
6
|
+
import { formatCurrency as a, formatDate as o } from "../../utils/formatters.js";
|
|
7
|
+
import { MetricsCard as s } from "../../components/MetricsCard.js";
|
|
8
|
+
import { AreaChart as c } from "../../components/viz/AreaChart.js";
|
|
9
|
+
import { DonutChart as l } from "../../components/viz/DonutChart.js";
|
|
10
|
+
import "../../components/viz/index.js";
|
|
11
|
+
import { useMemo as u } from "react";
|
|
12
|
+
import { Briefcase as d, CheckCircle2 as f, Download as p, Eye as m, IndianRupee as h, TrendingUp as g, Wallet as _ } from "lucide-react";
|
|
13
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
14
|
+
import { EmphasisPanel as x, GlassCard as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
|
|
12
15
|
//#region src/kadaikodi/pages/investor/InvestorPortfolioPage.tsx
|
|
13
|
-
function
|
|
16
|
+
function w(e) {
|
|
14
17
|
return `${e > 0 ? "+" : ""}${e.toFixed(1)}%`;
|
|
15
18
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
function T(e) {
|
|
20
|
+
return a(e, {
|
|
21
|
+
minimumFractionDigits: 0,
|
|
22
|
+
notation: "compact"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function E() {
|
|
26
|
+
let { navigateTo: E, currentUser: D } = e(), { data: O = [], isLoading: k } = i(D?.id || ""), A = O.reduce((e, t) => e + t.investedAmount, 0), j = O.reduce((e, t) => e + t.currentValue, 0), M = j - A, N = A > 0 ? M / A * 100 : 0, P = O.filter((e) => e.status === "active").length, F = u(() => {
|
|
27
|
+
let e = O.reduce((e, t) => (e[t.cartName] = (e[t.cartName] || 0) + t.currentValue, e), {});
|
|
28
|
+
return Object.entries(e).map(([e, t]) => ({
|
|
29
|
+
label: e,
|
|
30
|
+
value: t
|
|
31
|
+
})).sort((e, t) => t.value - e.value);
|
|
32
|
+
}, [O]), I = u(() => {
|
|
33
|
+
let e = [...O].sort((e, t) => new Date(e.investmentDate).getTime() - new Date(t.investmentDate).getTime()), t = 0, n = e.map((e) => (t += e.currentValue, {
|
|
34
|
+
label: o(e.investmentDate, {
|
|
35
|
+
day: void 0,
|
|
36
|
+
hour: void 0,
|
|
37
|
+
minute: void 0
|
|
38
|
+
}),
|
|
39
|
+
value: t
|
|
40
|
+
}));
|
|
41
|
+
return n.length === 1 ? [{
|
|
42
|
+
label: "Start",
|
|
43
|
+
value: 0
|
|
44
|
+
}, ...n] : n;
|
|
45
|
+
}, [O]), L = u(() => [...O].sort((e, t) => new Date(t.investmentDate).getTime() - new Date(e.investmentDate).getTime()).slice(0, 6), [O]);
|
|
46
|
+
if (k) return /* @__PURE__ */ y(n, {
|
|
19
47
|
title: "My Portfolio",
|
|
20
48
|
description: "Loading your portfolio...",
|
|
21
|
-
children: /* @__PURE__ */
|
|
22
|
-
className: "
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
className: "
|
|
25
|
-
children:
|
|
26
|
-
|
|
27
|
-
children: "Loading your portfolio..."
|
|
28
|
-
})]
|
|
29
|
-
})
|
|
49
|
+
children: /* @__PURE__ */ b("div", {
|
|
50
|
+
className: "space-y-4",
|
|
51
|
+
children: [/* @__PURE__ */ y("div", {
|
|
52
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
53
|
+
children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ y("div", { className: "h-28 animate-pulse rounded-[var(--radius-card)] bg-bg-sunken" }, t))
|
|
54
|
+
}), /* @__PURE__ */ y("div", { className: "h-72 animate-pulse rounded-[var(--radius-card)] bg-bg-sunken" })]
|
|
30
55
|
})
|
|
31
|
-
})
|
|
56
|
+
});
|
|
57
|
+
let R = O.length === 0;
|
|
58
|
+
return /* @__PURE__ */ b(n, {
|
|
32
59
|
title: "My Portfolio",
|
|
33
|
-
description: "
|
|
60
|
+
description: "View and manage your investments",
|
|
61
|
+
actions: /* @__PURE__ */ y("button", {
|
|
62
|
+
type: "button",
|
|
63
|
+
onClick: () => E("/investor/opportunities"),
|
|
64
|
+
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover transition-colors",
|
|
65
|
+
children: "Add Funds"
|
|
66
|
+
}),
|
|
34
67
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ y(C, {
|
|
36
69
|
className: "mb-6",
|
|
37
|
-
children: "The complete picture of your money on Kadaikodi.
|
|
70
|
+
children: "The complete picture of your money on Kadaikodi. See how your portfolio is performing overall, how its value has grown as you've backed more carts, how it's split across holdings, and the detail of every position."
|
|
38
71
|
}),
|
|
39
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ b(x, { children: [/* @__PURE__ */ y("h2", {
|
|
40
73
|
className: "mb-4 text-base font-semibold text-text-primary",
|
|
41
74
|
children: "Portfolio at a Glance"
|
|
42
|
-
}), /* @__PURE__ */
|
|
75
|
+
}), /* @__PURE__ */ b("div", {
|
|
43
76
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
44
77
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
|
|
78
|
+
/* @__PURE__ */ y(s, {
|
|
79
|
+
featured: !0,
|
|
80
|
+
icon: /* @__PURE__ */ y(_, { className: "h-5 w-5" }),
|
|
81
|
+
value: a(A, { minimumFractionDigits: 0 }),
|
|
48
82
|
label: "Total Invested",
|
|
49
83
|
trend: "neutral",
|
|
50
|
-
trendValue: `${
|
|
84
|
+
trendValue: `${P} active`
|
|
51
85
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
icon: /* @__PURE__ */
|
|
54
|
-
value:
|
|
86
|
+
/* @__PURE__ */ y(s, {
|
|
87
|
+
icon: /* @__PURE__ */ y(h, { className: "h-5 w-5" }),
|
|
88
|
+
value: a(j, { minimumFractionDigits: 0 }),
|
|
55
89
|
label: "Current Value",
|
|
56
|
-
trend:
|
|
57
|
-
trendValue:
|
|
90
|
+
trend: N >= 0 ? "up" : "down",
|
|
91
|
+
trendValue: w(N)
|
|
58
92
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
icon: /* @__PURE__ */
|
|
61
|
-
value:
|
|
62
|
-
label: "
|
|
63
|
-
trend:
|
|
64
|
-
trendValue:
|
|
93
|
+
/* @__PURE__ */ y(s, {
|
|
94
|
+
icon: /* @__PURE__ */ y(g, { className: "h-5 w-5" }),
|
|
95
|
+
value: w(N),
|
|
96
|
+
label: "Overall Returns",
|
|
97
|
+
trend: M >= 0 ? "up" : "down",
|
|
98
|
+
trendValue: a(Math.abs(M), { minimumFractionDigits: 0 })
|
|
65
99
|
}),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
icon: /* @__PURE__ */
|
|
68
|
-
value: String(
|
|
69
|
-
label: "
|
|
100
|
+
/* @__PURE__ */ y(s, {
|
|
101
|
+
icon: /* @__PURE__ */ y(d, { className: "h-5 w-5" }),
|
|
102
|
+
value: String(P),
|
|
103
|
+
label: "Active Investments"
|
|
70
104
|
})
|
|
71
105
|
]
|
|
72
106
|
})] }),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
className: "mt-6
|
|
75
|
-
children:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
label: "Overview",
|
|
81
|
-
Icon: u
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
key: "investments",
|
|
85
|
-
label: `Investments (${w.length})`,
|
|
86
|
-
Icon: d
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
key: "transactions",
|
|
90
|
-
label: "Transactions",
|
|
91
|
-
Icon: f
|
|
92
|
-
}
|
|
93
|
-
].map(({ key: e, label: n, Icon: r }) => /* @__PURE__ */ v("button", {
|
|
107
|
+
R ? /* @__PURE__ */ y("div", {
|
|
108
|
+
className: "mt-6",
|
|
109
|
+
children: /* @__PURE__ */ y(r, {
|
|
110
|
+
illustration: "empty-data",
|
|
111
|
+
title: "No holdings yet",
|
|
112
|
+
description: "Once you back a cart, your portfolio value, allocation and holdings will appear here.",
|
|
113
|
+
action: /* @__PURE__ */ y("button", {
|
|
94
114
|
type: "button",
|
|
95
|
-
onClick: () =>
|
|
96
|
-
className:
|
|
97
|
-
children:
|
|
98
|
-
}
|
|
99
|
-
})
|
|
100
|
-
|
|
115
|
+
onClick: () => E("/investor/opportunities"),
|
|
116
|
+
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg-hover transition-colors",
|
|
117
|
+
children: "Browse Opportunities"
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
}) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("div", {
|
|
121
|
+
className: "mt-6 grid gap-6 lg:grid-cols-3",
|
|
122
|
+
children: [/* @__PURE__ */ b(S, {
|
|
123
|
+
treatment: "plain",
|
|
124
|
+
className: "p-5 sm:p-6 lg:col-span-2",
|
|
125
|
+
children: [/* @__PURE__ */ b("div", {
|
|
126
|
+
className: "mb-4 flex items-center justify-between",
|
|
127
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
128
|
+
className: "text-lg font-semibold text-text-primary",
|
|
129
|
+
children: "Portfolio Value Trend"
|
|
130
|
+
}), /* @__PURE__ */ y("span", {
|
|
131
|
+
className: "text-xs text-text-secondary",
|
|
132
|
+
children: "by holding date"
|
|
133
|
+
})]
|
|
134
|
+
}), /* @__PURE__ */ y(c, {
|
|
135
|
+
series: I,
|
|
136
|
+
height: 240,
|
|
137
|
+
valueFormatter: T,
|
|
138
|
+
title: "Cumulative portfolio value by holding date"
|
|
139
|
+
})]
|
|
140
|
+
}), /* @__PURE__ */ b(S, {
|
|
141
|
+
treatment: "plain",
|
|
142
|
+
className: "p-5 sm:p-6",
|
|
143
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
144
|
+
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
145
|
+
children: "Allocation"
|
|
146
|
+
}), /* @__PURE__ */ y("div", {
|
|
147
|
+
className: "flex flex-col items-center gap-4",
|
|
148
|
+
children: /* @__PURE__ */ y(l, {
|
|
149
|
+
segments: F,
|
|
150
|
+
size: 180,
|
|
151
|
+
centerLabel: T(j),
|
|
152
|
+
centerCaption: "total value",
|
|
153
|
+
valueFormatter: T
|
|
154
|
+
})
|
|
155
|
+
})]
|
|
156
|
+
})]
|
|
157
|
+
}), /* @__PURE__ */ b("div", {
|
|
158
|
+
className: "mt-6 grid gap-6 lg:grid-cols-3",
|
|
159
|
+
children: [/* @__PURE__ */ b(S, {
|
|
160
|
+
treatment: "plain",
|
|
161
|
+
className: "p-5 sm:p-6 lg:col-span-2",
|
|
101
162
|
children: [
|
|
102
|
-
|
|
103
|
-
className: "
|
|
104
|
-
children:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
className: "
|
|
112
|
-
children: "Browse Opportunities"
|
|
113
|
-
})
|
|
114
|
-
}) : /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h3", {
|
|
115
|
-
className: "mb-4 text-base font-semibold text-text-primary",
|
|
116
|
-
children: "Allocation by Cart"
|
|
117
|
-
}), /* @__PURE__ */ _("div", {
|
|
118
|
-
className: "space-y-3",
|
|
119
|
-
children: Object.entries(N).map(([e, t]) => /* @__PURE__ */ v("div", {
|
|
120
|
-
className: "flex items-center",
|
|
163
|
+
/* @__PURE__ */ y("h2", {
|
|
164
|
+
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
165
|
+
children: "Your Holdings"
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ y("div", {
|
|
168
|
+
className: "hidden overflow-x-auto md:block",
|
|
169
|
+
children: /* @__PURE__ */ b("table", {
|
|
170
|
+
className: "w-full text-sm",
|
|
171
|
+
children: [/* @__PURE__ */ y("thead", { children: /* @__PURE__ */ b("tr", {
|
|
172
|
+
className: "border-b border-border-subtle text-left text-xs text-text-secondary",
|
|
121
173
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
className: "
|
|
124
|
-
children:
|
|
174
|
+
/* @__PURE__ */ y("th", {
|
|
175
|
+
className: "pb-3 pr-4 font-medium",
|
|
176
|
+
children: "Merchant"
|
|
125
177
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
className: "
|
|
128
|
-
children:
|
|
129
|
-
className: "flex h-6 items-center justify-end rounded-full bg-action-primary-bg pr-2",
|
|
130
|
-
style: { width: `${k > 0 ? t / k * 100 : 0}%` },
|
|
131
|
-
children: /* @__PURE__ */ v("span", {
|
|
132
|
-
className: "text-xs font-medium text-action-primary-text",
|
|
133
|
-
children: [k > 0 ? (t / k * 100).toFixed(1) : 0, "%"]
|
|
134
|
-
})
|
|
135
|
-
})
|
|
178
|
+
/* @__PURE__ */ y("th", {
|
|
179
|
+
className: "pb-3 pr-4 text-right font-medium",
|
|
180
|
+
children: "Invested"
|
|
136
181
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
className: "
|
|
139
|
-
children:
|
|
140
|
-
})
|
|
141
|
-
]
|
|
142
|
-
}, e))
|
|
143
|
-
})] })
|
|
144
|
-
}),
|
|
145
|
-
E === "investments" && /* @__PURE__ */ _("div", { children: w.length === 0 ? /* @__PURE__ */ _(i, {
|
|
146
|
-
illustration: "empty-data",
|
|
147
|
-
title: "No holdings to show",
|
|
148
|
-
description: "You don't hold any investments yet. Explore opportunities to start building your portfolio.",
|
|
149
|
-
action: /* @__PURE__ */ _("button", {
|
|
150
|
-
type: "button",
|
|
151
|
-
onClick: () => S("/investor/opportunities"),
|
|
152
|
-
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
|
|
153
|
-
children: "Browse Opportunities"
|
|
154
|
-
})
|
|
155
|
-
}) : /* @__PURE__ */ _("div", {
|
|
156
|
-
className: "space-y-4",
|
|
157
|
-
children: w.map((e) => {
|
|
158
|
-
let n = e.currentValue - e.investedAmount, r = e.investedAmount > 0 ? n / e.investedAmount * 100 : 0;
|
|
159
|
-
return /* @__PURE__ */ v("div", {
|
|
160
|
-
className: "rounded-lg border border-border-subtle p-4 hover:bg-accent/50 transition-colors",
|
|
161
|
-
children: [
|
|
162
|
-
/* @__PURE__ */ v("div", {
|
|
163
|
-
className: "mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
164
|
-
children: [/* @__PURE__ */ v("div", {
|
|
165
|
-
className: "flex-1",
|
|
166
|
-
children: [/* @__PURE__ */ _("h4", {
|
|
167
|
-
className: "text-base font-semibold text-text-primary",
|
|
168
|
-
children: e.cartName
|
|
169
|
-
}), /* @__PURE__ */ _("p", {
|
|
170
|
-
className: "mt-1 text-sm capitalize text-text-secondary",
|
|
171
|
-
children: e.status
|
|
172
|
-
})]
|
|
173
|
-
}), /* @__PURE__ */ v("div", {
|
|
174
|
-
className: "text-left sm:text-right",
|
|
175
|
-
children: [/* @__PURE__ */ _("p", {
|
|
176
|
-
className: "text-xl font-bold text-text-primary",
|
|
177
|
-
children: o(e.currentValue, { minimumFractionDigits: 0 })
|
|
178
|
-
}), /* @__PURE__ */ v("p", {
|
|
179
|
-
className: t("text-sm", n >= 0 ? "text-status-success-text" : "text-status-error-text"),
|
|
180
|
-
children: [
|
|
181
|
-
o(Math.abs(n), { minimumFractionDigits: 0 }),
|
|
182
|
-
" (",
|
|
183
|
-
x(r),
|
|
184
|
-
")"
|
|
185
|
-
]
|
|
186
|
-
})]
|
|
187
|
-
})]
|
|
182
|
+
/* @__PURE__ */ y("th", {
|
|
183
|
+
className: "pb-3 pr-4 text-right font-medium",
|
|
184
|
+
children: "Current Value"
|
|
188
185
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
className: "
|
|
191
|
-
children:
|
|
192
|
-
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
|
|
193
|
-
className: "text-xs text-text-secondary",
|
|
194
|
-
children: "Invested"
|
|
195
|
-
}), /* @__PURE__ */ _("p", {
|
|
196
|
-
className: "text-sm font-medium text-text-primary",
|
|
197
|
-
children: o(e.investedAmount, { minimumFractionDigits: 0 })
|
|
198
|
-
})] }),
|
|
199
|
-
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
|
|
200
|
-
className: "text-xs text-text-secondary",
|
|
201
|
-
children: "Returns"
|
|
202
|
-
}), /* @__PURE__ */ _("p", {
|
|
203
|
-
className: "text-sm font-medium text-text-primary",
|
|
204
|
-
children: o(e.returns, { minimumFractionDigits: 0 })
|
|
205
|
-
})] }),
|
|
206
|
-
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
|
|
207
|
-
className: "text-xs text-text-secondary",
|
|
208
|
-
children: "Expected Return"
|
|
209
|
-
}), /* @__PURE__ */ v("p", {
|
|
210
|
-
className: "text-sm font-medium text-text-primary",
|
|
211
|
-
children: [e.returnsPercentage, "%"]
|
|
212
|
-
})] }),
|
|
213
|
-
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
|
|
214
|
-
className: "text-xs text-text-secondary",
|
|
215
|
-
children: "Investment Date"
|
|
216
|
-
}), /* @__PURE__ */ _("p", {
|
|
217
|
-
className: "text-sm font-medium text-text-primary",
|
|
218
|
-
children: s(e.investmentDate, {
|
|
219
|
-
hour: void 0,
|
|
220
|
-
minute: void 0
|
|
221
|
-
})
|
|
222
|
-
})] })
|
|
223
|
-
]
|
|
186
|
+
/* @__PURE__ */ y("th", {
|
|
187
|
+
className: "pb-3 pr-4 text-right font-medium",
|
|
188
|
+
children: "Returns"
|
|
224
189
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
className: "
|
|
227
|
-
children:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
})
|
|
190
|
+
/* @__PURE__ */ y("th", {
|
|
191
|
+
className: "pb-3 pr-4 font-medium",
|
|
192
|
+
children: "Status"
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ y("th", {
|
|
195
|
+
className: "pb-3 font-medium",
|
|
196
|
+
"aria-label": "actions"
|
|
233
197
|
})
|
|
234
198
|
]
|
|
199
|
+
}) }), /* @__PURE__ */ y("tbody", { children: O.map((e) => {
|
|
200
|
+
let n = e.currentValue - e.investedAmount, r = e.investedAmount > 0 ? n / e.investedAmount * 100 : 0;
|
|
201
|
+
return /* @__PURE__ */ b("tr", {
|
|
202
|
+
className: "border-b border-border-subtle/60 last:border-0",
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ y("td", {
|
|
205
|
+
className: "py-3 pr-4 font-medium text-text-primary",
|
|
206
|
+
children: e.cartName
|
|
207
|
+
}),
|
|
208
|
+
/* @__PURE__ */ y("td", {
|
|
209
|
+
className: "py-3 pr-4 text-right tabular-nums text-text-primary",
|
|
210
|
+
children: a(e.investedAmount, { minimumFractionDigits: 0 })
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ y("td", {
|
|
213
|
+
className: "py-3 pr-4 text-right tabular-nums text-text-primary",
|
|
214
|
+
children: a(e.currentValue, { minimumFractionDigits: 0 })
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ y("td", {
|
|
217
|
+
className: t("py-3 pr-4 text-right font-medium tabular-nums", n >= 0 ? "text-status-success-text" : "text-status-error-text"),
|
|
218
|
+
children: w(r)
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ y("td", {
|
|
221
|
+
className: "py-3 pr-4",
|
|
222
|
+
children: /* @__PURE__ */ b("span", {
|
|
223
|
+
className: "inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-xs font-medium capitalize text-status-success-text",
|
|
224
|
+
children: [/* @__PURE__ */ y("span", { className: "h-1.5 w-1.5 rounded-full bg-status-success-text" }), e.status]
|
|
225
|
+
})
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ y("td", {
|
|
228
|
+
className: "py-3 text-right",
|
|
229
|
+
children: /* @__PURE__ */ b("button", {
|
|
230
|
+
type: "button",
|
|
231
|
+
onClick: () => E(`/investor/investments/${e.id}`),
|
|
232
|
+
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
|
|
233
|
+
children: [/* @__PURE__ */ y(m, { className: "h-3.5 w-3.5" }), "View"]
|
|
234
|
+
})
|
|
235
|
+
})
|
|
236
|
+
]
|
|
237
|
+
}, e.id);
|
|
238
|
+
}) })]
|
|
239
|
+
})
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ y("div", {
|
|
242
|
+
className: "space-y-3 md:hidden",
|
|
243
|
+
children: O.map((e) => {
|
|
244
|
+
let n = e.currentValue - e.investedAmount, r = e.investedAmount > 0 ? n / e.investedAmount * 100 : 0;
|
|
245
|
+
return /* @__PURE__ */ b("button", {
|
|
246
|
+
type: "button",
|
|
247
|
+
onClick: () => E(`/investor/investments/${e.id}`),
|
|
248
|
+
className: "w-full rounded-lg border border-border-subtle p-4 text-left transition-colors hover:bg-accent/50",
|
|
249
|
+
children: [/* @__PURE__ */ b("div", {
|
|
250
|
+
className: "flex items-start justify-between gap-3",
|
|
251
|
+
children: [/* @__PURE__ */ y("span", {
|
|
252
|
+
className: "font-medium text-text-primary",
|
|
253
|
+
children: e.cartName
|
|
254
|
+
}), /* @__PURE__ */ y("span", {
|
|
255
|
+
className: t("text-sm font-semibold tabular-nums", n >= 0 ? "text-status-success-text" : "text-status-error-text"),
|
|
256
|
+
children: w(r)
|
|
257
|
+
})]
|
|
258
|
+
}), /* @__PURE__ */ b("div", {
|
|
259
|
+
className: "mt-3 grid grid-cols-2 gap-3 text-sm",
|
|
260
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
261
|
+
className: "text-xs text-text-secondary",
|
|
262
|
+
children: "Invested"
|
|
263
|
+
}), /* @__PURE__ */ y("p", {
|
|
264
|
+
className: "font-medium text-text-primary",
|
|
265
|
+
children: a(e.investedAmount, { minimumFractionDigits: 0 })
|
|
266
|
+
})] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
267
|
+
className: "text-xs text-text-secondary",
|
|
268
|
+
children: "Current Value"
|
|
269
|
+
}), /* @__PURE__ */ y("p", {
|
|
270
|
+
className: "font-medium text-text-primary",
|
|
271
|
+
children: a(e.currentValue, { minimumFractionDigits: 0 })
|
|
272
|
+
})] })]
|
|
273
|
+
})]
|
|
235
274
|
}, e.id);
|
|
236
275
|
})
|
|
237
|
-
}) }),
|
|
238
|
-
E === "transactions" && /* @__PURE__ */ _(i, {
|
|
239
|
-
illustration: "empty-data",
|
|
240
|
-
title: "No transaction history yet",
|
|
241
|
-
description: "A detailed ledger of your investments, dividends and withdrawals will appear here as your activity builds up."
|
|
242
276
|
})
|
|
243
277
|
]
|
|
278
|
+
}), /* @__PURE__ */ b(S, {
|
|
279
|
+
treatment: "plain",
|
|
280
|
+
className: "p-5 sm:p-6",
|
|
281
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
282
|
+
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
283
|
+
children: "Recent Activity"
|
|
284
|
+
}), /* @__PURE__ */ y("ul", {
|
|
285
|
+
className: "space-y-4",
|
|
286
|
+
children: L.map((e) => /* @__PURE__ */ b("li", {
|
|
287
|
+
className: "flex items-start gap-3",
|
|
288
|
+
children: [/* @__PURE__ */ y("span", {
|
|
289
|
+
className: "mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[var(--color-accent-soft)]",
|
|
290
|
+
children: /* @__PURE__ */ y(p, { className: "h-4 w-4 text-text-primary" })
|
|
291
|
+
}), /* @__PURE__ */ b("div", {
|
|
292
|
+
className: "min-w-0 flex-1",
|
|
293
|
+
children: [/* @__PURE__ */ b("div", {
|
|
294
|
+
className: "flex items-baseline justify-between gap-2",
|
|
295
|
+
children: [/* @__PURE__ */ b("p", {
|
|
296
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
297
|
+
children: ["Invested · ", e.cartName]
|
|
298
|
+
}), /* @__PURE__ */ y("span", {
|
|
299
|
+
className: "shrink-0 text-sm font-semibold tabular-nums text-text-primary",
|
|
300
|
+
children: a(e.investedAmount, {
|
|
301
|
+
minimumFractionDigits: 0,
|
|
302
|
+
notation: "compact"
|
|
303
|
+
})
|
|
304
|
+
})]
|
|
305
|
+
}), /* @__PURE__ */ b("div", {
|
|
306
|
+
className: "mt-0.5 flex items-center gap-2 text-xs text-text-secondary",
|
|
307
|
+
children: [/* @__PURE__ */ y("span", { children: o(e.investmentDate, {
|
|
308
|
+
hour: void 0,
|
|
309
|
+
minute: void 0
|
|
310
|
+
}) }), /* @__PURE__ */ b("span", {
|
|
311
|
+
className: "inline-flex items-center gap-1 capitalize text-status-success-text",
|
|
312
|
+
children: [/* @__PURE__ */ y(f, { className: "h-3 w-3" }), e.status]
|
|
313
|
+
})]
|
|
314
|
+
})]
|
|
315
|
+
})]
|
|
316
|
+
}, e.id))
|
|
317
|
+
})]
|
|
244
318
|
})]
|
|
245
|
-
})
|
|
319
|
+
})] })
|
|
246
320
|
]
|
|
247
321
|
});
|
|
248
322
|
}
|
|
249
323
|
//#endregion
|
|
250
|
-
export {
|
|
324
|
+
export { E as InvestorPortfolioPage };
|
|
251
325
|
|
|
252
326
|
//# sourceMappingURL=InvestorPortfolioPage.js.map
|