@burdenoff/microfe-adaptercloud 2026.626.1 → 2026.628.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/adaptercloud/AdapterCloudRoot.js +65 -121
- package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -1
- package/dist/adaptercloud/AdapterCloudRoutes.js +70 -182
- package/dist/adaptercloud/AdapterCloudRoutes.js.map +1 -1
- package/dist/adaptercloud/components/DataState.js +42 -0
- package/dist/adaptercloud/components/DataState.js.map +1 -0
- package/dist/adaptercloud/components/SeverityBadge.js +12 -0
- package/dist/adaptercloud/components/SeverityBadge.js.map +1 -0
- package/dist/adaptercloud/components/StatusBadge.js +43 -44
- package/dist/adaptercloud/components/StatusBadge.js.map +1 -1
- package/dist/adaptercloud/context/AdapterCloudContext.js +22 -30
- package/dist/adaptercloud/context/AdapterCloudContext.js.map +1 -1
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js +397 -194
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -1
- package/dist/adaptercloud/index.js +1 -0
- package/dist/adaptercloud/pages/OverviewPage.js +334 -0
- package/dist/adaptercloud/pages/OverviewPage.js.map +1 -0
- package/dist/adaptercloud/pages/adapters/AdapterDetailPage.js +187 -0
- package/dist/adaptercloud/pages/adapters/AdapterDetailPage.js.map +1 -0
- package/dist/adaptercloud/pages/adapters/AdapterFormPage.js +278 -0
- package/dist/adaptercloud/pages/adapters/AdapterFormPage.js.map +1 -0
- package/dist/adaptercloud/pages/adapters/AdaptersListPage.js +172 -0
- package/dist/adaptercloud/pages/adapters/AdaptersListPage.js.map +1 -0
- package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js +247 -0
- package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js.map +1 -0
- package/dist/adaptercloud/pages/connections/ConnectionFormPage.js +271 -0
- package/dist/adaptercloud/pages/connections/ConnectionFormPage.js.map +1 -0
- package/dist/adaptercloud/pages/connections/ConnectionsListPage.js +167 -0
- package/dist/adaptercloud/pages/connections/ConnectionsListPage.js.map +1 -0
- package/dist/adaptercloud/pages/costs/CostsPage.js +169 -0
- package/dist/adaptercloud/pages/costs/CostsPage.js.map +1 -0
- package/dist/adaptercloud/pages/drift/DriftListPage.js +132 -0
- package/dist/adaptercloud/pages/drift/DriftListPage.js.map +1 -0
- package/dist/adaptercloud/pages/policies/PoliciesListPage.js +171 -0
- package/dist/adaptercloud/pages/policies/PoliciesListPage.js.map +1 -0
- package/dist/adaptercloud/pages/policies/PolicyDetailPage.js +185 -0
- package/dist/adaptercloud/pages/policies/PolicyDetailPage.js.map +1 -0
- package/dist/adaptercloud/pages/policies/PolicyFormPage.js +215 -0
- package/dist/adaptercloud/pages/policies/PolicyFormPage.js.map +1 -0
- package/dist/adaptercloud/pages/resources/ResourceDetailPage.js +207 -0
- package/dist/adaptercloud/pages/resources/ResourceDetailPage.js.map +1 -0
- package/dist/adaptercloud/pages/resources/ResourcesListPage.js +182 -0
- package/dist/adaptercloud/pages/resources/ResourcesListPage.js.map +1 -0
- package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js +196 -0
- package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js.map +1 -0
- package/dist/adaptercloud/pages/violations/ViolationsListPage.js +258 -0
- package/dist/adaptercloud/pages/violations/ViolationsListPage.js.map +1 -0
- package/dist/adaptercloud/store/adaptercloudStore.js +1 -7
- package/dist/adaptercloud/store/adaptercloudStore.js.map +1 -1
- package/dist/adaptercloud/utils/domain.js +105 -0
- package/dist/adaptercloud/utils/domain.js.map +1 -0
- package/dist/adaptercloud/utils/formatters.js +1 -12
- package/dist/adaptercloud/utils/formatters.js.map +1 -1
- package/dist/index.js +5 -4
- package/package.json +1 -1
- package/dist/adaptercloud/components/InvestmentCard.js +0 -98
- package/dist/adaptercloud/components/InvestmentCard.js.map +0 -1
- package/dist/adaptercloud/components/RatingDisplay.js +0 -35
- package/dist/adaptercloud/components/RatingDisplay.js.map +0 -1
- package/dist/adaptercloud/mocks/data.js +0 -1517
- package/dist/adaptercloud/mocks/data.js.map +0 -1
- package/dist/adaptercloud/mocks/users.js +0 -34
- package/dist/adaptercloud/mocks/users.js.map +0 -1
- package/dist/adaptercloud/pages/HomePage.js +0 -934
- package/dist/adaptercloud/pages/HomePage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +0 -653
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminDashboard.js +0 -665
- package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +0 -426
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +0 -665
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js +0 -261
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +0 -663
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/CartManagementPage.js +0 -874
- package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/UserManagementPage.js +0 -898
- package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +0 -840
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +0 -714
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +0 -788
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +0 -888
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +0 -634
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +0 -907
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +0 -875
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +0 -827
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +0 -1
- package/dist/adaptercloud/pages/common/HelpSupportPage.js +0 -1329
- package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +0 -1
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js +0 -671
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +0 -1
- package/dist/adaptercloud/pages/common/SettingsPage.js +0 -982
- package/dist/adaptercloud/pages/common/SettingsPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +0 -596
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/CartDetailPage.js +0 -623
- package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +0 -552
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/CheckoutPage.js +0 -534
- package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js +0 -525
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +0 -623
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +0 -629
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/FavoritesPage.js +0 -480
- package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +0 -444
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +0 -391
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +0 -504
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/ReviewsPage.js +0 -609
- package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +0 -459
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +0 -851
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +0 -942
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +0 -683
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js +0 -452
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +0 -402
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +0 -571
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +0 -1067
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +0 -1
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +0 -526
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +0 -1
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js +0 -659
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +0 -678
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +0 -1
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +0 -689
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +0 -1
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +0 -582
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +0 -1
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
import { useAdapterCloud as e } from "../../context/AdapterCloudContext.js";
|
|
2
|
-
import { cn as t } from "../../utils/cn.js";
|
|
3
|
-
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
-
import { MetricsCard as r } from "../../components/MetricsCard.js";
|
|
5
|
-
import { EmptyState as i } from "../../components/EmptyState.js";
|
|
6
|
-
import { formatCurrency as a, formatDate as o } from "../../utils/formatters.js";
|
|
7
|
-
import { useEffect as s, useMemo as c, useState as l } from "react";
|
|
8
|
-
import { AlertCircle as u, CheckCircle2 as d, Clock as f, Eye as p, IndianRupee as m, Plus as h, TrendingDown as g, TrendingUp as _, Wallet as v } from "lucide-react";
|
|
9
|
-
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
10
|
-
import { EmphasisPanel as x } from "@burdenoff/fe-libs/ui";
|
|
11
|
-
//#region src/adaptercloud/pages/investor/InvestorInvestmentsPage.tsx
|
|
12
|
-
var S = [
|
|
13
|
-
{
|
|
14
|
-
id: "inv-001",
|
|
15
|
-
cartName: "South Indian Express",
|
|
16
|
-
cartOwner: "Raj Kumar",
|
|
17
|
-
investmentAmount: 5e4,
|
|
18
|
-
currentValue: 58500,
|
|
19
|
-
profitLoss: 8500,
|
|
20
|
-
profitLossPercentage: 17,
|
|
21
|
-
investmentDate: "2024-01-15",
|
|
22
|
-
status: "active",
|
|
23
|
-
roiAnnual: 22.5,
|
|
24
|
-
duration: "18 months",
|
|
25
|
-
nextPayout: "2024-12-15",
|
|
26
|
-
totalReturns: 8500
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: "inv-002",
|
|
30
|
-
cartName: "Pizza Corner",
|
|
31
|
-
cartOwner: "Priya Singh",
|
|
32
|
-
investmentAmount: 75e3,
|
|
33
|
-
currentValue: 82e3,
|
|
34
|
-
profitLoss: 7e3,
|
|
35
|
-
profitLossPercentage: 9.3,
|
|
36
|
-
investmentDate: "2024-03-10",
|
|
37
|
-
status: "active",
|
|
38
|
-
roiAnnual: 18,
|
|
39
|
-
duration: "24 months",
|
|
40
|
-
nextPayout: "2024-12-10",
|
|
41
|
-
totalReturns: 7e3
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "inv-003",
|
|
45
|
-
cartName: "Healthy Bites",
|
|
46
|
-
cartOwner: "Amit Patel",
|
|
47
|
-
investmentAmount: 3e4,
|
|
48
|
-
currentValue: 31200,
|
|
49
|
-
profitLoss: 1200,
|
|
50
|
-
profitLossPercentage: 4,
|
|
51
|
-
investmentDate: "2024-06-01",
|
|
52
|
-
status: "active",
|
|
53
|
-
roiAnnual: 15,
|
|
54
|
-
duration: "12 months",
|
|
55
|
-
nextPayout: "2024-12-01",
|
|
56
|
-
totalReturns: 1200
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: "inv-004",
|
|
60
|
-
cartName: "Street Food Junction",
|
|
61
|
-
cartOwner: "Neha Sharma",
|
|
62
|
-
investmentAmount: 4e4,
|
|
63
|
-
currentValue: 4e4,
|
|
64
|
-
profitLoss: 0,
|
|
65
|
-
profitLossPercentage: 0,
|
|
66
|
-
investmentDate: "2024-08-15",
|
|
67
|
-
status: "pending",
|
|
68
|
-
roiAnnual: 20,
|
|
69
|
-
duration: "15 months",
|
|
70
|
-
nextPayout: "2025-01-15",
|
|
71
|
-
totalReturns: 0
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: "inv-005",
|
|
75
|
-
cartName: "Biryani House",
|
|
76
|
-
cartOwner: "Suresh Reddy",
|
|
77
|
-
investmentAmount: 6e4,
|
|
78
|
-
currentValue: 72e3,
|
|
79
|
-
profitLoss: 12e3,
|
|
80
|
-
profitLossPercentage: 20,
|
|
81
|
-
investmentDate: "2023-12-01",
|
|
82
|
-
status: "matured",
|
|
83
|
-
roiAnnual: 25,
|
|
84
|
-
duration: "12 months",
|
|
85
|
-
nextPayout: "-",
|
|
86
|
-
totalReturns: 12e3
|
|
87
|
-
}
|
|
88
|
-
], C = {
|
|
89
|
-
totalInvested: 255e3,
|
|
90
|
-
currentValue: 283700,
|
|
91
|
-
totalReturns: 28700,
|
|
92
|
-
activeInvestments: 3,
|
|
93
|
-
averageRoi: 19.6,
|
|
94
|
-
profitLoss: 28700,
|
|
95
|
-
profitLossPercentage: 11.3
|
|
96
|
-
};
|
|
97
|
-
function w(e) {
|
|
98
|
-
switch (e) {
|
|
99
|
-
case "active": return "bg-status-success-bg-subtle/20 text-status-success-text";
|
|
100
|
-
case "pending": return "bg-status-warning-bg-subtle/20 text-status-warning-text";
|
|
101
|
-
case "matured": return "bg-accent-blue-subtle/20 text-accent-blue";
|
|
102
|
-
case "withdrawn": return "bg-secondary text-secondary-foreground";
|
|
103
|
-
default: return "bg-secondary text-secondary-foreground";
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function T(e) {
|
|
107
|
-
switch (e) {
|
|
108
|
-
case "active": return /* @__PURE__ */ y(d, { className: "h-4 w-4" });
|
|
109
|
-
case "pending": return /* @__PURE__ */ y(f, { className: "h-4 w-4" });
|
|
110
|
-
case "matured": return /* @__PURE__ */ y(d, { className: "h-4 w-4" });
|
|
111
|
-
default: return /* @__PURE__ */ y(u, { className: "h-4 w-4" });
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
function E() {
|
|
115
|
-
let { navigateTo: u } = e(), [f, E] = l(!0), [D, O] = l("all");
|
|
116
|
-
s(() => {
|
|
117
|
-
let e = setTimeout(() => E(!1), 600);
|
|
118
|
-
return () => clearTimeout(e);
|
|
119
|
-
}, []);
|
|
120
|
-
let k = c(() => D === "all" ? S : S.filter((e) => e.status === D), [D]), A = [
|
|
121
|
-
{
|
|
122
|
-
key: "all",
|
|
123
|
-
label: "All Investments"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
key: "active",
|
|
127
|
-
label: "Active"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
key: "pending",
|
|
131
|
-
label: "Pending"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
key: "matured",
|
|
135
|
-
label: "Matured"
|
|
136
|
-
}
|
|
137
|
-
];
|
|
138
|
-
function j(e) {
|
|
139
|
-
return e === "all" ? S.length : S.filter((t) => t.status === e).length;
|
|
140
|
-
}
|
|
141
|
-
return f ? /* @__PURE__ */ y(n, {
|
|
142
|
-
title: "My Investments",
|
|
143
|
-
description: "Loading your investments...",
|
|
144
|
-
children: /* @__PURE__ */ y("div", {
|
|
145
|
-
className: "flex items-center justify-center py-20",
|
|
146
|
-
children: /* @__PURE__ */ b("div", {
|
|
147
|
-
className: "text-center",
|
|
148
|
-
children: [/* @__PURE__ */ y("div", { className: "mx-auto mb-4 h-12 w-12 animate-spin rounded-full border-b-2 border-primary" }), /* @__PURE__ */ y("p", {
|
|
149
|
-
className: "text-sm text-text-secondary",
|
|
150
|
-
children: "Loading your investments..."
|
|
151
|
-
})]
|
|
152
|
-
})
|
|
153
|
-
})
|
|
154
|
-
}) : /* @__PURE__ */ b(n, {
|
|
155
|
-
title: "My Investments",
|
|
156
|
-
description: "Track and manage your investment portfolio",
|
|
157
|
-
purpose: "The full list of carts you've invested in — filter by status, sort by return, and open any one to see its performance and payout history. This is where you manage and act on what you already hold.",
|
|
158
|
-
actions: /* @__PURE__ */ b("button", {
|
|
159
|
-
type: "button",
|
|
160
|
-
onClick: () => u("/investor/opportunities"),
|
|
161
|
-
className: "flex items-center gap-2 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",
|
|
162
|
-
children: [/* @__PURE__ */ y(h, { className: "h-4 w-4" }), "New Investment"]
|
|
163
|
-
}),
|
|
164
|
-
children: [
|
|
165
|
-
/* @__PURE__ */ y(x, { children: /* @__PURE__ */ b("div", {
|
|
166
|
-
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
167
|
-
children: [
|
|
168
|
-
/* @__PURE__ */ y(r, {
|
|
169
|
-
icon: /* @__PURE__ */ y(v, { className: "h-5 w-5" }),
|
|
170
|
-
value: a(C.totalInvested, { minimumFractionDigits: 0 }),
|
|
171
|
-
label: "Total Invested",
|
|
172
|
-
trend: "up",
|
|
173
|
-
trendValue: "Total amount invested"
|
|
174
|
-
}),
|
|
175
|
-
/* @__PURE__ */ y(r, {
|
|
176
|
-
icon: /* @__PURE__ */ y(m, { className: "h-5 w-5" }),
|
|
177
|
-
value: a(C.currentValue, { minimumFractionDigits: 0 }),
|
|
178
|
-
label: "Current Value",
|
|
179
|
-
trend: C.profitLoss > 0 ? "up" : "down",
|
|
180
|
-
trendValue: `${C.profitLossPercentage > 0 ? "+" : ""}${C.profitLossPercentage}% total returns`
|
|
181
|
-
}),
|
|
182
|
-
/* @__PURE__ */ y(r, {
|
|
183
|
-
icon: /* @__PURE__ */ y(_, { className: "h-5 w-5" }),
|
|
184
|
-
value: a(C.totalReturns, { minimumFractionDigits: 0 }),
|
|
185
|
-
label: "Total Returns",
|
|
186
|
-
trend: "up",
|
|
187
|
-
trendValue: "Total profit earned"
|
|
188
|
-
}),
|
|
189
|
-
/* @__PURE__ */ y(r, {
|
|
190
|
-
icon: /* @__PURE__ */ y(d, { className: "h-5 w-5" }),
|
|
191
|
-
value: String(C.activeInvestments),
|
|
192
|
-
label: "Active Investments",
|
|
193
|
-
trend: "neutral",
|
|
194
|
-
trendValue: `${C.averageRoi}% avg ROI`
|
|
195
|
-
})
|
|
196
|
-
]
|
|
197
|
-
}) }),
|
|
198
|
-
/* @__PURE__ */ y("div", {
|
|
199
|
-
className: "mt-6 rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop",
|
|
200
|
-
children: /* @__PURE__ */ y("div", {
|
|
201
|
-
className: "flex flex-wrap gap-2",
|
|
202
|
-
children: A.map((e) => /* @__PURE__ */ b("button", {
|
|
203
|
-
type: "button",
|
|
204
|
-
onClick: () => O(e.key),
|
|
205
|
-
className: t("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors", D === e.key ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-primary hover:bg-bg-sunken/80"),
|
|
206
|
-
children: [e.label, /* @__PURE__ */ y("span", {
|
|
207
|
-
className: t("rounded-full px-2 py-0.5 text-xs", D === e.key ? "bg-primary-foreground/20 text-action-primary-text" : "bg-action-primary-bg/10 text-primary"),
|
|
208
|
-
children: j(e.key)
|
|
209
|
-
})]
|
|
210
|
-
}, e.key))
|
|
211
|
-
})
|
|
212
|
-
}),
|
|
213
|
-
/* @__PURE__ */ y("div", {
|
|
214
|
-
className: "mt-6 space-y-4",
|
|
215
|
-
children: k.length > 0 ? k.map((e) => /* @__PURE__ */ b("div", {
|
|
216
|
-
className: "rounded-lg border border-border-seam bg-bg-surface p-4 sm:p-6 bg-gloss-card shadow-pop",
|
|
217
|
-
children: [/* @__PURE__ */ b("div", {
|
|
218
|
-
className: "block space-y-4 lg:hidden",
|
|
219
|
-
children: [
|
|
220
|
-
/* @__PURE__ */ b("div", {
|
|
221
|
-
className: "flex items-start justify-between",
|
|
222
|
-
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
|
|
223
|
-
className: "text-lg font-semibold text-text-primary",
|
|
224
|
-
children: e.cartName
|
|
225
|
-
}), /* @__PURE__ */ b("p", {
|
|
226
|
-
className: "text-sm text-text-secondary",
|
|
227
|
-
children: ["by ", e.cartOwner]
|
|
228
|
-
})] }), /* @__PURE__ */ b("span", {
|
|
229
|
-
className: t("flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium", w(e.status)),
|
|
230
|
-
children: [T(e.status), /* @__PURE__ */ y("span", {
|
|
231
|
-
className: "capitalize",
|
|
232
|
-
children: e.status
|
|
233
|
-
})]
|
|
234
|
-
})]
|
|
235
|
-
}),
|
|
236
|
-
/* @__PURE__ */ b("div", {
|
|
237
|
-
className: "grid grid-cols-2 gap-4",
|
|
238
|
-
children: [
|
|
239
|
-
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
240
|
-
className: "text-sm text-text-secondary",
|
|
241
|
-
children: "Invested"
|
|
242
|
-
}), /* @__PURE__ */ y("p", {
|
|
243
|
-
className: "font-semibold text-text-primary",
|
|
244
|
-
children: a(e.investmentAmount, { minimumFractionDigits: 0 })
|
|
245
|
-
})] }),
|
|
246
|
-
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
247
|
-
className: "text-sm text-text-secondary",
|
|
248
|
-
children: "Current Value"
|
|
249
|
-
}), /* @__PURE__ */ y("p", {
|
|
250
|
-
className: "font-semibold text-text-primary",
|
|
251
|
-
children: a(e.currentValue, { minimumFractionDigits: 0 })
|
|
252
|
-
})] }),
|
|
253
|
-
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
254
|
-
className: "text-sm text-text-secondary",
|
|
255
|
-
children: "P&L"
|
|
256
|
-
}), /* @__PURE__ */ b("p", {
|
|
257
|
-
className: t("font-semibold", e.profitLoss >= 0 ? "text-status-success-text" : "text-status-error-text"),
|
|
258
|
-
children: [
|
|
259
|
-
e.profitLoss >= 0 ? "+" : "",
|
|
260
|
-
a(e.profitLoss, { minimumFractionDigits: 0 }),
|
|
261
|
-
" (",
|
|
262
|
-
e.profitLossPercentage >= 0 ? "+" : "",
|
|
263
|
-
e.profitLossPercentage,
|
|
264
|
-
"%)"
|
|
265
|
-
]
|
|
266
|
-
})] }),
|
|
267
|
-
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
268
|
-
className: "text-sm text-text-secondary",
|
|
269
|
-
children: "ROI"
|
|
270
|
-
}), /* @__PURE__ */ b("p", {
|
|
271
|
-
className: "font-semibold text-text-primary",
|
|
272
|
-
children: [e.roiAnnual, "% p.a."]
|
|
273
|
-
})] })
|
|
274
|
-
]
|
|
275
|
-
}),
|
|
276
|
-
/* @__PURE__ */ b("div", {
|
|
277
|
-
className: "flex items-center justify-between border-t border-border-subtle pt-2",
|
|
278
|
-
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
279
|
-
className: "text-xs text-text-secondary",
|
|
280
|
-
children: "Invested on"
|
|
281
|
-
}), /* @__PURE__ */ y("p", {
|
|
282
|
-
className: "text-sm font-medium text-text-primary",
|
|
283
|
-
children: o(e.investmentDate, {
|
|
284
|
-
hour: void 0,
|
|
285
|
-
minute: void 0
|
|
286
|
-
})
|
|
287
|
-
})] }), /* @__PURE__ */ b("button", {
|
|
288
|
-
type: "button",
|
|
289
|
-
onClick: () => u(`/investor/investments/${e.id}`),
|
|
290
|
-
className: "flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
291
|
-
children: [/* @__PURE__ */ y(p, { className: "h-4 w-4" }), "View Details"]
|
|
292
|
-
})]
|
|
293
|
-
})
|
|
294
|
-
]
|
|
295
|
-
}), /* @__PURE__ */ b("div", {
|
|
296
|
-
className: "hidden lg:flex lg:items-center lg:justify-between",
|
|
297
|
-
children: [/* @__PURE__ */ b("div", {
|
|
298
|
-
className: "min-w-0 flex-1",
|
|
299
|
-
children: [
|
|
300
|
-
/* @__PURE__ */ b("div", {
|
|
301
|
-
className: "mb-2 flex items-center justify-between",
|
|
302
|
-
children: [/* @__PURE__ */ y("h3", {
|
|
303
|
-
className: "text-lg font-semibold text-text-primary",
|
|
304
|
-
children: e.cartName
|
|
305
|
-
}), /* @__PURE__ */ b("span", {
|
|
306
|
-
className: t("flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium", w(e.status)),
|
|
307
|
-
children: [T(e.status), /* @__PURE__ */ y("span", {
|
|
308
|
-
className: "capitalize",
|
|
309
|
-
children: e.status
|
|
310
|
-
})]
|
|
311
|
-
})]
|
|
312
|
-
}),
|
|
313
|
-
/* @__PURE__ */ b("p", {
|
|
314
|
-
className: "mb-4 text-sm text-text-secondary",
|
|
315
|
-
children: ["by ", e.cartOwner]
|
|
316
|
-
}),
|
|
317
|
-
/* @__PURE__ */ b("div", {
|
|
318
|
-
className: "grid grid-cols-5 gap-6",
|
|
319
|
-
children: [
|
|
320
|
-
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
321
|
-
className: "text-sm text-text-secondary",
|
|
322
|
-
children: "Invested"
|
|
323
|
-
}), /* @__PURE__ */ y("p", {
|
|
324
|
-
className: "font-semibold text-text-primary",
|
|
325
|
-
children: a(e.investmentAmount, { minimumFractionDigits: 0 })
|
|
326
|
-
})] }),
|
|
327
|
-
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
328
|
-
className: "text-sm text-text-secondary",
|
|
329
|
-
children: "Current Value"
|
|
330
|
-
}), /* @__PURE__ */ y("p", {
|
|
331
|
-
className: "font-semibold text-text-primary",
|
|
332
|
-
children: a(e.currentValue, { minimumFractionDigits: 0 })
|
|
333
|
-
})] }),
|
|
334
|
-
/* @__PURE__ */ b("div", { children: [
|
|
335
|
-
/* @__PURE__ */ y("p", {
|
|
336
|
-
className: "text-sm text-text-secondary",
|
|
337
|
-
children: "P&L"
|
|
338
|
-
}),
|
|
339
|
-
/* @__PURE__ */ b("p", {
|
|
340
|
-
className: t("font-semibold", e.profitLoss >= 0 ? "text-status-success-text" : "text-status-error-text"),
|
|
341
|
-
children: [e.profitLoss >= 0 ? "+" : "", a(e.profitLoss, { minimumFractionDigits: 0 })]
|
|
342
|
-
}),
|
|
343
|
-
/* @__PURE__ */ b("p", {
|
|
344
|
-
className: t("text-xs", e.profitLoss >= 0 ? "text-status-success-text" : "text-status-error-text"),
|
|
345
|
-
children: [
|
|
346
|
-
"(",
|
|
347
|
-
e.profitLossPercentage >= 0 ? "+" : "",
|
|
348
|
-
e.profitLossPercentage,
|
|
349
|
-
"%)"
|
|
350
|
-
]
|
|
351
|
-
})
|
|
352
|
-
] }),
|
|
353
|
-
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
354
|
-
className: "text-sm text-text-secondary",
|
|
355
|
-
children: "ROI"
|
|
356
|
-
}), /* @__PURE__ */ b("p", {
|
|
357
|
-
className: "font-semibold text-text-primary",
|
|
358
|
-
children: [e.roiAnnual, "% p.a."]
|
|
359
|
-
})] }),
|
|
360
|
-
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
361
|
-
className: "text-sm text-text-secondary",
|
|
362
|
-
children: "Invested on"
|
|
363
|
-
}), /* @__PURE__ */ y("p", {
|
|
364
|
-
className: "font-semibold text-text-primary",
|
|
365
|
-
children: o(e.investmentDate, {
|
|
366
|
-
hour: void 0,
|
|
367
|
-
minute: void 0
|
|
368
|
-
})
|
|
369
|
-
})] })
|
|
370
|
-
]
|
|
371
|
-
})
|
|
372
|
-
]
|
|
373
|
-
}), /* @__PURE__ */ y("div", {
|
|
374
|
-
className: "ml-6",
|
|
375
|
-
children: /* @__PURE__ */ b("button", {
|
|
376
|
-
type: "button",
|
|
377
|
-
onClick: () => u(`/investor/investments/${e.id}`),
|
|
378
|
-
className: "flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
379
|
-
children: [/* @__PURE__ */ y(p, { className: "h-4 w-4" }), "View Details"]
|
|
380
|
-
})
|
|
381
|
-
})]
|
|
382
|
-
})]
|
|
383
|
-
}, e.id)) : /* @__PURE__ */ y(i, {
|
|
384
|
-
illustration: "empty-data",
|
|
385
|
-
icon: /* @__PURE__ */ y(g, { className: "h-12 w-12" }),
|
|
386
|
-
title: `No ${D === "all" ? "" : D} investments found`,
|
|
387
|
-
description: D === "all" ? "You haven't made any investments yet. Start exploring opportunities to grow your wealth." : `You don't have any ${D} investments at the moment.`,
|
|
388
|
-
action: /* @__PURE__ */ y("button", {
|
|
389
|
-
type: "button",
|
|
390
|
-
onClick: () => u("/investor/opportunities"),
|
|
391
|
-
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",
|
|
392
|
-
children: "Explore Investment Opportunities"
|
|
393
|
-
})
|
|
394
|
-
})
|
|
395
|
-
})
|
|
396
|
-
]
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
//#endregion
|
|
400
|
-
export { E as InvestorInvestmentsPage };
|
|
401
|
-
|
|
402
|
-
//# sourceMappingURL=InvestorInvestmentsPage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InvestorInvestmentsPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/investor/InvestorInvestmentsPage.tsx"],"sourcesContent":["/**\n * Investor Investments Page\n * @module adaptercloud/pages/investor\n *\n * MetricsGrid summary cards, filter tabs (all/active/pending/matured) with counts,\n * responsive mobile/desktop layouts, P&L display, ROI display, status icons,\n * empty state.\n */\n\nimport { useState, useEffect, useMemo } from'react';\nimport {\n TrendingUp,\n TrendingDown,\n Briefcase,\n Eye,\n BarChart3,\n AlertCircle,\n CheckCircle2,\n Clock,\n Wallet,\n IndianRupee,\n Plus,\n Target,\n} from'lucide-react';\nimport { EmphasisPanel } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from'../../components/PageLayout';\nimport { MetricsCard } from'../../components/MetricsCard';\nimport { EmptyState } from'../../components/EmptyState';\nimport { useAdapterCloud } from'../../context/AdapterCloudContext';\nimport { cn } from'../../utils/cn';\nimport { formatCurrency, formatDate } from'../../utils/formatters';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ninterface Investment {\n id: string;\n cartName: string;\n cartOwner: string;\n investmentAmount: number;\n currentValue: number;\n profitLoss: number;\n profitLossPercentage: number;\n investmentDate: string;\n status: 'active' | 'pending' | 'matured' | 'withdrawn';\n roiAnnual: number;\n duration: string;\n nextPayout: string;\n totalReturns: number;\n}\n\ninterface InvestmentSummary {\n totalInvested: number;\n currentValue: number;\n totalReturns: number;\n activeInvestments: number;\n averageRoi: number;\n profitLoss: number;\n profitLossPercentage: number;\n}\n\ntype FilterKey = 'all' | 'active' | 'pending' | 'matured';\n\n// ---------------------------------------------------------------------------\n// Mock data\n// ---------------------------------------------------------------------------\n\nconst mockInvestments: Investment[] = [\n {\n id: 'inv-001',\n cartName: 'South Indian Express',\n cartOwner: 'Raj Kumar',\n investmentAmount: 50000,\n currentValue: 58500,\n profitLoss: 8500,\n profitLossPercentage: 17.0,\n investmentDate: '2024-01-15',\n status: 'active',\n roiAnnual: 22.5,\n duration: '18 months',\n nextPayout: '2024-12-15',\n totalReturns: 8500,\n },\n {\n id: 'inv-002',\n cartName: 'Pizza Corner',\n cartOwner: 'Priya Singh',\n investmentAmount: 75000,\n currentValue: 82000,\n profitLoss: 7000,\n profitLossPercentage: 9.3,\n investmentDate: '2024-03-10',\n status: 'active',\n roiAnnual: 18.0,\n duration: '24 months',\n nextPayout: '2024-12-10',\n totalReturns: 7000,\n },\n {\n id: 'inv-003',\n cartName: 'Healthy Bites',\n cartOwner: 'Amit Patel',\n investmentAmount: 30000,\n currentValue: 31200,\n profitLoss: 1200,\n profitLossPercentage: 4.0,\n investmentDate: '2024-06-01',\n status: 'active',\n roiAnnual: 15.0,\n duration: '12 months',\n nextPayout: '2024-12-01',\n totalReturns: 1200,\n },\n {\n id: 'inv-004',\n cartName: 'Street Food Junction',\n cartOwner: 'Neha Sharma',\n investmentAmount: 40000,\n currentValue: 40000,\n profitLoss: 0,\n profitLossPercentage: 0,\n investmentDate: '2024-08-15',\n status: 'pending',\n roiAnnual: 20.0,\n duration: '15 months',\n nextPayout: '2025-01-15',\n totalReturns: 0,\n },\n {\n id: 'inv-005',\n cartName: 'Biryani House',\n cartOwner: 'Suresh Reddy',\n investmentAmount: 60000,\n currentValue: 72000,\n profitLoss: 12000,\n profitLossPercentage: 20.0,\n investmentDate: '2023-12-01',\n status: 'matured',\n roiAnnual: 25.0,\n duration: '12 months',\n nextPayout: '-',\n totalReturns: 12000,\n },\n];\n\nconst mockSummary: InvestmentSummary = {\n totalInvested: 255000,\n currentValue: 283700,\n totalReturns: 28700,\n activeInvestments: 3,\n averageRoi: 19.6,\n profitLoss: 28700,\n profitLossPercentage: 11.3,\n};\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction getStatusColor(status: string): string {\n switch (status) {\n case'active':\n return'bg-status-success-bg-subtle/20 text-status-success-text';\n case'pending':\n return'bg-status-warning-bg-subtle/20 text-status-warning-text';\n case'matured':\n return'bg-accent-blue-subtle/20 text-accent-blue';\n case'withdrawn':\n return'bg-secondary text-secondary-foreground';\n default:\n return'bg-secondary text-secondary-foreground';\n }\n}\n\nfunction getStatusIcon(status: string) {\n switch (status) {\n case'active':\n return <CheckCircle2 className=\"h-4 w-4\" />;\n case'pending':\n return <Clock className=\"h-4 w-4\" />;\n case'matured':\n return <CheckCircle2 className=\"h-4 w-4\" />;\n default:\n return <AlertCircle className=\"h-4 w-4\" />;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function InvestorInvestmentsPage() {\n const { navigateTo } = useAdapterCloud();\n const [isLoading, setIsLoading] = useState(true);\n const [filter, setFilter] = useState<FilterKey>('all');\n\n useEffect(() => {\n const timer = setTimeout(() => setIsLoading(false), 600);\n return () => clearTimeout(timer);\n }, []);\n\n const filteredInvestments = useMemo(() => {\n if (filter === 'all') return mockInvestments;\n return mockInvestments.filter((inv) => inv.status === filter);\n }, [filter]);\n\n const filterTabs: Array<{ key: FilterKey; label: string }> = [\n { key: 'all', label: 'All Investments' },\n { key: 'active', label: 'Active' },\n { key: 'pending', label: 'Pending' },\n { key: 'matured', label: 'Matured' },\n ];\n\n function getCount(key: FilterKey): number {\n if (key === 'all') return mockInvestments.length;\n return mockInvestments.filter((inv) => inv.status === key).length;\n }\n\n if (isLoading) {\n return (\n <PageLayout title=\"My Investments\" description=\"Loading your investments...\">\n <div className=\"flex items-center justify-center py-20\">\n <div className=\"text-center\">\n <div className=\"mx-auto mb-4 h-12 w-12 animate-spin rounded-full border-b-2 border-primary\" />\n <p className=\"text-sm text-text-secondary\">Loading your investments...</p>\n </div>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"My Investments\"\n description=\"Track and manage your investment portfolio\"\n purpose=\"The full list of carts you've invested in — filter by status, sort by return, and open any one to see its performance and payout history. This is where you manage and act on what you already hold.\"\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/opportunities')}\n className=\"flex items-center gap-2 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\"\n >\n <Plus className=\"h-4 w-4\" />\n New Investment\n </button>\n }\n >\n {/* Investment Summary (emphasis zone) */}\n <EmphasisPanel>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <MetricsCard\n icon={<Wallet className=\"h-5 w-5\" />}\n value={formatCurrency(mockSummary.totalInvested, { minimumFractionDigits: 0 })}\n label=\"Total Invested\"\n trend=\"up\"\n trendValue=\"Total amount invested\"\n />\n <MetricsCard\n icon={<IndianRupee className=\"h-5 w-5\" />}\n value={formatCurrency(mockSummary.currentValue, { minimumFractionDigits: 0 })}\n label=\"Current Value\"\n trend={mockSummary.profitLoss > 0 ? 'up' : 'down'}\n trendValue={`${mockSummary.profitLossPercentage > 0 ? '+' : ''}${mockSummary.profitLossPercentage}% total returns`}\n />\n <MetricsCard\n icon={<TrendingUp className=\"h-5 w-5\" />}\n value={formatCurrency(mockSummary.totalReturns, { minimumFractionDigits: 0 })}\n label=\"Total Returns\"\n trend=\"up\"\n trendValue=\"Total profit earned\"\n />\n <MetricsCard\n icon={<CheckCircle2 className=\"h-5 w-5\" />}\n value={String(mockSummary.activeInvestments)}\n label=\"Active Investments\"\n trend=\"neutral\"\n trendValue={`${mockSummary.averageRoi}% avg ROI`}\n />\n </div>\n </EmphasisPanel>\n\n {/* Filter Tabs */}\n <div className=\"mt-6 rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop\">\n <div className=\"flex flex-wrap gap-2\">\n {filterTabs.map((tab) => (\n <button\n key={tab.key}\n type=\"button\"\n onClick={() => setFilter(tab.key)}\n className={cn(\n 'flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors',\n filter === tab.key\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-primary hover:bg-bg-sunken/80'\n )}\n >\n {tab.label}\n <span\n className={cn(\n 'rounded-full px-2 py-0.5 text-xs',\n filter === tab.key\n ? 'bg-primary-foreground/20 text-action-primary-text'\n : 'bg-action-primary-bg/10 text-primary'\n )}\n >\n {getCount(tab.key)}\n </span>\n </button>\n ))}\n </div>\n </div>\n\n {/* Investments List */}\n <div className=\"mt-6 space-y-4\">\n {filteredInvestments.length > 0 ? (\n filteredInvestments.map((investment) => (\n <div key={investment.id} className=\"rounded-lg border border-border-seam bg-bg-surface p-4 sm:p-6 bg-gloss-card shadow-pop\">\n {/* Mobile Layout */}\n <div className=\"block space-y-4 lg:hidden\">\n <div className=\"flex items-start justify-between\">\n <div>\n <h3 className=\"text-lg font-semibold text-text-primary\">{investment.cartName}</h3>\n <p className=\"text-sm text-text-secondary\">by {investment.cartOwner}</p>\n </div>\n <span\n className={cn(\n 'flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium',\n getStatusColor(investment.status)\n )}\n >\n {getStatusIcon(investment.status)}\n <span className=\"capitalize\">{investment.status}</span>\n </span>\n </div>\n\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <p className=\"text-sm text-text-secondary\">Invested</p>\n <p className=\"font-semibold text-text-primary\">\n {formatCurrency(investment.investmentAmount, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">Current Value</p>\n <p className=\"font-semibold text-text-primary\">\n {formatCurrency(investment.currentValue, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">P&L</p>\n <p\n className={cn(\n 'font-semibold',\n investment.profitLoss >= 0\n ? 'text-status-success-text'\n : 'text-status-error-text'\n )}\n >\n {investment.profitLoss >= 0 ? '+' : ''}\n {formatCurrency(investment.profitLoss, { minimumFractionDigits: 0 })} (\n {investment.profitLossPercentage >= 0 ? '+' : ''}\n {investment.profitLossPercentage}%)\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">ROI</p>\n <p className=\"font-semibold text-text-primary\">{investment.roiAnnual}% p.a.</p>\n </div>\n </div>\n\n <div className=\"flex items-center justify-between border-t border-border-subtle pt-2\">\n <div>\n <p className=\"text-xs text-text-secondary\">Invested on</p>\n <p className=\"text-sm font-medium text-text-primary\">\n {formatDate(investment.investmentDate, {\n hour: undefined,\n minute: undefined,\n })}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/investor/investments/${investment.id}`)}\n className=\"flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Eye className=\"h-4 w-4\" />\n View Details\n </button>\n </div>\n </div>\n\n {/* Desktop Layout */}\n <div className=\"hidden lg:flex lg:items-center lg:justify-between\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"mb-2 flex items-center justify-between\">\n <h3 className=\"text-lg font-semibold text-text-primary\">{investment.cartName}</h3>\n <span\n className={cn(\n 'flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium',\n getStatusColor(investment.status)\n )}\n >\n {getStatusIcon(investment.status)}\n <span className=\"capitalize\">{investment.status}</span>\n </span>\n </div>\n <p className=\"mb-4 text-sm text-text-secondary\">by {investment.cartOwner}</p>\n\n <div className=\"grid grid-cols-5 gap-6\">\n <div>\n <p className=\"text-sm text-text-secondary\">Invested</p>\n <p className=\"font-semibold text-text-primary\">\n {formatCurrency(investment.investmentAmount, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">Current Value</p>\n <p className=\"font-semibold text-text-primary\">\n {formatCurrency(investment.currentValue, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">P&L</p>\n <p\n className={cn(\n 'font-semibold',\n investment.profitLoss >= 0\n ? 'text-status-success-text'\n : 'text-status-error-text'\n )}\n >\n {investment.profitLoss >= 0 ? '+' : ''}\n {formatCurrency(investment.profitLoss, { minimumFractionDigits: 0 })}\n </p>\n <p\n className={cn(\n 'text-xs',\n investment.profitLoss >= 0\n ? 'text-status-success-text'\n : 'text-status-error-text'\n )}\n >\n ({investment.profitLossPercentage >= 0 ? '+' : ''}\n {investment.profitLossPercentage}%)\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">ROI</p>\n <p className=\"font-semibold text-text-primary\">{investment.roiAnnual}% p.a.</p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">Invested on</p>\n <p className=\"font-semibold text-text-primary\">\n {formatDate(investment.investmentDate, {\n hour: undefined,\n minute: undefined,\n })}\n </p>\n </div>\n </div>\n </div>\n\n <div className=\"ml-6\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/investor/investments/${investment.id}`)}\n className=\"flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Eye className=\"h-4 w-4\" />\n View Details\n </button>\n </div>\n </div>\n </div>\n ))\n ) : (\n <EmptyState\n illustration=\"empty-data\"\n icon={<TrendingDown className=\"h-12 w-12\" />}\n title={`No ${filter !== 'all' ? filter : ''} investments found`}\n description={\n filter === 'all'\n ? \"You haven't made any investments yet. Start exploring opportunities to grow your wealth.\"\n : `You don't have any ${filter} investments at the moment.`\n }\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/opportunities')}\n 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\"\n >\n Explore Investment Opportunities\n </button>\n }\n />\n )}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;AAoEA,IAAM,IAAgC;CACpC;EACE,IAAI;EACJ,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,cAAc;EACd,YAAY;EACZ,sBAAsB;EACtB,gBAAgB;EAChB,QAAQ;EACR,WAAW;EACX,UAAU;EACV,YAAY;EACZ,cAAc;EACf;CACD;EACE,IAAI;EACJ,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,cAAc;EACd,YAAY;EACZ,sBAAsB;EACtB,gBAAgB;EAChB,QAAQ;EACR,WAAW;EACX,UAAU;EACV,YAAY;EACZ,cAAc;EACf;CACD;EACE,IAAI;EACJ,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,cAAc;EACd,YAAY;EACZ,sBAAsB;EACtB,gBAAgB;EAChB,QAAQ;EACR,WAAW;EACX,UAAU;EACV,YAAY;EACZ,cAAc;EACf;CACD;EACE,IAAI;EACJ,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,cAAc;EACd,YAAY;EACZ,sBAAsB;EACtB,gBAAgB;EAChB,QAAQ;EACR,WAAW;EACX,UAAU;EACV,YAAY;EACZ,cAAc;EACf;CACD;EACE,IAAI;EACJ,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,cAAc;EACd,YAAY;EACZ,s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