@burdenoff/microfe-adaptercloud 2026.614.1 → 2026.625.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.
Files changed (110) hide show
  1. package/dist/adaptercloud/components/EmptyState.js +17 -21
  2. package/dist/adaptercloud/components/EmptyState.js.map +1 -1
  3. package/dist/adaptercloud/components/InvestmentCard.js +30 -28
  4. package/dist/adaptercloud/components/InvestmentCard.js.map +1 -1
  5. package/dist/adaptercloud/components/MetricsCard.js +21 -15
  6. package/dist/adaptercloud/components/MetricsCard.js.map +1 -1
  7. package/dist/adaptercloud/components/PageLayout.js +38 -19
  8. package/dist/adaptercloud/components/PageLayout.js.map +1 -1
  9. package/dist/adaptercloud/components/RatingDisplay.js +3 -3
  10. package/dist/adaptercloud/components/RatingDisplay.js.map +1 -1
  11. package/dist/adaptercloud/components/StatusBadge.js +36 -16
  12. package/dist/adaptercloud/components/StatusBadge.js.map +1 -1
  13. package/dist/adaptercloud/pages/HomePage.js +286 -275
  14. package/dist/adaptercloud/pages/HomePage.js.map +1 -1
  15. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +87 -87
  16. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -1
  17. package/dist/adaptercloud/pages/admin/AdminDashboard.js +101 -101
  18. package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -1
  19. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +48 -48
  20. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -1
  21. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +95 -95
  22. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -1
  23. package/dist/adaptercloud/pages/admin/AdminProfilePage.js +34 -34
  24. package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -1
  25. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +40 -40
  26. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -1
  27. package/dist/adaptercloud/pages/admin/CartManagementPage.js +107 -107
  28. package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -1
  29. package/dist/adaptercloud/pages/admin/UserManagementPage.js +98 -98
  30. package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -1
  31. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +117 -117
  32. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
  33. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +33 -33
  34. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
  35. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +112 -109
  36. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
  37. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +115 -115
  38. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
  39. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +85 -85
  40. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
  41. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +106 -106
  42. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -1
  43. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +88 -88
  44. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -1
  45. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +94 -94
  46. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -1
  47. package/dist/adaptercloud/pages/common/HelpSupportPage.js +142 -142
  48. package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -1
  49. package/dist/adaptercloud/pages/common/NotificationCenterPage.js +67 -66
  50. package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -1
  51. package/dist/adaptercloud/pages/common/SettingsPage.js +115 -115
  52. package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -1
  53. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +74 -73
  54. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -1
  55. package/dist/adaptercloud/pages/customer/CartDetailPage.js +87 -86
  56. package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -1
  57. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +66 -65
  58. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -1
  59. package/dist/adaptercloud/pages/customer/CheckoutPage.js +80 -80
  60. package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -1
  61. package/dist/adaptercloud/pages/customer/CustomerDashboard.js +88 -88
  62. package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -1
  63. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +84 -84
  64. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -1
  65. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +92 -91
  66. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -1
  67. package/dist/adaptercloud/pages/customer/FavoritesPage.js +34 -33
  68. package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -1
  69. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +44 -43
  70. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -1
  71. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +61 -60
  72. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -1
  73. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +58 -57
  74. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -1
  75. package/dist/adaptercloud/pages/customer/ReviewsPage.js +48 -47
  76. package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -1
  77. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +46 -45
  78. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -1
  79. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +128 -128
  80. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -1
  81. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +88 -87
  82. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
  83. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +88 -88
  84. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -1
  85. package/dist/adaptercloud/pages/investor/InvestorDashboard.js +62 -62
  86. package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -1
  87. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +39 -38
  88. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -1
  89. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +66 -66
  90. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -1
  91. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +153 -153
  92. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -1
  93. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +81 -80
  94. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -1
  95. package/dist/adaptercloud/pages/worker/WorkerDashboard.js +106 -106
  96. package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -1
  97. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +73 -72
  98. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -1
  99. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +107 -107
  100. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -1
  101. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +71 -69
  102. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -1
  103. package/dist/adaptercloud/utils/cn.js +2 -2
  104. package/dist/node_modules/{.bun/clsx@2.1.1/node_modules/clsx → clsx}/dist/clsx.js +1 -1
  105. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  106. package/dist/node_modules/{.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge → tailwind-merge}/dist/bundle-mjs.js +212 -170
  107. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  108. package/package.json +3 -3
  109. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +0 -1
  110. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"InvestorDashboard.js","names":[],"sources":["../../../../src/adaptercloud/pages/investor/InvestorDashboard.tsx"],"sourcesContent":["/**\n * Investor Dashboard Page\n * @module adaptercloud/pages/investor\n *\n * Portfolio overview with metrics, tab navigation (portfolio/opportunities),\n * AI insights sidebar, quick actions, market updates, and recent activity.\n */\n\nimport { useState, useEffect, useMemo } from 'react';\nimport {\n Wallet,\n TrendingUp,\n PieChart,\n Briefcase,\n ArrowRight,\n Activity,\n IndianRupee,\n Target,\n Award,\n Filter,\n Eye,\n Plus,\n MapPin,\n Lightbulb,\n BarChart3,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { MetricsCard } from '../../components/MetricsCard';\nimport { InvestmentCard } from '../../components/InvestmentCard';\nimport { RatingDisplay } from '../../components/RatingDisplay';\nimport { useAdapterCloud } from '../../context/AdapterCloudContext';\nimport { useInvestmentOpportunities, useInvestments } from '../../hooks/useAdapterCloudApi';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency } from '../../utils/formatters';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ninterface DashboardInvestment {\n id: string;\n cartName: string;\n cartOwner: string;\n investmentAmount: number;\n equityPercentage: number;\n investmentDate: string;\n currentValue: number;\n monthlyReturns: number;\n status: 'active' | 'pending' | 'completed';\n location: string;\n category: string;\n rating: number;\n riskLevel: 'low' | 'medium' | 'high';\n}\n\nconst mockAiInsights = [\n {\n id: '1',\n type: 'opportunity' as const,\n title: 'High-Potential Business Detected',\n description:\n 'Glow Beauty Services in Koramangala shows 95% growth potential based on location analytics and market demand.',\n confidence: 94,\n },\n {\n id: '2',\n type: 'suggestion' as const,\n title: 'Portfolio Diversification Recommended',\n description:\n 'Consider investing in Education & Skills to balance your services-heavy portfolio. Current allocation: 70% services, 30% retail.',\n confidence: 87,\n },\n {\n id: '3',\n type: 'trend' as const,\n title: 'Market Trend Alert',\n description:\n 'Health & Wellness businesses in tech hubs are experiencing 40% higher returns. Whitefield shows promising opportunities.',\n confidence: 91,\n },\n];\n\nconst mockRecentActivity = [\n {\n id: 'act-1',\n type: 'dividend',\n description: 'Dividend received from Quick Cuts Salon',\n amount: 4200,\n date: '2024-01-14T10:00:00Z',\n },\n {\n id: 'act-2',\n type: 'investment',\n description: 'Invested in Spotless Cleaning Services',\n amount: -40000,\n date: '2024-01-10T09:30:00Z',\n },\n {\n id: 'act-3',\n type: 'return',\n description: 'Returns from Fix-It Mobile Repair',\n amount: 6800,\n date: '2024-01-05T14:00:00Z',\n },\n {\n id: 'act-4',\n type: 'investment',\n description: 'Invested in Fix-It Mobile Repair',\n amount: -75000,\n date: '2023-12-20T11:00:00Z',\n },\n];\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction getRiskBadgeColor(risk: string): string {\n switch (risk) {\n case 'low':\n return 'bg-green-500/20 text-green-600 dark:text-green-400';\n case 'medium':\n return 'bg-yellow-500/20 text-yellow-600 dark:text-yellow-400';\n case 'high':\n return 'bg-red-500/20 text-red-600 dark:text-red-400';\n default:\n return 'bg-secondary text-secondary-foreground';\n }\n}\n\nfunction getStatusBadgeColor(status: string): string {\n switch (status) {\n case 'active':\n return 'bg-green-500/20 text-green-600 dark:text-green-400';\n case 'pending':\n return 'bg-yellow-500/20 text-yellow-600 dark:text-yellow-400';\n case 'completed':\n return 'bg-blue-500/20 text-blue-600 dark:text-blue-400';\n default:\n return 'bg-secondary text-secondary-foreground';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function InvestorDashboard() {\n const { navigateTo, currentUser } = useAdapterCloud();\n const [activeTab, setActiveTab] = useState<'portfolio' | 'opportunities'>('portfolio');\n\n const { data: opportunities = [], isLoading: opportunitiesLoading } =\n useInvestmentOpportunities();\n const { data: investments = [], isLoading: investmentsLoading } = useInvestments(\n currentUser?.id || ''\n );\n\n const firstName = currentUser?.firstName ?? currentUser?.name ?? 'Investor';\n\n const activeOpportunities = opportunities.filter((inv) => inv.status === 'active');\n\n const portfolioSummary = useMemo(() => {\n const totalInvested = investments.reduce((sum, inv) => sum + inv.investedAmount, 0);\n const currentValue = investments.reduce((sum, inv) => sum + inv.currentValue, 0);\n const totalReturns = investments.reduce((sum, inv) => sum + inv.returns, 0);\n const monthlyIncome = totalReturns / 12; // Simple mock derivation\n const roi = totalInvested > 0 ? (totalReturns / totalInvested) * 100 : 0;\n\n return {\n totalInvested,\n currentValue,\n totalReturns,\n monthlyIncome,\n roi,\n };\n }, [investments]);\n\n if (opportunitiesLoading || investmentsLoading) {\n return (\n <PageLayout title=\"Investment Dashboard\" description=\"Loading your portfolio...\">\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-muted-foreground\">Loading your portfolio...</p>\n </div>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={`Welcome back, ${firstName}!`}\n description=\"Here's your investment portfolio overview.\"\n >\n {/* Portfolio Summary Metrics */}\n <section>\n <h2 className=\"mb-4 text-lg font-semibold text-foreground\">Portfolio Overview</h2>\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(portfolioSummary.totalInvested, { minimumFractionDigits: 0 })}\n label=\"Total Invested\"\n trend=\"up\"\n trendValue=\"Across all businesses\"\n />\n <MetricsCard\n icon={<IndianRupee className=\"h-5 w-5\" />}\n value={formatCurrency(portfolioSummary.currentValue, { minimumFractionDigits: 0 })}\n label=\"Current Value\"\n trend=\"up\"\n trendValue={`+${portfolioSummary.roi.toFixed(1)}%`}\n />\n <MetricsCard\n icon={<Target className=\"h-5 w-5\" />}\n value={formatCurrency(portfolioSummary.totalReturns, { minimumFractionDigits: 0 })}\n label=\"Total Returns\"\n trend=\"up\"\n trendValue=\"+15.2% this month\"\n />\n <MetricsCard\n icon={<Activity className=\"h-5 w-5\" />}\n value={formatCurrency(portfolioSummary.monthlyIncome, { minimumFractionDigits: 0 })}\n label=\"Monthly Income\"\n trend=\"up\"\n trendValue=\"+8.5% vs last month\"\n />\n </div>\n </section>\n\n {/* Main Content + Sidebar */}\n <div className=\"mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Main Content */}\n <div className=\"lg:col-span-2\">\n {/* Tab Navigation */}\n <div className=\"mb-6 flex rounded-lg bg-muted p-1\">\n <button\n type=\"button\"\n onClick={() => setActiveTab('portfolio')}\n className={cn(\n 'flex-1 rounded-md px-4 py-2 text-sm font-medium transition-colors',\n activeTab === 'portfolio'\n ? 'bg-card text-foreground shadow-sm'\n : 'text-muted-foreground hover:text-foreground'\n )}\n >\n My Investments\n </button>\n <button\n type=\"button\"\n onClick={() => setActiveTab('opportunities')}\n className={cn(\n 'flex-1 rounded-md px-4 py-2 text-sm font-medium transition-colors',\n activeTab === 'opportunities'\n ? 'bg-card text-foreground shadow-sm'\n : 'text-muted-foreground hover:text-foreground'\n )}\n >\n New Opportunities\n </button>\n </div>\n\n {/* Portfolio Tab */}\n {activeTab === 'portfolio' && (\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"text-base font-semibold text-foreground\">Active Investments</h3>\n <button\n type=\"button\"\n onClick={() => alert('Filter functionality coming soon!')}\n className=\"flex items-center gap-2 rounded-lg border border-border px-3 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <Filter className=\"h-4 w-4\" />\n Filter\n </button>\n </div>\n\n {investments.length === 0 ? (\n <div className=\"rounded-lg border border-dashed border-border p-8 text-center\">\n <Briefcase className=\"mx-auto h-12 w-12 text-muted-foreground opacity-20\" />\n <p className=\"mt-2 text-sm text-muted-foreground\">No active investments found.</p>\n <button\n type=\"button\"\n onClick={() => setActiveTab('opportunities')}\n className=\"mt-4 text-sm font-medium text-primary hover:underline\"\n >\n Browse opportunities\n </button>\n </div>\n ) : (\n investments.map((investment) => (\n <div\n key={investment.id}\n className=\"rounded-lg border border-border bg-card p-4 shadow-sm hover:shadow-md transition-shadow\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex-1\">\n <div className=\"mb-2 flex flex-wrap items-center gap-2\">\n <h4 className=\"text-base font-semibold text-foreground\">\n {investment.cartName}\n </h4>\n <span\n className={cn(\n 'rounded-full px-2 py-0.5 text-xs font-medium',\n getStatusBadgeColor(investment.status)\n )}\n >\n {investment.status}\n </span>\n </div>\n <div className=\"mb-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground\">\n <span className=\"flex items-center gap-1\">\n <MapPin className=\"h-3.5 w-3.5\" />\n {'India'}\n </span>\n <span>{'Services'}</span>\n </div>\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 px-3 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <Eye className=\"h-4 w-4\" />\n View Details\n </button>\n </div>\n\n <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-4\">\n <div>\n <p className=\"text-xs text-muted-foreground\">Invested</p>\n <p className=\"text-sm font-semibold text-foreground\">\n {formatCurrency(investment.investedAmount, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-muted-foreground\">Current Value</p>\n <p className=\"text-sm font-semibold text-green-600 dark:text-green-400\">\n {formatCurrency(investment.currentValue, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-muted-foreground\">Returns</p>\n <p className=\"text-sm font-semibold text-foreground\">\n {formatCurrency(investment.returns, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-muted-foreground\">Growth</p>\n <p className=\"text-sm font-semibold text-green-600 dark:text-green-400\">\n {investment.returnsPercentage}%\n </p>\n </div>\n </div>\n </div>\n ))\n )}\n </div>\n )}\n\n {/* Opportunities Tab */}\n {activeTab === 'opportunities' && (\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"text-base font-semibold text-foreground\">\n Investment Opportunities\n </h3>\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/opportunities')}\n className=\"flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n <Plus className=\"h-4 w-4\" />\n Browse All\n </button>\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n {activeOpportunities.slice(0, 2).map((opp) => (\n <InvestmentCard\n key={opp.id}\n id={opp.id}\n cartName={opp.cartName}\n targetAmount={opp.targetAmount}\n raisedAmount={opp.raisedAmount}\n expectedReturns={`${opp.expectedReturns}%`}\n riskLevel={opp.riskLevel}\n status={opp.status}\n onClick={(id) => navigateTo(`/investor/opportunities/${id}`)}\n />\n ))}\n </div>\n </div>\n )}\n\n {/* Recent Activity */}\n <section className=\"mt-8\">\n <h2 className=\"mb-4 text-lg font-semibold text-foreground\">Recent Activity</h2>\n <div className=\"divide-y divide-border rounded-lg border border-border bg-card\">\n {mockRecentActivity.map((activity) => (\n <div key={activity.id} className=\"flex items-center justify-between px-4 py-3\">\n <div className=\"flex items-center gap-3\">\n <div\n className={cn(\n 'flex h-8 w-8 items-center justify-center rounded-full',\n activity.amount > 0 ? 'bg-green-500/10' : 'bg-muted'\n )}\n >\n <Activity\n className={cn(\n 'h-4 w-4',\n activity.amount > 0\n ? 'text-green-600 dark:text-green-400'\n : 'text-muted-foreground'\n )}\n />\n </div>\n <div>\n <p className=\"text-sm font-medium text-foreground\">{activity.description}</p>\n <p className=\"text-xs text-muted-foreground\">\n {new Date(activity.date).toLocaleDateString('en-IN', {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n })}\n </p>\n </div>\n </div>\n <span\n className={cn(\n 'text-sm font-semibold',\n activity.amount > 0 ? 'text-green-600 dark:text-green-400' : 'text-foreground'\n )}\n >\n {activity.amount > 0 ? '+' : ''}\n {formatCurrency(Math.abs(activity.amount), { minimumFractionDigits: 0 })}\n </span>\n </div>\n ))}\n </div>\n </section>\n </div>\n\n {/* Sidebar */}\n <div className=\"space-y-6\">\n {/* AI Insights */}\n <div className=\"rounded-lg border border-border bg-card p-4\">\n <div className=\"mb-3 flex items-center gap-2\">\n <Lightbulb className=\"h-5 w-5 text-yellow-500\" />\n <h3 className=\"text-base font-semibold text-foreground\">AI Insights</h3>\n </div>\n <div className=\"space-y-3\">\n {mockAiInsights.map((insight) => (\n <div key={insight.id} className=\"rounded-lg border border-border bg-muted/50 p-3\">\n <div className=\"mb-1 flex items-center justify-between\">\n <h4 className=\"text-xs font-semibold text-foreground\">{insight.title}</h4>\n <span className=\"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary\">\n {insight.confidence}%\n </span>\n </div>\n <p className=\"text-xs leading-relaxed text-muted-foreground\">\n {insight.description}\n </p>\n </div>\n ))}\n </div>\n </div>\n\n {/* Quick Actions */}\n <div className=\"rounded-lg border border-border bg-card p-4\">\n <h3 className=\"mb-3 text-base font-semibold text-foreground\">Quick Actions</h3>\n <div className=\"space-y-2\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/portfolio')}\n className=\"flex w-full items-center gap-2 rounded-lg border border-border px-3 py-2.5 text-left text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <PieChart className=\"h-4 w-4 text-muted-foreground\" />\n View Full Portfolio\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/opportunities')}\n className=\"flex w-full items-center gap-2 rounded-lg border border-border px-3 py-2.5 text-left text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <Target className=\"h-4 w-4 text-muted-foreground\" />\n Browse Opportunities\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/analytics')}\n className=\"flex w-full items-center gap-2 rounded-lg border border-border px-3 py-2.5 text-left text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <BarChart3 className=\"h-4 w-4 text-muted-foreground\" />\n Investment Analytics\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/profile')}\n className=\"flex w-full items-center gap-2 rounded-lg border border-border px-3 py-2.5 text-left text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <Award className=\"h-4 w-4 text-muted-foreground\" />\n View Profile\n </button>\n </div>\n </div>\n\n {/* Market Updates */}\n <div className=\"rounded-lg border border-border bg-card p-4\">\n <h3 className=\"mb-3 text-base font-semibold text-foreground\">Market Updates</h3>\n <div className=\"space-y-3\">\n <div className=\"border-l-4 border-green-500 pl-3\">\n <h4 className=\"text-xs font-semibold text-foreground\">\n Mobile Services Market Growing\n </h4>\n <p className=\"mt-1 text-xs leading-relaxed text-muted-foreground\">\n Mobile service industry shows 35% growth in Q4 2024\n </p>\n </div>\n <div className=\"border-l-4 border-blue-500 pl-3\">\n <h4 className=\"text-xs font-semibold text-foreground\">\n New Investment Tax Benefits\n </h4>\n <p className=\"mt-1 text-xs leading-relaxed text-muted-foreground\">\n Government announces SME investment incentives\n </p>\n </div>\n <div className=\"border-l-4 border-yellow-500 pl-3\">\n <h4 className=\"text-xs font-semibold text-foreground\">\n Home Services Demand Surge\n </h4>\n <p className=\"mt-1 text-xs leading-relaxed text-muted-foreground\">\n Cleaning and maintenance businesses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AAe,EAAW,sBAAsB;SAChD,WAAU;mBAHZ,CAKE,kBAAC,GAAD,EAAW,WAAU,iCAAkC,CAAA,EAAA,uBAEhD;;QACT,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,EAAW,oBAAoB;SAC9C,WAAU;mBAHZ,CAKE,kBAAC,GAAD,EAAO,WAAU,iCAAkC,CAAA,EAAA,eAE5C;;QACL;SACF;;KAGN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,MAAD;OAAI,WAAU;iBAA+C;OAAmB,CAAA,EAChF,kBAAC,OAAD;OAAK,WAAU;iBAAf;QACE,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,MAAD;UAAI,WAAU;oBAAwC;UAEjD,CAAA,EACL,kBAAC,KAAD;UAAG,WAAU;oBAAqD;UAE9D,CAAA,CACA;;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,MAAD;UAAI,WAAU;oBAAwC;UAEjD,CAAA,EACL,kBAAC,KAAD;UAAG,WAAU;oBAAqD;UAE9D,CAAA,CACA;;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,MAAD;UAAI,WAAU;oBAAwC;UAEjD,CAAA,EACL,kBAAC,KAAD;UAAG,WAAU;oBAAqD;UAE9D,CAAA,CACA;;QACF;SACF;;KACF;MACF;KACK"}
1
+ {"version":3,"file":"InvestorDashboard.js","names":[],"sources":["../../../../src/adaptercloud/pages/investor/InvestorDashboard.tsx"],"sourcesContent":["/**\n * Investor Dashboard Page\n * @module adaptercloud/pages/investor\n *\n * Portfolio overview with metrics, tab navigation (portfolio/opportunities),\n * AI insights sidebar, quick actions, market updates, and recent activity.\n */\n\nimport { useState, useEffect, useMemo } from'react';\nimport {\n Wallet,\n TrendingUp,\n PieChart,\n Briefcase,\n ArrowRight,\n Activity,\n IndianRupee,\n Target,\n Award,\n Filter,\n Eye,\n Plus,\n MapPin,\n Lightbulb,\n BarChart3,\n} from'lucide-react';\nimport { PageLayout } from'../../components/PageLayout';\nimport { MetricsCard } from'../../components/MetricsCard';\nimport { InvestmentCard } from'../../components/InvestmentCard';\nimport { RatingDisplay } from'../../components/RatingDisplay';\nimport { useAdapterCloud } from'../../context/AdapterCloudContext';\nimport { useInvestmentOpportunities, useInvestments } from'../../hooks/useAdapterCloudApi';\nimport { cn } from'../../utils/cn';\nimport { formatCurrency } from'../../utils/formatters';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ninterface DashboardInvestment {\n id: string;\n cartName: string;\n cartOwner: string;\n investmentAmount: number;\n equityPercentage: number;\n investmentDate: string;\n currentValue: number;\n monthlyReturns: number;\n status: 'active' | 'pending' | 'completed';\n location: string;\n category: string;\n rating: number;\n riskLevel: 'low' | 'medium' | 'high';\n}\n\nconst mockAiInsights = [\n {\n id: '1',\n type: 'opportunity' as const,\n title: 'High-Potential Business Detected',\n description:\n 'Glow Beauty Services in Koramangala shows 95% growth potential based on location analytics and market demand.',\n confidence: 94,\n },\n {\n id: '2',\n type: 'suggestion' as const,\n title: 'Portfolio Diversification Recommended',\n description:\n 'Consider investing in Education & Skills to balance your services-heavy portfolio. Current allocation: 70% services, 30% retail.',\n confidence: 87,\n },\n {\n id: '3',\n type: 'trend' as const,\n title: 'Market Trend Alert',\n description:\n 'Health & Wellness businesses in tech hubs are experiencing 40% higher returns. Whitefield shows promising opportunities.',\n confidence: 91,\n },\n];\n\nconst mockRecentActivity = [\n {\n id: 'act-1',\n type: 'dividend',\n description: 'Dividend received from Quick Cuts Salon',\n amount: 4200,\n date: '2024-01-14T10:00:00Z',\n },\n {\n id: 'act-2',\n type: 'investment',\n description: 'Invested in Spotless Cleaning Services',\n amount: -40000,\n date: '2024-01-10T09:30:00Z',\n },\n {\n id: 'act-3',\n type: 'return',\n description: 'Returns from Fix-It Mobile Repair',\n amount: 6800,\n date: '2024-01-05T14:00:00Z',\n },\n {\n id: 'act-4',\n type: 'investment',\n description: 'Invested in Fix-It Mobile Repair',\n amount: -75000,\n date: '2023-12-20T11:00:00Z',\n },\n];\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction getRiskBadgeColor(risk: string): string {\n switch (risk) {\n case'low':\n return'bg-status-success-bg-subtle/20 text-status-success-text';\n case'medium':\n return'bg-status-warning-bg-subtle/20 text-status-warning-text';\n case'high':\n return'bg-status-error-bg-subtle/20 text-status-error-text';\n default:\n return'bg-secondary text-secondary-foreground';\n }\n}\n\nfunction getStatusBadgeColor(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'completed':\n return'bg-accent-blue-subtle/20 text-accent-blue';\n default:\n return'bg-secondary text-secondary-foreground';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function InvestorDashboard() {\n const { navigateTo, currentUser } = useAdapterCloud();\n const [activeTab, setActiveTab] = useState<'portfolio' | 'opportunities'>('portfolio');\n\n const { data: opportunities = [], isLoading: opportunitiesLoading } =\n useInvestmentOpportunities();\n const { data: investments = [], isLoading: investmentsLoading } = useInvestments(\n currentUser?.id || ''\n );\n\n const firstName = currentUser?.firstName ?? currentUser?.name ?? 'Investor';\n\n const activeOpportunities = opportunities.filter((inv) => inv.status === 'active');\n\n const portfolioSummary = useMemo(() => {\n const totalInvested = investments.reduce((sum, inv) => sum + inv.investedAmount, 0);\n const currentValue = investments.reduce((sum, inv) => sum + inv.currentValue, 0);\n const totalReturns = investments.reduce((sum, inv) => sum + inv.returns, 0);\n const monthlyIncome = totalReturns / 12; // Simple mock derivation\n const roi = totalInvested > 0 ? (totalReturns / totalInvested) * 100 : 0;\n\n return {\n totalInvested,\n currentValue,\n totalReturns,\n monthlyIncome,\n roi,\n };\n }, [investments]);\n\n if (opportunitiesLoading || investmentsLoading) {\n return (\n <PageLayout title=\"Investment Dashboard\" description=\"Loading your portfolio...\">\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 portfolio...</p>\n </div>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={`Welcome back, ${firstName}!`}\n description=\"Here's your investment portfolio overview.\"\n >\n {/* Portfolio Summary Metrics */}\n <section>\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">Portfolio Overview</h2>\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(portfolioSummary.totalInvested, { minimumFractionDigits: 0 })}\n label=\"Total Invested\"\n trend=\"up\"\n trendValue=\"Across all businesses\"\n />\n <MetricsCard\n icon={<IndianRupee className=\"h-5 w-5\" />}\n value={formatCurrency(portfolioSummary.currentValue, { minimumFractionDigits: 0 })}\n label=\"Current Value\"\n trend=\"up\"\n trendValue={`+${portfolioSummary.roi.toFixed(1)}%`}\n />\n <MetricsCard\n icon={<Target className=\"h-5 w-5\" />}\n value={formatCurrency(portfolioSummary.totalReturns, { minimumFractionDigits: 0 })}\n label=\"Total Returns\"\n trend=\"up\"\n trendValue=\"+15.2% this month\"\n />\n <MetricsCard\n icon={<Activity className=\"h-5 w-5\" />}\n value={formatCurrency(portfolioSummary.monthlyIncome, { minimumFractionDigits: 0 })}\n label=\"Monthly Income\"\n trend=\"up\"\n trendValue=\"+8.5% vs last month\"\n />\n </div>\n </section>\n\n {/* Main Content + Sidebar */}\n <div className=\"mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Main Content */}\n <div className=\"lg:col-span-2\">\n {/* Tab Navigation */}\n <div className=\"mb-6 flex rounded-lg bg-bg-sunken p-1\">\n <button\n type=\"button\"\n onClick={() => setActiveTab('portfolio')}\n className={cn(\n 'flex-1 rounded-md px-4 py-2 text-sm font-medium transition-colors',\n activeTab === 'portfolio'\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:text-text-primary'\n )}\n >\n My Investments\n </button>\n <button\n type=\"button\"\n onClick={() => setActiveTab('opportunities')}\n className={cn(\n 'flex-1 rounded-md px-4 py-2 text-sm font-medium transition-colors',\n activeTab === 'opportunities'\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:text-text-primary'\n )}\n >\n New Opportunities\n </button>\n </div>\n\n {/* Portfolio Tab */}\n {activeTab === 'portfolio' && (\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"text-base font-semibold text-text-primary\">Active Investments</h3>\n <button\n type=\"button\"\n onClick={() => alert('Filter functionality coming soon!')}\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 <Filter className=\"h-4 w-4\" />\n Filter\n </button>\n </div>\n\n {investments.length === 0 ? (\n <div className=\"rounded-lg border border-dashed border-border-subtle p-8 text-center\">\n <Briefcase className=\"mx-auto h-12 w-12 text-text-secondary opacity-20\" />\n <p className=\"mt-2 text-sm text-text-secondary\">No active investments found.</p>\n <button\n type=\"button\"\n onClick={() => setActiveTab('opportunities')}\n className=\"mt-4 text-sm font-medium text-primary hover:underline\"\n >\n Browse opportunities\n </button>\n </div>\n ) : (\n investments.map((investment) => (\n <div\n key={investment.id}\n className=\"rounded-lg border border-border-seam bg-bg-surface p-4 hover:shadow-md transition-shadow bg-gloss-card shadow-pop\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex-1\">\n <div className=\"mb-2 flex flex-wrap items-center gap-2\">\n <h4 className=\"text-base font-semibold text-text-primary\">\n {investment.cartName}\n </h4>\n <span\n className={cn(\n 'rounded-full px-2 py-0.5 text-xs font-medium',\n getStatusBadgeColor(investment.status)\n )}\n >\n {investment.status}\n </span>\n </div>\n <div className=\"mb-3 flex flex-wrap items-center gap-3 text-xs text-text-secondary\">\n <span className=\"flex items-center gap-1\">\n <MapPin className=\"h-3.5 w-3.5\" />\n {'India'}\n </span>\n <span>{'Services'}</span>\n </div>\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\n <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-4\">\n <div>\n <p className=\"text-xs text-text-secondary\">Invested</p>\n <p className=\"text-sm font-semibold text-text-primary\">\n {formatCurrency(investment.investedAmount, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">Current Value</p>\n <p className=\"text-sm font-semibold text-status-success-text\">\n {formatCurrency(investment.currentValue, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">Returns</p>\n <p className=\"text-sm font-semibold text-text-primary\">\n {formatCurrency(investment.returns, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">Growth</p>\n <p className=\"text-sm font-semibold text-status-success-text\">\n {investment.returnsPercentage}%\n </p>\n </div>\n </div>\n </div>\n ))\n )}\n </div>\n )}\n\n {/* Opportunities Tab */}\n {activeTab === 'opportunities' && (\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"text-base font-semibold text-text-primary\">\n Investment Opportunities\n </h3>\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 Browse All\n </button>\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n {activeOpportunities.slice(0, 2).map((opp) => (\n <InvestmentCard\n key={opp.id}\n id={opp.id}\n cartName={opp.cartName}\n targetAmount={opp.targetAmount}\n raisedAmount={opp.raisedAmount}\n expectedReturns={`${opp.expectedReturns}%`}\n riskLevel={opp.riskLevel}\n status={opp.status}\n onClick={(id) => navigateTo(`/investor/opportunities/${id}`)}\n />\n ))}\n </div>\n </div>\n )}\n\n {/* Recent Activity */}\n <section className=\"mt-8\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">Recent Activity</h2>\n <div className=\"divide-y divide-border rounded-lg border border-border-subtle bg-bg-surface\">\n {mockRecentActivity.map((activity) => (\n <div key={activity.id} className=\"flex items-center justify-between px-4 py-3\">\n <div className=\"flex items-center gap-3\">\n <div\n className={cn(\n 'flex h-8 w-8 items-center justify-center rounded-full',\n activity.amount > 0 ? 'bg-status-success-bg-subtle/10' : 'bg-bg-sunken'\n )}\n >\n <Activity\n className={cn(\n 'h-4 w-4',\n activity.amount > 0\n ? 'text-status-success-text'\n : 'text-text-secondary'\n )}\n />\n </div>\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{activity.description}</p>\n <p className=\"text-xs text-text-secondary\">\n {new Date(activity.date).toLocaleDateString('en-IN', {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n })}\n </p>\n </div>\n </div>\n <span\n className={cn(\n 'text-sm font-semibold',\n activity.amount > 0 ? 'text-status-success-text' : 'text-text-primary'\n )}\n >\n {activity.amount > 0 ? '+' : ''}\n {formatCurrency(Math.abs(activity.amount), { minimumFractionDigits: 0 })}\n </span>\n </div>\n ))}\n </div>\n </section>\n </div>\n\n {/* Sidebar */}\n <div className=\"space-y-6\">\n {/* AI Insights */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop\">\n <div className=\"mb-3 flex items-center gap-2\">\n <Lightbulb className=\"h-5 w-5 text-status-warning-text\" />\n <h3 className=\"text-base font-semibold text-text-primary\">AI Insights</h3>\n </div>\n <div className=\"space-y-3\">\n {mockAiInsights.map((insight) => (\n <div key={insight.id} className=\"rounded-lg border border-border-subtle bg-bg-sunken/50 p-3\">\n <div className=\"mb-1 flex items-center justify-between\">\n <h4 className=\"text-xs font-semibold text-text-primary\">{insight.title}</h4>\n <span className=\"rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary\">\n {insight.confidence}%\n </span>\n </div>\n <p className=\"text-xs leading-relaxed text-text-secondary\">\n {insight.description}\n </p>\n </div>\n ))}\n </div>\n </div>\n\n {/* Quick Actions */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop\">\n <h3 className=\"mb-3 text-base font-semibold text-text-primary\">Quick Actions</h3>\n <div className=\"space-y-2\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/portfolio')}\n className=\"flex w-full items-center gap-2 rounded-lg border border-border-subtle px-3 py-2.5 text-left text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <PieChart className=\"h-4 w-4 text-text-secondary\" />\n View Full Portfolio\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/opportunities')}\n className=\"flex w-full items-center gap-2 rounded-lg border border-border-subtle px-3 py-2.5 text-left text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Target className=\"h-4 w-4 text-text-secondary\" />\n Browse Opportunities\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/analytics')}\n className=\"flex w-full items-center gap-2 rounded-lg border border-border-subtle px-3 py-2.5 text-left text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <BarChart3 className=\"h-4 w-4 text-text-secondary\" />\n Investment Analytics\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/profile')}\n className=\"flex w-full items-center gap-2 rounded-lg border border-border-subtle px-3 py-2.5 text-left text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Award className=\"h-4 w-4 text-text-secondary\" />\n View Profile\n </button>\n </div>\n </div>\n\n {/* Market Updates */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop\">\n <h3 className=\"mb-3 text-base font-semibold text-text-primary\">Market Updates</h3>\n <div className=\"space-y-3\">\n <div className=\"border-l-4 border-status-success-border pl-3\">\n <h4 className=\"text-xs font-semibold text-text-primary\">\n Mobile Services Market Growing\n </h4>\n <p className=\"mt-1 text-xs leading-relaxed text-text-secondary\">\n Mobile service industry shows 35% growth in Q4 2024\n </p>\n </div>\n <div className=\"border-l-4 border-accent-blue-subtle pl-3\">\n <h4 className=\"text-xs font-semibold text-text-primary\">\n New Investment Tax Benefits\n </h4>\n <p className=\"mt-1 text-xs leading-relaxed text-text-secondary\">\n Government announces SME investment incentives\n </p>\n </div>\n <div className=\"border-l-4 border-status-warning-border pl-3\">\n <h4 className=\"text-xs font-semibold text-text-primary\">\n Home Services Demand Surge\n </h4>\n <p className=\"mt-1 text-xs leading-relaxed text-text-secondary\">\n Cleaning and maintenance businesses up 25% this quarter\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;AAuDA,IAAM,IAAiB;CACrB;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,aACE;EACF,YAAY;EACb;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,aACE;EACF,YAAY;EACb;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,aACE;EACF,YAAY;EACb;CACF,EAEK,IAAqB;CACzB;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,QAAQ;EACR,MAAM;EACP;CACD;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,QAAQ;EACR,MAAM;EACP;CACD;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,QAAQ;EACR,MAAM;EACP;CACD;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,QAAQ;EACR,MAAM;EACP;CACF;AAmBD,SAAS,EAAoB,GAAwB;AACnD,SAAQ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AAG,WAAU;oBAAmD;UAE5D,CAAA,CACA;;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,MAAD;UAAI,WAAU;oBAA0C;UAEnD,CAAA,EACL,kBAAC,KAAD;UAAG,WAAU;oBAAmD;UAE5D,CAAA,CACA;;QACF;SACF;;KACF;MACF;KACK"}
@@ -95,9 +95,9 @@ var x = [
95
95
  };
96
96
  function C(e) {
97
97
  switch (e) {
98
- case "active": return "bg-green-500/20 text-green-600 dark:text-green-400";
99
- case "pending": return "bg-yellow-500/20 text-yellow-600 dark:text-yellow-400";
100
- case "matured": return "bg-blue-500/20 text-blue-600 dark:text-blue-400";
98
+ case "active": return "bg-status-success-bg-subtle/20 text-status-success-text";
99
+ case "pending": return "bg-status-warning-bg-subtle/20 text-status-warning-text";
100
+ case "matured": return "bg-accent-blue-subtle/20 text-accent-blue";
101
101
  case "withdrawn": return "bg-secondary text-secondary-foreground";
102
102
  default: return "bg-secondary text-secondary-foreground";
103
103
  }
@@ -145,7 +145,7 @@ function T() {
145
145
  children: /* @__PURE__ */ b("div", {
146
146
  className: "text-center",
147
147
  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", {
148
- className: "text-sm text-muted-foreground",
148
+ className: "text-sm text-text-secondary",
149
149
  children: "Loading your investments..."
150
150
  })]
151
151
  })
@@ -156,7 +156,7 @@ function T() {
156
156
  actions: /* @__PURE__ */ b("button", {
157
157
  type: "button",
158
158
  onClick: () => u("/investor/opportunities"),
159
- className: "flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
159
+ 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",
160
160
  children: [/* @__PURE__ */ y(h, { className: "h-4 w-4" }), "New Investment"]
161
161
  }),
162
162
  children: [
@@ -194,15 +194,15 @@ function T() {
194
194
  ]
195
195
  }),
196
196
  /* @__PURE__ */ y("div", {
197
- className: "mt-6 rounded-lg border border-border bg-card p-4",
197
+ className: "mt-6 rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop",
198
198
  children: /* @__PURE__ */ y("div", {
199
199
  className: "flex flex-wrap gap-2",
200
200
  children: k.map((e) => /* @__PURE__ */ b("button", {
201
201
  type: "button",
202
202
  onClick: () => D(e.key),
203
- className: t("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors", E === e.key ? "bg-primary text-primary-foreground" : "bg-muted text-foreground hover:bg-muted/80"),
203
+ className: t("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors", E === e.key ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-primary hover:bg-bg-sunken/80"),
204
204
  children: [e.label, /* @__PURE__ */ y("span", {
205
- className: t("rounded-full px-2 py-0.5 text-xs", E === e.key ? "bg-primary-foreground/20 text-primary-foreground" : "bg-primary/10 text-primary"),
205
+ className: t("rounded-full px-2 py-0.5 text-xs", E === e.key ? "bg-primary-foreground/20 text-action-primary-text" : "bg-action-primary-bg/10 text-primary"),
206
206
  children: A(e.key)
207
207
  })]
208
208
  }, e.key))
@@ -211,17 +211,17 @@ function T() {
211
211
  /* @__PURE__ */ y("div", {
212
212
  className: "mt-6 space-y-4",
213
213
  children: O.length > 0 ? O.map((e) => /* @__PURE__ */ b("div", {
214
- className: "rounded-lg border border-border bg-card p-4 sm:p-6",
214
+ className: "rounded-lg border border-border-seam bg-bg-surface p-4 sm:p-6 bg-gloss-card shadow-pop",
215
215
  children: [/* @__PURE__ */ b("div", {
216
216
  className: "block space-y-4 lg:hidden",
217
217
  children: [
218
218
  /* @__PURE__ */ b("div", {
219
219
  className: "flex items-start justify-between",
220
220
  children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
221
- className: "text-lg font-semibold text-foreground",
221
+ className: "text-lg font-semibold text-text-primary",
222
222
  children: e.cartName
223
223
  }), /* @__PURE__ */ b("p", {
224
- className: "text-sm text-muted-foreground",
224
+ className: "text-sm text-text-secondary",
225
225
  children: ["by ", e.cartOwner]
226
226
  })] }), /* @__PURE__ */ b("span", {
227
227
  className: t("flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium", C(e.status)),
@@ -235,24 +235,24 @@ function T() {
235
235
  className: "grid grid-cols-2 gap-4",
236
236
  children: [
237
237
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
238
- className: "text-sm text-muted-foreground",
238
+ className: "text-sm text-text-secondary",
239
239
  children: "Invested"
240
240
  }), /* @__PURE__ */ y("p", {
241
- className: "font-semibold text-foreground",
241
+ className: "font-semibold text-text-primary",
242
242
  children: a(e.investmentAmount, { minimumFractionDigits: 0 })
243
243
  })] }),
244
244
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
245
- className: "text-sm text-muted-foreground",
245
+ className: "text-sm text-text-secondary",
246
246
  children: "Current Value"
247
247
  }), /* @__PURE__ */ y("p", {
248
- className: "font-semibold text-foreground",
248
+ className: "font-semibold text-text-primary",
249
249
  children: a(e.currentValue, { minimumFractionDigits: 0 })
250
250
  })] }),
251
251
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
252
- className: "text-sm text-muted-foreground",
252
+ className: "text-sm text-text-secondary",
253
253
  children: "P&L"
254
254
  }), /* @__PURE__ */ b("p", {
255
- className: t("font-semibold", e.profitLoss >= 0 ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400"),
255
+ className: t("font-semibold", e.profitLoss >= 0 ? "text-status-success-text" : "text-status-error-text"),
256
256
  children: [
257
257
  e.profitLoss >= 0 ? "+" : "",
258
258
  a(e.profitLoss, { minimumFractionDigits: 0 }),
@@ -263,21 +263,21 @@ function T() {
263
263
  ]
264
264
  })] }),
265
265
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
266
- className: "text-sm text-muted-foreground",
266
+ className: "text-sm text-text-secondary",
267
267
  children: "ROI"
268
268
  }), /* @__PURE__ */ b("p", {
269
- className: "font-semibold text-foreground",
269
+ className: "font-semibold text-text-primary",
270
270
  children: [e.roiAnnual, "% p.a."]
271
271
  })] })
272
272
  ]
273
273
  }),
274
274
  /* @__PURE__ */ b("div", {
275
- className: "flex items-center justify-between border-t border-border pt-2",
275
+ className: "flex items-center justify-between border-t border-border-subtle pt-2",
276
276
  children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
277
- className: "text-xs text-muted-foreground",
277
+ className: "text-xs text-text-secondary",
278
278
  children: "Invested on"
279
279
  }), /* @__PURE__ */ y("p", {
280
- className: "text-sm font-medium text-foreground",
280
+ className: "text-sm font-medium text-text-primary",
281
281
  children: o(e.investmentDate, {
282
282
  hour: void 0,
283
283
  minute: void 0
@@ -285,7 +285,7 @@ function T() {
285
285
  })] }), /* @__PURE__ */ b("button", {
286
286
  type: "button",
287
287
  onClick: () => u(`/investor/investments/${e.id}`),
288
- className: "flex items-center gap-2 rounded-lg border border-border px-3 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors",
288
+ 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",
289
289
  children: [/* @__PURE__ */ y(p, { className: "h-4 w-4" }), "View Details"]
290
290
  })]
291
291
  })
@@ -298,7 +298,7 @@ function T() {
298
298
  /* @__PURE__ */ b("div", {
299
299
  className: "mb-2 flex items-center justify-between",
300
300
  children: [/* @__PURE__ */ y("h3", {
301
- className: "text-lg font-semibold text-foreground",
301
+ className: "text-lg font-semibold text-text-primary",
302
302
  children: e.cartName
303
303
  }), /* @__PURE__ */ b("span", {
304
304
  className: t("flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium", C(e.status)),
@@ -309,37 +309,37 @@ function T() {
309
309
  })]
310
310
  }),
311
311
  /* @__PURE__ */ b("p", {
312
- className: "mb-4 text-sm text-muted-foreground",
312
+ className: "mb-4 text-sm text-text-secondary",
313
313
  children: ["by ", e.cartOwner]
314
314
  }),
315
315
  /* @__PURE__ */ b("div", {
316
316
  className: "grid grid-cols-5 gap-6",
317
317
  children: [
318
318
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
319
- className: "text-sm text-muted-foreground",
319
+ className: "text-sm text-text-secondary",
320
320
  children: "Invested"
321
321
  }), /* @__PURE__ */ y("p", {
322
- className: "font-semibold text-foreground",
322
+ className: "font-semibold text-text-primary",
323
323
  children: a(e.investmentAmount, { minimumFractionDigits: 0 })
324
324
  })] }),
325
325
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
326
- className: "text-sm text-muted-foreground",
326
+ className: "text-sm text-text-secondary",
327
327
  children: "Current Value"
328
328
  }), /* @__PURE__ */ y("p", {
329
- className: "font-semibold text-foreground",
329
+ className: "font-semibold text-text-primary",
330
330
  children: a(e.currentValue, { minimumFractionDigits: 0 })
331
331
  })] }),
332
332
  /* @__PURE__ */ b("div", { children: [
333
333
  /* @__PURE__ */ y("p", {
334
- className: "text-sm text-muted-foreground",
334
+ className: "text-sm text-text-secondary",
335
335
  children: "P&L"
336
336
  }),
337
337
  /* @__PURE__ */ b("p", {
338
- className: t("font-semibold", e.profitLoss >= 0 ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400"),
338
+ className: t("font-semibold", e.profitLoss >= 0 ? "text-status-success-text" : "text-status-error-text"),
339
339
  children: [e.profitLoss >= 0 ? "+" : "", a(e.profitLoss, { minimumFractionDigits: 0 })]
340
340
  }),
341
341
  /* @__PURE__ */ b("p", {
342
- className: t("text-xs", e.profitLoss >= 0 ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400"),
342
+ className: t("text-xs", e.profitLoss >= 0 ? "text-status-success-text" : "text-status-error-text"),
343
343
  children: [
344
344
  "(",
345
345
  e.profitLossPercentage >= 0 ? "+" : "",
@@ -349,17 +349,17 @@ function T() {
349
349
  })
350
350
  ] }),
351
351
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
352
- className: "text-sm text-muted-foreground",
352
+ className: "text-sm text-text-secondary",
353
353
  children: "ROI"
354
354
  }), /* @__PURE__ */ b("p", {
355
- className: "font-semibold text-foreground",
355
+ className: "font-semibold text-text-primary",
356
356
  children: [e.roiAnnual, "% p.a."]
357
357
  })] }),
358
358
  /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
359
- className: "text-sm text-muted-foreground",
359
+ className: "text-sm text-text-secondary",
360
360
  children: "Invested on"
361
361
  }), /* @__PURE__ */ y("p", {
362
- className: "font-semibold text-foreground",
362
+ className: "font-semibold text-text-primary",
363
363
  children: o(e.investmentDate, {
364
364
  hour: void 0,
365
365
  minute: void 0
@@ -373,19 +373,20 @@ function T() {
373
373
  children: /* @__PURE__ */ b("button", {
374
374
  type: "button",
375
375
  onClick: () => u(`/investor/investments/${e.id}`),
376
- className: "flex items-center gap-2 rounded-lg border border-border px-3 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors",
376
+ 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",
377
377
  children: [/* @__PURE__ */ y(p, { className: "h-4 w-4" }), "View Details"]
378
378
  })
379
379
  })]
380
380
  })]
381
381
  }, e.id)) : /* @__PURE__ */ y(i, {
382
+ illustration: "empty-data",
382
383
  icon: /* @__PURE__ */ y(g, { className: "h-12 w-12" }),
383
384
  title: `No ${E === "all" ? "" : E} investments found`,
384
385
  description: E === "all" ? "You haven't made any investments yet. Start exploring opportunities to grow your wealth." : `You don't have any ${E} investments at the moment.`,
385
386
  action: /* @__PURE__ */ y("button", {
386
387
  type: "button",
387
388
  onClick: () => u("/investor/opportunities"),
388
- className: "rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
389
+ 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",
389
390
  children: "Explore Investment Opportunities"
390
391
  })
391
392
  })
@@ -1 +1 @@
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 { 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-green-500/20 text-green-600 dark:text-green-400';\n case 'pending':\n return 'bg-yellow-500/20 text-yellow-600 dark:text-yellow-400';\n case 'matured':\n return 'bg-blue-500/20 text-blue-600 dark:text-blue-400';\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-muted-foreground\">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 actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/investor/opportunities')}\n className=\"flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n <Plus className=\"h-4 w-4\" />\n New Investment\n </button>\n }\n >\n {/* Investment Summary */}\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\n {/* Filter Tabs */}\n <div className=\"mt-6 rounded-lg border border-border bg-card p-4\">\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-primary text-primary-foreground'\n : 'bg-muted text-foreground hover:bg-muted/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-primary-foreground'\n : 'bg-primary/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 bg-card p-4 sm:p-6\">\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-foreground\">{investment.cartName}</h3>\n <p className=\"text-sm text-muted-foreground\">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-muted-foreground\">Invested</p>\n <p className=\"font-semibold text-foreground\">\n {formatCurrency(investment.investmentAmount, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-muted-foreground\">Current Value</p>\n <p className=\"font-semibold text-foreground\">\n {formatCurrency(investment.currentValue, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-muted-foreground\">P&L</p>\n <p\n className={cn(\n 'font-semibold',\n investment.profitLoss >= 0\n ? 'text-green-600 dark:text-green-400'\n : 'text-red-600 dark:text-red-400'\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-muted-foreground\">ROI</p>\n <p className=\"font-semibold text-foreground\">{investment.roiAnnual}% p.a.</p>\n </div>\n </div>\n\n <div className=\"flex items-center justify-between border-t border-border pt-2\">\n <div>\n <p className=\"text-xs text-muted-foreground\">Invested on</p>\n <p className=\"text-sm font-medium text-foreground\">\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 px-3 py-2 text-sm font-medium text-foreground 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-foreground\">{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-muted-foreground\">by {investment.cartOwner}</p>\n\n <div className=\"grid grid-cols-5 gap-6\">\n <div>\n <p className=\"text-sm text-muted-foreground\">Invested</p>\n <p className=\"font-semibold text-foreground\">\n {formatCurrency(investment.investmentAmount, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-muted-foreground\">Current Value</p>\n <p className=\"font-semibold text-foreground\">\n {formatCurrency(investment.currentValue, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-muted-foreground\">P&L</p>\n <p\n className={cn(\n 'font-semibold',\n investment.profitLoss >= 0\n ? 'text-green-600 dark:text-green-400'\n : 'text-red-600 dark:text-red-400'\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-green-600 dark:text-green-400'\n : 'text-red-600 dark:text-red-400'\n )}\n >\n ({investment.profitLossPercentage >= 0 ? '+' : ''}\n {investment.profitLossPercentage}%)\n </p>\n </div>\n <div>\n <p className=\"text-sm text-muted-foreground\">ROI</p>\n <p className=\"font-semibold text-foreground\">{investment.roiAnnual}% p.a.</p>\n </div>\n <div>\n <p className=\"text-sm text-muted-foreground\">Invested on</p>\n <p className=\"font-semibold text-foreground\">\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 px-3 py-2 text-sm font-medium text-foreground 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 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-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n Explore Investment Opportunities\n </button>\n }\n />\n )}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;AAmEA,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,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E,WAAW,EACT,WACA,EAAW,cAAc,IACrB,uCACA,iCACL;sBANH;aAOC;aACG,EAAW,wBAAwB,IAAI,MAAM;aAC9C,EAAW;aAAqB;aAC/B;;WACA,EAAA,CAAA;UACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;WAAG,WAAU;qBAAgC;WAAO,CAAA,EACpD,kBAAC,KAAD;WAAG,WAAU;qBAAb,CAA8C,EAAW,WAAU,SAAU;aACzE,EAAA,CAAA;UACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;WAAG,WAAU;qBAAgC;WAAe,CAAA,EAC5D,kBAAC,KAAD;WAAG,WAAU;qBACV,EAAW,EAAW,gBAAgB;YACrC,MAAM,KAAA;YACN,QAAQ,KAAA;YACT,CAAC;WACA,CAAA,CACA,EAAA,CAAA;UACF;;QACF;UAEN,kBAAC,OAAD;OAAK,WAAU;iBACb,kBAAC,UAAD;QACE,MAAK;QACL,eAAe,EAAW,yBAAyB,EAAW,KAAK;QACnE,WAAU;kBAHZ,CAKE,kBAAC,GAAD,EAAK,WAAU,WAAY,CAAA,EAAA,eAEpB;;OACL,CAAA,CACF;QACF;OA7JI,EAAW,GA6Jf,CACN,GAEF,kBAAC,GAAD;KACE,MAAM,kBAAC,GAAD,EAAc,WAAU,aAAc,CAAA;KAC5C,OAAO,MAAM,MAAW,QAAiB,KAAT,EAAY;KAC5C,aACE,MAAW,QACP,6FACA,sBAAsB,EAAO;KAEnC,QACE,kBAAC,UAAD;MACE,MAAK;MACL,eAAe,EAAW,0BAA0B;MACpD,WAAU;gBACX;MAEQ,CAAA;KAEX,CAAA;IAEA,CAAA;GACK"}
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 { 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 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 */}\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\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":";;;;;;;;;;AAmEA,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;EACh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