@burdenoff/microfe-kadaikodi 2026.704.1 → 2026.704.2

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.
Files changed (76) hide show
  1. package/dist/kadaikodi/hooks/useKadaikodiApi.js +77 -26
  2. package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
  3. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +341 -461
  4. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
  5. package/dist/kadaikodi/pages/admin/AdminDashboard.js +115 -399
  6. package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
  7. package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +140 -283
  8. package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
  9. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +282 -453
  10. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
  11. package/dist/kadaikodi/pages/admin/AdminProfilePage.js +115 -242
  12. package/dist/kadaikodi/pages/admin/AdminProfilePage.js.map +1 -1
  13. package/dist/kadaikodi/pages/admin/AdminSettingsPage.js +2 -2
  14. package/dist/kadaikodi/pages/admin/AdminSettingsPage.js.map +1 -1
  15. package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
  16. package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
  17. package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +503 -627
  18. package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
  19. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +339 -282
  20. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
  21. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +323 -422
  22. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
  23. package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +374 -383
  24. package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
  25. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +249 -208
  26. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
  27. package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +1 -1
  28. package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
  29. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +1 -1
  30. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
  31. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +171 -627
  32. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
  33. package/dist/kadaikodi/pages/common/HelpSupportPage.js +331 -415
  34. package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
  35. package/dist/kadaikodi/pages/common/NotificationCenterPage.js +18 -670
  36. package/dist/kadaikodi/pages/common/NotificationCenterPage.js.map +1 -1
  37. package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
  38. package/dist/kadaikodi/pages/customer/CheckoutPage.js +4 -2
  39. package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
  40. package/dist/kadaikodi/pages/customer/CustomerDashboard.js +191 -369
  41. package/dist/kadaikodi/pages/customer/CustomerDashboard.js.map +1 -1
  42. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +233 -389
  43. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
  44. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
  45. package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
  46. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
  47. package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js +76 -118
  48. package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js.map +1 -1
  49. package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
  50. package/dist/kadaikodi/pages/customer/SavedAddressesPage.js +135 -213
  51. package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
  52. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +272 -774
  53. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
  54. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +232 -343
  55. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
  56. package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js +112 -600
  57. package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
  58. package/dist/kadaikodi/pages/investor/InvestorDashboard.js +127 -294
  59. package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
  60. package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +204 -290
  61. package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js.map +1 -1
  62. package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js +159 -500
  63. package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js.map +1 -1
  64. package/dist/kadaikodi/pages/investor/InvestorProfilePage.js +399 -487
  65. package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
  66. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +13 -13
  67. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
  68. package/dist/kadaikodi/pages/worker/WorkerDashboard.js +192 -296
  69. package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
  70. package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +245 -397
  71. package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
  72. package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +85 -117
  73. package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
  74. package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +177 -395
  75. package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
  76. package/package.json +1 -1
@@ -3,583 +3,242 @@ import { cn as t } from "../../utils/cn.js";
3
3
  import { PageLayout as n } from "../../components/PageLayout.js";
4
4
  import { MetricsCard as r } from "../../components/MetricsCard.js";
5
5
  import { EmptyState as i } from "../../components/EmptyState.js";
6
- import { formatCurrency as a, formatDate as o } from "../../utils/formatters.js";
7
- import { useCallback as s, useMemo as c, useState as l } from "react";
8
- import { ArrowDownCircle as u, BarChart3 as d, Briefcase as f, CreditCard as p, Eye as m, IndianRupee as h, Star as g, TrendingDown as _, TrendingUp as v, Wallet as y } from "lucide-react";
9
- import { jsx as b, jsxs as x } from "react/jsx-runtime";
10
- import { EmphasisPanel as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
6
+ import { useInvestments as a } from "../../hooks/useKadaikodiApi.js";
7
+ import { formatCurrency as o, formatDate as s } from "../../utils/formatters.js";
8
+ import { useMemo as c, useState as l } from "react";
9
+ import { BarChart3 as u, Briefcase as d, CreditCard as f, Eye as p, IndianRupee as m, TrendingUp as h, Wallet as g } from "lucide-react";
10
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
11
+ import { EmphasisPanel as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
11
12
  //#region src/kadaikodi/pages/investor/InvestorPortfolioPage.tsx
12
- var w = [
13
- {
14
- id: "inv-001",
15
- cartId: "SERV-001",
16
- cartName: "Quick Cuts Salon",
17
- cartOwner: "Ravi Kumar",
18
- investmentDate: "2023-06-15",
19
- amount: 5e4,
20
- currentValue: 62500,
21
- returns: 12500,
22
- returnsPercentage: 25,
23
- ownership: 15,
24
- status: "active",
25
- monthlyRevenue: 185e3,
26
- monthlyDividend: 2775,
27
- nextPayoutDate: "2024-07-01",
28
- riskLevel: "low",
29
- category: "Personal Care & Beauty",
30
- location: "Indiranagar, Bangalore",
31
- performanceMetrics: {
32
- monthlyOrders: 1250,
33
- averageRating: 4.8,
34
- growthRate: 12
35
- }
36
- },
37
- {
38
- id: "inv-002",
39
- cartId: "SERV-003",
40
- cartName: "Fix-It Mobile Repair",
41
- cartOwner: "Amit Sharma",
42
- investmentDate: "2023-08-20",
43
- amount: 3e4,
44
- currentValue: 35400,
45
- returns: 5400,
46
- returnsPercentage: 18,
47
- ownership: 10,
48
- status: "active",
49
- monthlyRevenue: 12e4,
50
- monthlyDividend: 1200,
51
- nextPayoutDate: "2024-07-01",
52
- riskLevel: "medium",
53
- category: "Repair & Maintenance",
54
- location: "Jayanagar, Bangalore",
55
- performanceMetrics: {
56
- monthlyOrders: 890,
57
- averageRating: 4.6,
58
- growthRate: 8
59
- }
60
- },
61
- {
62
- id: "inv-003",
63
- cartId: "SERV-005",
64
- cartName: "Spotless Cleaning Services",
65
- cartOwner: "Priya Cleaning",
66
- investmentDate: "2023-04-10",
67
- amount: 4e4,
68
- currentValue: 52e3,
69
- returns: 12e3,
70
- returnsPercentage: 30,
71
- ownership: 20,
72
- status: "active",
73
- monthlyRevenue: 95e3,
74
- monthlyDividend: 1900,
75
- nextPayoutDate: "2024-07-01",
76
- riskLevel: "low",
77
- category: "Home Services",
78
- location: "HSR Layout, Bangalore",
79
- performanceMetrics: {
80
- monthlyOrders: 1450,
81
- averageRating: 4.7,
82
- growthRate: 15
83
- }
84
- },
85
- {
86
- id: "inv-004",
87
- cartId: "FOOD-001",
88
- cartName: "Dosa Express",
89
- cartOwner: "Rajesh Kumar",
90
- investmentDate: "2023-10-05",
91
- amount: 25e3,
92
- currentValue: 27500,
93
- returns: 2500,
94
- returnsPercentage: 10,
95
- ownership: 5,
96
- status: "active",
97
- monthlyRevenue: 15e4,
98
- monthlyDividend: 750,
99
- nextPayoutDate: "2024-07-01",
100
- riskLevel: "high",
101
- category: "Food & Beverage",
102
- location: "Koramangala, Bangalore",
103
- performanceMetrics: {
104
- monthlyOrders: 780,
105
- averageRating: 4.5,
106
- growthRate: 5
107
- }
108
- }
109
- ], T = [
110
- {
111
- id: "txn-001",
112
- type: "investment",
113
- cartName: "Quick Cuts Salon",
114
- amount: 5e4,
115
- date: "2023-06-15",
116
- status: "completed"
117
- },
118
- {
119
- id: "txn-002",
120
- type: "dividend",
121
- cartName: "Quick Cuts Salon",
122
- amount: 2775,
123
- date: "2024-06-01",
124
- status: "completed"
125
- },
126
- {
127
- id: "txn-003",
128
- type: "dividend",
129
- cartName: "Fix-It Mobile Repair",
130
- amount: 1200,
131
- date: "2024-06-01",
132
- status: "completed"
133
- },
134
- {
135
- id: "txn-004",
136
- type: "investment",
137
- cartName: "Spotless Cleaning Services",
138
- amount: 4e4,
139
- date: "2023-04-10",
140
- status: "completed"
141
- },
142
- {
143
- id: "txn-005",
144
- type: "dividend",
145
- cartName: "Spotless Cleaning Services",
146
- amount: 1900,
147
- date: "2024-06-01",
148
- status: "pending"
149
- }
150
- ], E = [
151
- "",
152
- "Personal Care & Beauty",
153
- "Repair & Maintenance",
154
- "Home Services",
155
- "Food & Beverage"
156
- ];
157
- function D(e) {
158
- let { color: n, label: r } = {
159
- low: {
160
- color: "bg-status-success-bg-subtle text-status-success-text",
161
- label: "Low Risk"
162
- },
163
- medium: {
164
- color: "bg-status-warning-bg-subtle text-status-warning-text",
165
- label: "Medium Risk"
166
- },
167
- high: {
168
- color: "bg-status-error-bg-subtle text-status-error-text",
169
- label: "High Risk"
170
- }
171
- }[e];
172
- return /* @__PURE__ */ b("span", {
173
- className: t("rounded-full px-2 py-0.5 text-xs font-medium", n),
174
- children: r
175
- });
176
- }
177
- function O(e) {
13
+ function x(e) {
178
14
  return `${e > 0 ? "+" : ""}${e.toFixed(1)}%`;
179
15
  }
180
- function k() {
181
- let { navigateTo: k } = e(), [A, j] = l("overview"), [M, N] = l(""), P = c(() => M ? w.filter((e) => e.category === M) : w, [M]), F = P.reduce((e, t) => e + t.amount, 0), I = P.reduce((e, t) => e + t.currentValue, 0), L = I - F, R = F > 0 ? L / F * 100 : 0, z = P.reduce((e, t) => e + t.monthlyDividend, 0), B = P.filter((e) => e.status === "active").length, V = {
182
- low: 1,
183
- medium: 2,
184
- high: 3
185
- }, H = P.length > 0 ? P.reduce((e, t) => e + V[t.riskLevel], 0) / P.length : 0, U = P.reduce((e, t) => t.returnsPercentage > e.returnsPercentage ? t : e, P[0] || {
186
- cartName: "",
187
- returnsPercentage: 0
188
- }), W = s((e) => {
189
- alert(`Withdrawal request submitted for ${e}`);
190
- }, []), G = P.reduce((e, t) => (e[t.category] = (e[t.category] || 0) + t.currentValue, e), {});
191
- return /* @__PURE__ */ x(n, {
16
+ function S() {
17
+ let { navigateTo: S, currentUser: C } = e(), { data: w = [], isLoading: T } = a(C?.id || ""), [E, D] = l("overview"), O = w.reduce((e, t) => e + t.investedAmount, 0), k = w.reduce((e, t) => e + t.currentValue, 0), A = k - O, j = O > 0 ? A / O * 100 : 0, M = w.filter((e) => e.status === "active").length, N = c(() => w.reduce((e, t) => (e[t.cartName] = (e[t.cartName] || 0) + t.currentValue, e), {}), [w]);
18
+ return T ? /* @__PURE__ */ _(n, {
19
+ title: "My Portfolio",
20
+ description: "Loading your portfolio...",
21
+ children: /* @__PURE__ */ _("div", {
22
+ className: "flex items-center justify-center py-20",
23
+ children: /* @__PURE__ */ v("div", {
24
+ className: "text-center",
25
+ children: [/* @__PURE__ */ _("div", { className: "mx-auto mb-4 h-12 w-12 animate-spin rounded-full border-b-2 border-primary" }), /* @__PURE__ */ _("p", {
26
+ className: "text-sm text-text-secondary",
27
+ children: "Loading your portfolio..."
28
+ })]
29
+ })
30
+ })
31
+ }) : /* @__PURE__ */ v(n, {
192
32
  title: "My Portfolio",
193
33
  description: "Track your investment performance and holdings",
194
34
  children: [
195
- /* @__PURE__ */ b(C, {
35
+ /* @__PURE__ */ _(b, {
196
36
  className: "mb-6",
197
- children: "The complete picture of your money on Kadaikodi. Use this page to see how your portfolio is performing overall, how it's split across categories and risk levels, the dividends coming your way, and a full history of your transactions. Switch tabs to drill into your holdings or activity, and open any holding to manage it."
37
+ children: "The complete picture of your money on Kadaikodi. Use this page to see how your portfolio is performing overall, how it's split across the carts you've backed, and the details of each holding. Switch tabs to drill into your holdings, and open any holding to review it."
198
38
  }),
199
- /* @__PURE__ */ x(S, { children: [/* @__PURE__ */ b("h2", {
39
+ /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ _("h2", {
200
40
  className: "mb-4 text-base font-semibold text-text-primary",
201
41
  children: "Portfolio at a Glance"
202
- }), /* @__PURE__ */ x("div", {
42
+ }), /* @__PURE__ */ v("div", {
203
43
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
204
44
  children: [
205
- /* @__PURE__ */ b(r, {
206
- icon: /* @__PURE__ */ b(y, { className: "h-5 w-5" }),
207
- value: a(F, { minimumFractionDigits: 0 }),
45
+ /* @__PURE__ */ _(r, {
46
+ icon: /* @__PURE__ */ _(g, { className: "h-5 w-5" }),
47
+ value: o(O, { minimumFractionDigits: 0 }),
208
48
  label: "Total Invested",
209
- trend: "up",
210
- trendValue: `${B} active`
49
+ trend: "neutral",
50
+ trendValue: `${M} active`
211
51
  }),
212
- /* @__PURE__ */ b(r, {
213
- icon: /* @__PURE__ */ b(h, { className: "h-5 w-5" }),
214
- value: a(I, { minimumFractionDigits: 0 }),
52
+ /* @__PURE__ */ _(r, {
53
+ icon: /* @__PURE__ */ _(m, { className: "h-5 w-5" }),
54
+ value: o(k, { minimumFractionDigits: 0 }),
215
55
  label: "Current Value",
216
- trend: R > 0 ? "up" : "down",
217
- trendValue: O(R)
56
+ trend: j >= 0 ? "up" : "down",
57
+ trendValue: x(j)
218
58
  }),
219
- /* @__PURE__ */ b(r, {
220
- icon: /* @__PURE__ */ b(v, { className: "h-5 w-5" }),
221
- value: a(Math.abs(L), { minimumFractionDigits: 0 }),
59
+ /* @__PURE__ */ _(r, {
60
+ icon: /* @__PURE__ */ _(h, { className: "h-5 w-5" }),
61
+ value: o(Math.abs(A), { minimumFractionDigits: 0 }),
222
62
  label: "Total Returns",
223
- trend: L >= 0 ? "up" : "down",
224
- trendValue: O(R)
63
+ trend: A >= 0 ? "up" : "down",
64
+ trendValue: x(j)
225
65
  }),
226
- /* @__PURE__ */ b(r, {
227
- icon: /* @__PURE__ */ b(f, { className: "h-5 w-5" }),
228
- value: a(z, { minimumFractionDigits: 0 }),
229
- label: "Monthly Dividend",
230
- trend: "up",
231
- trendValue: "Next: July 1"
66
+ /* @__PURE__ */ _(r, {
67
+ icon: /* @__PURE__ */ _(d, { className: "h-5 w-5" }),
68
+ value: String(w.length),
69
+ label: "Holdings"
232
70
  })
233
71
  ]
234
72
  })] }),
235
- /* @__PURE__ */ x("div", {
236
- className: "mt-4 grid grid-cols-2 gap-3 lg:grid-cols-4",
237
- children: [
238
- /* @__PURE__ */ x("div", {
239
- className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
240
- children: [/* @__PURE__ */ b("p", {
241
- className: "text-xs text-text-secondary",
242
- children: "Active Investments"
243
- }), /* @__PURE__ */ b("p", {
244
- className: "text-xl font-bold text-text-primary",
245
- children: B
246
- })]
247
- }),
248
- /* @__PURE__ */ x("div", {
249
- className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
250
- children: [/* @__PURE__ */ b("p", {
251
- className: "text-xs text-text-secondary",
252
- children: "Avg Risk Score"
253
- }), /* @__PURE__ */ x("div", {
254
- className: "mt-1 flex items-center gap-2",
255
- children: [/* @__PURE__ */ b("div", {
256
- className: "h-2 flex-1 rounded-full bg-bg-sunken overflow-hidden",
257
- children: /* @__PURE__ */ b("div", {
258
- className: t("h-full rounded-full", H <= 1.5 ? "bg-status-success-text" : H <= 2.5 ? "bg-status-warning-text" : "bg-status-error-text"),
259
- style: { width: `${H / 3 * 100}%` }
260
- })
261
- }), /* @__PURE__ */ x("span", {
262
- className: "text-sm font-medium text-text-primary",
263
- children: [H.toFixed(1), "/3"]
264
- })]
265
- })]
266
- }),
267
- /* @__PURE__ */ x("div", {
268
- className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
269
- children: [
270
- /* @__PURE__ */ b("p", {
271
- className: "text-xs text-text-secondary",
272
- children: "Best Performer"
273
- }),
274
- /* @__PURE__ */ b("p", {
275
- className: "truncate text-sm font-bold text-text-primary",
276
- children: U.cartName
277
- }),
278
- /* @__PURE__ */ b("p", {
279
- className: "text-xs text-status-success-text",
280
- children: O(U.returnsPercentage)
281
- })
282
- ]
283
- }),
284
- /* @__PURE__ */ x("div", {
285
- className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
286
- children: [
287
- /* @__PURE__ */ b("p", {
288
- className: "text-xs text-text-secondary",
289
- children: "Next Payout"
290
- }),
291
- /* @__PURE__ */ b("p", {
292
- className: "text-lg font-bold text-text-primary",
293
- children: "July 1"
294
- }),
295
- /* @__PURE__ */ b("p", {
296
- className: "text-xs text-text-secondary",
297
- children: "In 7 days"
298
- })
299
- ]
300
- })
301
- ]
302
- }),
303
- /* @__PURE__ */ x("div", {
73
+ /* @__PURE__ */ v("div", {
304
74
  className: "mt-6 rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
305
- children: [/* @__PURE__ */ b("div", {
75
+ children: [/* @__PURE__ */ _("div", {
306
76
  className: "flex border-b border-border-subtle overflow-x-auto",
307
77
  children: [
308
78
  {
309
79
  key: "overview",
310
80
  label: "Overview",
311
- Icon: d
81
+ Icon: u
312
82
  },
313
83
  {
314
84
  key: "investments",
315
- label: `Investments (${P.length})`,
316
- Icon: f
85
+ label: `Investments (${w.length})`,
86
+ Icon: d
317
87
  },
318
88
  {
319
89
  key: "transactions",
320
90
  label: "Transactions",
321
- Icon: p
91
+ Icon: f
322
92
  }
323
- ].map(({ key: e, label: n, Icon: r }) => /* @__PURE__ */ x("button", {
93
+ ].map(({ key: e, label: n, Icon: r }) => /* @__PURE__ */ v("button", {
324
94
  type: "button",
325
- onClick: () => j(e),
326
- className: t("flex items-center gap-2 whitespace-nowrap px-4 py-3 text-sm font-medium transition-colors", A === e ? "border-b-2 border-primary text-text-primary" : "text-text-secondary hover:text-text-primary"),
327
- children: [/* @__PURE__ */ b(r, { className: "h-4 w-4" }), n]
95
+ onClick: () => D(e),
96
+ className: t("flex items-center gap-2 whitespace-nowrap px-4 py-3 text-sm font-medium transition-colors", E === e ? "border-b-2 border-primary text-text-primary" : "text-text-secondary hover:text-text-primary"),
97
+ children: [/* @__PURE__ */ _(r, { className: "h-4 w-4" }), n]
328
98
  }, e))
329
- }), /* @__PURE__ */ x("div", {
99
+ }), /* @__PURE__ */ v("div", {
330
100
  className: "p-4",
331
101
  children: [
332
- A === "overview" && /* @__PURE__ */ x("div", {
102
+ E === "overview" && /* @__PURE__ */ _("div", {
333
103
  className: "space-y-6",
334
- children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h3", {
335
- className: "mb-4 text-base font-semibold text-text-primary",
336
- children: "Portfolio Performance"
337
- }), /* @__PURE__ */ x("div", {
338
- className: "rounded-lg border border-border-subtle bg-bg-sunken/50 p-8 text-center",
339
- children: [
340
- /* @__PURE__ */ b(d, { className: "mx-auto mb-2 h-8 w-8 text-text-secondary/50" }),
341
- /* @__PURE__ */ b("p", {
342
- className: "text-sm text-text-secondary",
343
- children: "Performance chart visualization"
344
- }),
345
- /* @__PURE__ */ b("p", {
346
- className: "mt-1 text-xs text-text-secondary",
347
- children: "Shows portfolio value over time"
348
- })
349
- ]
350
- })] }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h3", {
104
+ children: w.length === 0 ? /* @__PURE__ */ _(i, {
105
+ illustration: "empty-data",
106
+ title: "No holdings yet",
107
+ description: "Once you back a cart, your portfolio allocation will appear here.",
108
+ action: /* @__PURE__ */ _("button", {
109
+ type: "button",
110
+ onClick: () => S("/investor/opportunities"),
111
+ 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",
112
+ children: "Browse Opportunities"
113
+ })
114
+ }) : /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h3", {
351
115
  className: "mb-4 text-base font-semibold text-text-primary",
352
- children: "Asset Allocation"
353
- }), /* @__PURE__ */ b("div", {
116
+ children: "Allocation by Cart"
117
+ }), /* @__PURE__ */ _("div", {
354
118
  className: "space-y-3",
355
- children: Object.entries(G).map(([e, t]) => /* @__PURE__ */ x("div", {
119
+ children: Object.entries(N).map(([e, t]) => /* @__PURE__ */ v("div", {
356
120
  className: "flex items-center",
357
121
  children: [
358
- /* @__PURE__ */ b("span", {
122
+ /* @__PURE__ */ _("span", {
359
123
  className: "w-40 truncate text-sm text-text-primary",
360
124
  children: e
361
125
  }),
362
- /* @__PURE__ */ b("div", {
126
+ /* @__PURE__ */ _("div", {
363
127
  className: "mx-3 h-6 flex-1 rounded-full bg-bg-sunken overflow-hidden",
364
- children: /* @__PURE__ */ b("div", {
128
+ children: /* @__PURE__ */ _("div", {
365
129
  className: "flex h-6 items-center justify-end rounded-full bg-action-primary-bg pr-2",
366
- style: { width: `${I > 0 ? t / I * 100 : 0}%` },
367
- children: /* @__PURE__ */ x("span", {
130
+ style: { width: `${k > 0 ? t / k * 100 : 0}%` },
131
+ children: /* @__PURE__ */ v("span", {
368
132
  className: "text-xs font-medium text-action-primary-text",
369
- children: [I > 0 ? (t / I * 100).toFixed(1) : 0, "%"]
133
+ children: [k > 0 ? (t / k * 100).toFixed(1) : 0, "%"]
370
134
  })
371
135
  })
372
136
  }),
373
- /* @__PURE__ */ b("span", {
137
+ /* @__PURE__ */ _("span", {
374
138
  className: "ml-2 text-sm font-medium text-text-primary",
375
- children: a(t, { minimumFractionDigits: 0 })
139
+ children: o(t, { minimumFractionDigits: 0 })
376
140
  })
377
141
  ]
378
142
  }, e))
379
- })] })]
143
+ })] })
380
144
  }),
381
- A === "investments" && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("div", {
382
- className: "mb-4",
383
- children: /* @__PURE__ */ x("select", {
384
- value: M,
385
- onChange: (e) => N(e.target.value),
386
- className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
387
- children: [/* @__PURE__ */ b("option", {
388
- value: "",
389
- children: "All Categories"
390
- }), E.filter(Boolean).map((e) => /* @__PURE__ */ b("option", {
391
- value: e,
392
- children: e
393
- }, e))]
394
- })
395
- }), P.length === 0 ? /* @__PURE__ */ b(i, {
396
- illustration: M ? "empty-search" : "empty-data",
145
+ E === "investments" && /* @__PURE__ */ _("div", { children: w.length === 0 ? /* @__PURE__ */ _(i, {
146
+ illustration: "empty-data",
397
147
  title: "No holdings to show",
398
- description: M ? "No holdings in this category. Try a different one or clear the filter." : "You don't hold any investments yet. Explore opportunities to start building your portfolio.",
399
- action: M ? /* @__PURE__ */ b("button", {
148
+ description: "You don't hold any investments yet. Explore opportunities to start building your portfolio.",
149
+ action: /* @__PURE__ */ _("button", {
400
150
  type: "button",
401
- onClick: () => N(""),
402
- className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
403
- children: "Clear filter"
404
- }) : /* @__PURE__ */ b("button", {
405
- type: "button",
406
- onClick: () => k("/investor/opportunities"),
151
+ onClick: () => S("/investor/opportunities"),
407
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",
408
153
  children: "Browse Opportunities"
409
154
  })
410
- }) : /* @__PURE__ */ b("div", {
155
+ }) : /* @__PURE__ */ _("div", {
411
156
  className: "space-y-4",
412
- children: P.map((e) => /* @__PURE__ */ x("div", {
413
- className: "rounded-lg border border-border-subtle p-4 hover:bg-accent/50 transition-colors",
414
- children: [
415
- /* @__PURE__ */ x("div", {
416
- className: "mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
417
- children: [/* @__PURE__ */ x("div", {
418
- className: "flex-1",
419
- children: [
420
- /* @__PURE__ */ b("h4", {
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", {
421
167
  className: "text-base font-semibold text-text-primary",
422
168
  children: e.cartName
423
- }),
424
- /* @__PURE__ */ x("p", {
425
- className: "text-sm text-text-secondary",
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"),
426
180
  children: [
427
- "Owned by ",
428
- e.cartOwner,
429
- " • ",
430
- e.location
181
+ o(Math.abs(n), { minimumFractionDigits: 0 }),
182
+ " (",
183
+ x(r),
184
+ ")"
431
185
  ]
432
- }),
433
- /* @__PURE__ */ x("div", {
434
- className: "mt-2 flex flex-wrap items-center gap-2",
435
- children: [/* @__PURE__ */ b("span", {
436
- className: "text-sm text-text-secondary",
437
- children: e.category
438
- }), D(e.riskLevel)]
439
- })
440
- ]
441
- }), /* @__PURE__ */ x("div", {
442
- className: "text-left sm:text-right",
443
- children: [/* @__PURE__ */ b("p", {
444
- className: "text-xl font-bold text-text-primary",
445
- children: a(e.currentValue, { minimumFractionDigits: 0 })
446
- }), /* @__PURE__ */ x("p", {
447
- className: t("text-sm", e.returns > 0 ? "text-status-success-text" : "text-status-error-text"),
448
- children: [
449
- a(Math.abs(e.returns), { minimumFractionDigits: 0 }),
450
- " (",
451
- O(e.returnsPercentage),
452
- ")"
453
- ]
186
+ })]
454
187
  })]
455
- })]
456
- }),
457
- /* @__PURE__ */ x("div", {
458
- className: "mb-4 grid grid-cols-2 gap-3 lg:grid-cols-4",
459
- children: [
460
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
461
- className: "text-xs text-text-secondary",
462
- children: "Invested"
463
- }), /* @__PURE__ */ b("p", {
464
- className: "text-sm font-medium text-text-primary",
465
- children: a(e.amount, { minimumFractionDigits: 0 })
466
- })] }),
467
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
468
- className: "text-xs text-text-secondary",
469
- children: "Ownership"
470
- }), /* @__PURE__ */ x("p", {
471
- className: "text-sm font-medium text-text-primary",
472
- children: [e.ownership, "%"]
473
- })] }),
474
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
475
- className: "text-xs text-text-secondary",
476
- children: "Monthly Dividend"
477
- }), /* @__PURE__ */ b("p", {
478
- className: "text-sm font-medium text-text-primary",
479
- children: a(e.monthlyDividend, { minimumFractionDigits: 0 })
480
- })] }),
481
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
482
- className: "text-xs text-text-secondary",
483
- children: "Investment Date"
484
- }), /* @__PURE__ */ b("p", {
485
- className: "text-sm font-medium text-text-primary",
486
- children: o(e.investmentDate, {
487
- hour: void 0,
488
- minute: void 0
489
- })
490
- })] })
491
- ]
492
- }),
493
- /* @__PURE__ */ x("div", {
494
- className: "border-t border-border-subtle pt-4",
495
- children: [/* @__PURE__ */ b("p", {
496
- className: "mb-2 text-sm font-medium text-text-secondary",
497
- children: "Performance Metrics"
498
- }), /* @__PURE__ */ x("div", {
499
- className: "grid grid-cols-3 gap-3 text-center",
188
+ }),
189
+ /* @__PURE__ */ v("div", {
190
+ className: "mb-4 grid grid-cols-2 gap-3 lg:grid-cols-4",
500
191
  children: [
501
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
502
- className: "text-lg font-bold text-text-primary",
503
- children: e.performanceMetrics.monthlyOrders
504
- }), /* @__PURE__ */ b("p", {
192
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
505
193
  className: "text-xs text-text-secondary",
506
- children: "Monthly Orders"
194
+ children: "Invested"
195
+ }), /* @__PURE__ */ _("p", {
196
+ className: "text-sm font-medium text-text-primary",
197
+ children: o(e.investedAmount, { minimumFractionDigits: 0 })
507
198
  })] }),
508
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("div", {
509
- className: "flex items-center justify-center gap-1",
510
- children: [/* @__PURE__ */ b(g, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }), /* @__PURE__ */ b("p", {
511
- className: "text-lg font-bold text-text-primary",
512
- children: e.performanceMetrics.averageRating
513
- })]
514
- }), /* @__PURE__ */ b("p", {
199
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
515
200
  className: "text-xs text-text-secondary",
516
- children: "Rating"
201
+ children: "Returns"
202
+ }), /* @__PURE__ */ _("p", {
203
+ className: "text-sm font-medium text-text-primary",
204
+ children: o(e.returns, { minimumFractionDigits: 0 })
517
205
  })] }),
518
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("p", {
519
- className: "text-lg font-bold text-status-success-text",
520
- children: [
521
- "+",
522
- e.performanceMetrics.growthRate,
523
- "%"
524
- ]
525
- }), /* @__PURE__ */ b("p", {
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", {
526
214
  className: "text-xs text-text-secondary",
527
- children: "Growth Rate"
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
+ })
528
222
  })] })
529
223
  ]
530
- })]
531
- }),
532
- /* @__PURE__ */ x("div", {
533
- className: "mt-4 flex flex-wrap gap-2",
534
- children: [/* @__PURE__ */ x("button", {
535
- type: "button",
536
- onClick: () => k(`/investor/investments/${e.id}`),
537
- 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",
538
- children: [/* @__PURE__ */ b(m, { className: "h-4 w-4" }), "View Details"]
539
- }), e.status === "active" && /* @__PURE__ */ x("button", {
540
- type: "button",
541
- onClick: () => W(e.id),
542
- 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",
543
- children: [/* @__PURE__ */ b(u, { className: "h-4 w-4" }), "Withdraw"]
544
- })]
545
- })
546
- ]
547
- }, e.id))
548
- })] }),
549
- A === "transactions" && /* @__PURE__ */ b("div", {
550
- className: "space-y-3",
551
- children: T.map((e) => /* @__PURE__ */ x("div", {
552
- className: "flex flex-col gap-3 rounded-lg border border-border-subtle p-4 hover:bg-accent/50 transition-colors sm:flex-row sm:items-center sm:justify-between",
553
- children: [/* @__PURE__ */ x("div", {
554
- className: "flex items-center gap-3",
555
- children: [/* @__PURE__ */ b("div", {
556
- className: t("flex h-10 w-10 shrink-0 items-center justify-center rounded-full", e.type === "investment" ? "bg-[var(--color-accent-soft)]" : e.type === "dividend" ? "bg-status-success-bg-subtle" : "bg-status-error-bg-subtle"),
557
- children: e.type === "investment" ? /* @__PURE__ */ b(y, { className: "h-5 w-5 text-text-primary" }) : e.type === "dividend" ? /* @__PURE__ */ b(v, { className: "h-5 w-5 text-status-success-text" }) : /* @__PURE__ */ b(_, { className: "h-5 w-5 text-status-error-text" })
558
- }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("p", {
559
- className: "text-sm font-medium text-text-primary",
560
- children: [
561
- e.type === "investment" ? "Investment in" : e.type === "dividend" ? "Dividend from" : "Withdrawal from",
562
- " ",
563
- e.cartName
564
- ]
565
- }), /* @__PURE__ */ b("p", {
566
- className: "text-xs text-text-secondary",
567
- children: o(e.date, {
568
- hour: void 0,
569
- minute: void 0
224
+ }),
225
+ /* @__PURE__ */ _("div", {
226
+ className: "flex flex-wrap gap-2",
227
+ children: /* @__PURE__ */ v("button", {
228
+ type: "button",
229
+ onClick: () => S(`/investor/investments/${e.id}`),
230
+ 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",
231
+ children: [/* @__PURE__ */ _(p, { className: "h-4 w-4" }), "View Details"]
232
+ })
570
233
  })
571
- })] })]
572
- }), /* @__PURE__ */ x("div", {
573
- className: "flex items-center justify-between sm:gap-4",
574
- children: [/* @__PURE__ */ x("p", {
575
- className: t("text-sm font-bold", e.type === "dividend" ? "text-status-success-text" : "text-text-primary"),
576
- children: [e.type === "dividend" ? "+" : "-", a(e.amount, { minimumFractionDigits: 0 })]
577
- }), /* @__PURE__ */ b("span", {
578
- className: t("rounded-full px-2.5 py-0.5 text-xs font-medium", e.status === "completed" ? "bg-status-success-bg-subtle text-status-success-text" : e.status === "pending" ? "bg-status-warning-bg-subtle text-status-warning-text" : "bg-status-error-bg-subtle text-status-error-text"),
579
- children: e.status
580
- })]
581
- })]
582
- }, e.id))
234
+ ]
235
+ }, e.id);
236
+ })
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."
583
242
  })
584
243
  ]
585
244
  })]
@@ -588,6 +247,6 @@ function k() {
588
247
  });
589
248
  }
590
249
  //#endregion
591
- export { k as InvestorPortfolioPage };
250
+ export { S as InvestorPortfolioPage };
592
251
 
593
252
  //# sourceMappingURL=InvestorPortfolioPage.js.map