@burdenoff/microfe-subscriberbot 2026.624.1 → 2026.626.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/subscriberbot/components/EmptyState.js +17 -10
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/InvestmentCard.js +23 -22
- package/dist/subscriberbot/components/InvestmentCard.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.js +15 -12
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +27 -15
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/RatingDisplay.js +3 -3
- package/dist/subscriberbot/components/RatingDisplay.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +25 -13
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/pages/HomePage.js +72 -63
- package/dist/subscriberbot/pages/HomePage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js +106 -100
- package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminDashboard.js +125 -85
- package/dist/subscriberbot/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminFinancialPage.js +51 -45
- package/dist/subscriberbot/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminOrdersPage.js +246 -241
- package/dist/subscriberbot/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminProfilePage.js +131 -129
- package/dist/subscriberbot/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminSettingsPage.js +247 -242
- package/dist/subscriberbot/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/CartManagementPage.js +307 -302
- package/dist/subscriberbot/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/UserManagementPage.js +308 -303
- package/dist/subscriberbot/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js +89 -84
- package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js +269 -264
- package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js +269 -227
- package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js +191 -186
- package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js +168 -166
- package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js +344 -347
- package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js +270 -272
- package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js +294 -289
- package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/HelpSupportPage.js +156 -158
- package/dist/subscriberbot/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/NotificationCenterPage.js +94 -87
- package/dist/subscriberbot/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/SettingsPage.js +749 -740
- package/dist/subscriberbot/pages/common/SettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/BookingDetailsPage.js +357 -324
- package/dist/subscriberbot/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CartDetailPage.js +281 -247
- package/dist/subscriberbot/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js +106 -98
- package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CheckoutPage.js +235 -238
- package/dist/subscriberbot/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CustomerDashboard.js +426 -390
- package/dist/subscriberbot/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CustomerProfilePage.js +488 -479
- package/dist/subscriberbot/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js +522 -512
- package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/FavoritesPage.js +73 -66
- package/dist/subscriberbot/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/OrderHistoryPage.js +75 -67
- package/dist/subscriberbot/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/OrderTrackingPage.js +82 -76
- package/dist/subscriberbot/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js +100 -93
- package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/ReviewsPage.js +97 -90
- package/dist/subscriberbot/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/SavedAddressesPage.js +86 -79
- package/dist/subscriberbot/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js +330 -293
- package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js +269 -261
- package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js +97 -91
- package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorDashboard.js +354 -322
- package/dist/subscriberbot/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js +118 -111
- package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js +75 -69
- package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorProfilePage.js +435 -430
- package/dist/subscriberbot/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/TaskDetailsPage.js +328 -289
- package/dist/subscriberbot/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerDashboard.js +135 -103
- package/dist/subscriberbot/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js +120 -114
- package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerProfilePage.js +125 -120
- package/dist/subscriberbot/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js +354 -344
- package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvestorDashboard.js","names":[],"sources":["../../../../src/subscriberbot/pages/investor/InvestorDashboard.tsx"],"sourcesContent":["/**\n * Investor Dashboard Page\n * @module subscriberbot/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 { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useInvestmentOpportunities, useInvestments } from '../../hooks/useSubscriberBotApi';\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 } = useSubscriberBot();\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-subtle bg-bg-surface 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-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-green-600 dark:text-green-400\">\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-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-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-green-500/10' : 'bg-bg-sunken'\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-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-green-600 dark:text-green-400' : '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-subtle bg-bg-surface 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-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-subtle bg-bg-surface p-4\">\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-subtle bg-bg-surface p-4\">\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-green-500 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-blue-500 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-yellow-500 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,aA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U;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;;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"}
|
|
1
|
+
{"version":3,"file":"InvestorDashboard.js","names":[],"sources":["../../../../src/subscriberbot/pages/investor/InvestorDashboard.tsx"],"sourcesContent":["/**\n * Investor Dashboard Page\n * @module subscriberbot/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 { PagePurpose, NextSteps, EmphasisPanel } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { MetricsCard } from '../../components/MetricsCard';\nimport { InvestmentCard } from '../../components/InvestmentCard';\nimport { EmptyState } from '../../components/EmptyState';\nimport { RatingDisplay } from '../../components/RatingDisplay';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useInvestmentOpportunities, useInvestments } from '../../hooks/useSubscriberBotApi';\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/20 text-status-success-text';\n case 'medium':\n return 'bg-status-warning-bg/20 text-status-warning-text';\n case 'high':\n return 'bg-status-error-bg/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/20 text-status-success-text';\n case 'pending':\n return 'bg-status-warning-bg/20 text-status-warning-text';\n case 'completed':\n return 'bg-status-info-bg/20 text-status-info-text';\n default:\n return 'bg-secondary text-secondary-foreground';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function InvestorDashboard() {\n const { navigateTo, currentUser } = useSubscriberBot();\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 titleGradient\n >\n <PagePurpose icon={<Briefcase className=\"h-4 w-4\" />} className=\"mb-6\">\n Your investment home base. Back promising local carts in exchange for equity, then\n watch your money grow — track total invested, current value, returns and monthly\n income at a glance. Browse new opportunities, dig into any holding, and let the AI\n insights flag businesses worth a closer look.\n </PagePurpose>\n\n <NextSteps\n storageKey=\"subscriberbot-investor-dashboard\"\n steps={[\n {\n id: 'browse-opps',\n label: 'Explore new opportunities',\n description: 'Find local carts seeking investment that match your goals.',\n icon: <Target className=\"h-4 w-4\" />,\n onClick: () => navigateTo('/investor/opportunities'),\n },\n {\n id: 'review-portfolio',\n label: 'Review your portfolio',\n description: 'Check how each of your holdings is performing.',\n icon: <PieChart className=\"h-4 w-4\" />,\n onClick: () => navigateTo('/investor/portfolio'),\n },\n {\n id: 'check-analytics',\n label: 'Analyse your returns',\n description: 'See trends in income and ROI across your investments.',\n icon: <BarChart3 className=\"h-4 w-4\" />,\n onClick: () => navigateTo('/investor/analytics'),\n },\n ]}\n />\n\n {/* Portfolio Summary Metrics — the ONE emphasis zone */}\n <EmphasisPanel>\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 </EmphasisPanel>\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-seam 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 <EmptyState\n illustration=\"empty-data\"\n title=\"No active investments yet\"\n description=\"You haven't backed any carts so far. Browse opportunities to make your first investment and start building your portfolio.\"\n action={\n <button\n type=\"button\"\n onClick={() => setActiveTab('opportunities')}\n className=\"inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent/80 transition-colors\"\n >\n <Target className=\"h-4 w-4\" />\n Browse opportunities\n </button>\n }\n />\n ) : (\n investments.map((investment) => (\n <div\n key={investment.id}\n className=\"rounded-lg border border-border-seam bg-bg-surface 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-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-seam 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-seam 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/10' : 'bg-bg-sunken'\n )}\n >\n <Activity\n className={cn(\n 'h-4 w-4',\n activity.amount > 0 ? 'text-status-success-text' : 'text-text-secondary'\n )}\n />\n </div>\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n {activity.description}\n </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\">\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\n key={insight.id}\n className=\"rounded-lg border border-border-seam bg-bg-sunken/50 p-3\"\n >\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\">\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-seam 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-seam 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-seam 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-seam 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\">\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-status-info-border 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":";;;;;;;;;;;;;AAyDA,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,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,+BAAgC,CAAA,EAAA,uBAE3C;;SACT,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAW,sBAAsB;UAChD,WAAU;oBAHZ,CAKE,kBAAC,GAAD,EAAW,WAAU,+BAAgC,CAAA,EAAA,uBAE9C;;SACT,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAW,oBAAoB;UAC9C,WAAU;oBAHZ,CAKE,kBAAC,GAAD,EAAO,WAAU,+BAAgC,CAAA,EAAA,eAE1C;;SACL;UACF;;MAGN,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,MAAD;QAAI,WAAU;kBAAiD;QAAmB,CAAA,EAClF,kBAAC,OAAD;QAAK,WAAU;kBAAf;SACE,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,MAAD;WAAI,WAAU;qBAA0C;WAEnD,CAAA,EACL,kBAAC,KAAD;WAAG,WAAU;qBAAmD;WAE5D,CAAA,CACA;;SACN,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,MAAD;WAAI,WAAU;qBAA0C;WAEnD,CAAA,EACL,kBAAC,KAAD;WAAG,WAAU;qBAAmD;WAE5D,CAAA,CACA;;SACN,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,MAAD;WAAI,WAAU;qBAA0C;WAEnD,CAAA,EACL,kBAAC,KAAD;WAAG,WAAU;qBAAmD;WAE5D,CAAA,CACA;;SACF;UACF;;MACF;OACF;;GACK"}
|
|
@@ -5,10 +5,11 @@ import { MetricsCard as r } from "../../components/MetricsCard.js";
|
|
|
5
5
|
import { EmptyState as i } from "../../components/EmptyState.js";
|
|
6
6
|
import { formatCurrency as a, formatDate as o } from "../../utils/formatters.js";
|
|
7
7
|
import { useEffect as s, useMemo as c, useState as l } from "react";
|
|
8
|
-
import { AlertCircle as u,
|
|
9
|
-
import { jsx as
|
|
8
|
+
import { AlertCircle as u, Briefcase as d, CheckCircle2 as f, Clock as p, Eye as m, IndianRupee as h, Plus 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";
|
|
10
11
|
//#region src/subscriberbot/pages/investor/InvestorInvestmentsPage.tsx
|
|
11
|
-
var
|
|
12
|
+
var w = [
|
|
12
13
|
{
|
|
13
14
|
id: "inv-001",
|
|
14
15
|
cartName: "South Indian Express",
|
|
@@ -84,7 +85,7 @@ var x = [
|
|
|
84
85
|
nextPayout: "-",
|
|
85
86
|
totalReturns: 12e3
|
|
86
87
|
}
|
|
87
|
-
],
|
|
88
|
+
], T = {
|
|
88
89
|
totalInvested: 255e3,
|
|
89
90
|
currentValue: 283700,
|
|
90
91
|
totalReturns: 28700,
|
|
@@ -93,30 +94,30 @@ var x = [
|
|
|
93
94
|
profitLoss: 28700,
|
|
94
95
|
profitLossPercentage: 11.3
|
|
95
96
|
};
|
|
96
|
-
function
|
|
97
|
+
function E(e) {
|
|
97
98
|
switch (e) {
|
|
98
|
-
case "active": return "bg-
|
|
99
|
-
case "pending": return "bg-
|
|
100
|
-
case "matured": return "bg-
|
|
99
|
+
case "active": return "bg-status-success-bg/20 text-status-success-text";
|
|
100
|
+
case "pending": return "bg-status-warning-bg/20 text-status-warning-text";
|
|
101
|
+
case "matured": return "bg-status-info-bg/20 text-status-info-text";
|
|
101
102
|
case "withdrawn": return "bg-secondary text-secondary-foreground";
|
|
102
103
|
default: return "bg-secondary text-secondary-foreground";
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
+
function D(e) {
|
|
106
107
|
switch (e) {
|
|
107
|
-
case "active": return /* @__PURE__ */
|
|
108
|
-
case "pending": return /* @__PURE__ */
|
|
109
|
-
case "matured": return /* @__PURE__ */
|
|
110
|
-
default: return /* @__PURE__ */
|
|
108
|
+
case "active": return /* @__PURE__ */ b(f, { className: "h-4 w-4" });
|
|
109
|
+
case "pending": return /* @__PURE__ */ b(p, { className: "h-4 w-4" });
|
|
110
|
+
case "matured": return /* @__PURE__ */ b(f, { className: "h-4 w-4" });
|
|
111
|
+
default: return /* @__PURE__ */ b(u, { className: "h-4 w-4" });
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
-
let { navigateTo: u } = e(), [
|
|
114
|
+
function O() {
|
|
115
|
+
let { navigateTo: u } = e(), [p, O] = l(!0), [k, A] = l("all");
|
|
115
116
|
s(() => {
|
|
116
|
-
let e = setTimeout(() =>
|
|
117
|
+
let e = setTimeout(() => O(!1), 600);
|
|
117
118
|
return () => clearTimeout(e);
|
|
118
119
|
}, []);
|
|
119
|
-
let
|
|
120
|
+
let j = c(() => k === "all" ? w : w.filter((e) => e.status === k), [k]), M = [
|
|
120
121
|
{
|
|
121
122
|
key: "all",
|
|
122
123
|
label: "All Investments"
|
|
@@ -134,125 +135,130 @@ function T() {
|
|
|
134
135
|
label: "Matured"
|
|
135
136
|
}
|
|
136
137
|
];
|
|
137
|
-
function
|
|
138
|
-
return e === "all" ?
|
|
138
|
+
function N(e) {
|
|
139
|
+
return e === "all" ? w.length : w.filter((t) => t.status === e).length;
|
|
139
140
|
}
|
|
140
|
-
return
|
|
141
|
+
return p ? /* @__PURE__ */ b(n, {
|
|
141
142
|
title: "My Investments",
|
|
142
143
|
description: "Loading your investments...",
|
|
143
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ b("div", {
|
|
144
145
|
className: "flex items-center justify-center py-20",
|
|
145
|
-
children: /* @__PURE__ */
|
|
146
|
+
children: /* @__PURE__ */ x("div", {
|
|
146
147
|
className: "text-center",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ b("div", { className: "mx-auto mb-4 h-12 w-12 animate-spin rounded-full border-b-2 border-primary" }), /* @__PURE__ */ b("p", {
|
|
148
149
|
className: "text-sm text-text-secondary",
|
|
149
150
|
children: "Loading your investments..."
|
|
150
151
|
})]
|
|
151
152
|
})
|
|
152
153
|
})
|
|
153
|
-
}) : /* @__PURE__ */
|
|
154
|
+
}) : /* @__PURE__ */ x(n, {
|
|
154
155
|
title: "My Investments",
|
|
155
156
|
description: "Track and manage your investment portfolio",
|
|
156
|
-
actions: /* @__PURE__ */
|
|
157
|
+
actions: /* @__PURE__ */ x("button", {
|
|
157
158
|
type: "button",
|
|
158
159
|
onClick: () => u("/investor/opportunities"),
|
|
159
160
|
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
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ b(g, { className: "h-4 w-4" }), "New Investment"]
|
|
161
162
|
}),
|
|
162
163
|
children: [
|
|
163
|
-
/* @__PURE__ */ b(
|
|
164
|
+
/* @__PURE__ */ b(C, {
|
|
165
|
+
icon: /* @__PURE__ */ b(d, { className: "h-4 w-4" }),
|
|
166
|
+
className: "mb-6",
|
|
167
|
+
children: "The working list of every investment you hold. Filter by status to focus on active, pending or exited positions, and tap any investment to review its performance in detail. Use it to keep your portfolio tidy and decide where to add, hold or move on."
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ x(S, {
|
|
164
170
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
165
171
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
icon: /* @__PURE__ */ y
|
|
168
|
-
value: a(
|
|
172
|
+
/* @__PURE__ */ b(r, {
|
|
173
|
+
icon: /* @__PURE__ */ b(y, { className: "h-5 w-5" }),
|
|
174
|
+
value: a(T.totalInvested, { minimumFractionDigits: 0 }),
|
|
169
175
|
label: "Total Invested",
|
|
170
176
|
trend: "up",
|
|
171
177
|
trendValue: "Total amount invested"
|
|
172
178
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
icon: /* @__PURE__ */
|
|
175
|
-
value: a(
|
|
179
|
+
/* @__PURE__ */ b(r, {
|
|
180
|
+
icon: /* @__PURE__ */ b(h, { className: "h-5 w-5" }),
|
|
181
|
+
value: a(T.currentValue, { minimumFractionDigits: 0 }),
|
|
176
182
|
label: "Current Value",
|
|
177
|
-
trend:
|
|
178
|
-
trendValue: `${
|
|
183
|
+
trend: T.profitLoss > 0 ? "up" : "down",
|
|
184
|
+
trendValue: `${T.profitLossPercentage > 0 ? "+" : ""}${T.profitLossPercentage}% total returns`
|
|
179
185
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
icon: /* @__PURE__ */
|
|
182
|
-
value: a(
|
|
186
|
+
/* @__PURE__ */ b(r, {
|
|
187
|
+
icon: /* @__PURE__ */ b(v, { className: "h-5 w-5" }),
|
|
188
|
+
value: a(T.totalReturns, { minimumFractionDigits: 0 }),
|
|
183
189
|
label: "Total Returns",
|
|
184
190
|
trend: "up",
|
|
185
191
|
trendValue: "Total profit earned"
|
|
186
192
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
icon: /* @__PURE__ */
|
|
189
|
-
value: String(
|
|
193
|
+
/* @__PURE__ */ b(r, {
|
|
194
|
+
icon: /* @__PURE__ */ b(f, { className: "h-5 w-5" }),
|
|
195
|
+
value: String(T.activeInvestments),
|
|
190
196
|
label: "Active Investments",
|
|
191
197
|
trend: "neutral",
|
|
192
|
-
trendValue: `${
|
|
198
|
+
trendValue: `${T.averageRoi}% avg ROI`
|
|
193
199
|
})
|
|
194
200
|
]
|
|
195
201
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
className: "mt-6 rounded-lg border border-border-
|
|
198
|
-
children: /* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ b("div", {
|
|
203
|
+
className: "mt-6 rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
204
|
+
children: /* @__PURE__ */ b("div", {
|
|
199
205
|
className: "flex flex-wrap gap-2",
|
|
200
|
-
children:
|
|
206
|
+
children: M.map((e) => /* @__PURE__ */ x("button", {
|
|
201
207
|
type: "button",
|
|
202
|
-
onClick: () =>
|
|
203
|
-
className: t("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors",
|
|
204
|
-
children: [e.label, /* @__PURE__ */
|
|
205
|
-
className: t("rounded-full px-2 py-0.5 text-xs",
|
|
206
|
-
children:
|
|
208
|
+
onClick: () => A(e.key),
|
|
209
|
+
className: t("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors", k === e.key ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-primary hover:bg-bg-sunken/80"),
|
|
210
|
+
children: [e.label, /* @__PURE__ */ b("span", {
|
|
211
|
+
className: t("rounded-full px-2 py-0.5 text-xs", k === e.key ? "bg-primary-foreground/20 text-action-primary-text" : "bg-action-primary-bg/10 text-primary"),
|
|
212
|
+
children: N(e.key)
|
|
207
213
|
})]
|
|
208
214
|
}, e.key))
|
|
209
215
|
})
|
|
210
216
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ b("div", {
|
|
212
218
|
className: "mt-6 space-y-4",
|
|
213
|
-
children:
|
|
214
|
-
className: "rounded-lg border border-border-
|
|
215
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: j.length > 0 ? j.map((e) => /* @__PURE__ */ x("div", {
|
|
220
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-4 sm:p-6",
|
|
221
|
+
children: [/* @__PURE__ */ x("div", {
|
|
216
222
|
className: "block space-y-4 lg:hidden",
|
|
217
223
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ x("div", {
|
|
219
225
|
className: "flex items-start justify-between",
|
|
220
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h3", {
|
|
221
227
|
className: "text-lg font-semibold text-text-primary",
|
|
222
228
|
children: e.cartName
|
|
223
|
-
}), /* @__PURE__ */
|
|
229
|
+
}), /* @__PURE__ */ x("p", {
|
|
224
230
|
className: "text-sm text-text-secondary",
|
|
225
231
|
children: ["by ", e.cartOwner]
|
|
226
|
-
})] }), /* @__PURE__ */
|
|
227
|
-
className: t("flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium",
|
|
228
|
-
children: [
|
|
232
|
+
})] }), /* @__PURE__ */ x("span", {
|
|
233
|
+
className: t("flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium", E(e.status)),
|
|
234
|
+
children: [D(e.status), /* @__PURE__ */ b("span", {
|
|
229
235
|
className: "capitalize",
|
|
230
236
|
children: e.status
|
|
231
237
|
})]
|
|
232
238
|
})]
|
|
233
239
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ x("div", {
|
|
235
241
|
className: "grid grid-cols-2 gap-4",
|
|
236
242
|
children: [
|
|
237
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
238
244
|
className: "text-sm text-text-secondary",
|
|
239
245
|
children: "Invested"
|
|
240
|
-
}), /* @__PURE__ */
|
|
246
|
+
}), /* @__PURE__ */ b("p", {
|
|
241
247
|
className: "font-semibold text-text-primary",
|
|
242
248
|
children: a(e.investmentAmount, { minimumFractionDigits: 0 })
|
|
243
249
|
})] }),
|
|
244
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
245
251
|
className: "text-sm text-text-secondary",
|
|
246
252
|
children: "Current Value"
|
|
247
|
-
}), /* @__PURE__ */
|
|
253
|
+
}), /* @__PURE__ */ b("p", {
|
|
248
254
|
className: "font-semibold text-text-primary",
|
|
249
255
|
children: a(e.currentValue, { minimumFractionDigits: 0 })
|
|
250
256
|
})] }),
|
|
251
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
252
258
|
className: "text-sm text-text-secondary",
|
|
253
259
|
children: "P&L"
|
|
254
|
-
}), /* @__PURE__ */
|
|
255
|
-
className: t("font-semibold", e.profitLoss >= 0 ? "text-
|
|
260
|
+
}), /* @__PURE__ */ x("p", {
|
|
261
|
+
className: t("font-semibold", e.profitLoss >= 0 ? "text-status-success-text" : "text-status-error-text"),
|
|
256
262
|
children: [
|
|
257
263
|
e.profitLoss >= 0 ? "+" : "",
|
|
258
264
|
a(e.profitLoss, { minimumFractionDigits: 0 }),
|
|
@@ -262,84 +268,84 @@ function T() {
|
|
|
262
268
|
"%)"
|
|
263
269
|
]
|
|
264
270
|
})] }),
|
|
265
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
266
272
|
className: "text-sm text-text-secondary",
|
|
267
273
|
children: "ROI"
|
|
268
|
-
}), /* @__PURE__ */
|
|
274
|
+
}), /* @__PURE__ */ x("p", {
|
|
269
275
|
className: "font-semibold text-text-primary",
|
|
270
276
|
children: [e.roiAnnual, "% p.a."]
|
|
271
277
|
})] })
|
|
272
278
|
]
|
|
273
279
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
className: "flex items-center justify-between border-t border-border-
|
|
276
|
-
children: [/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ x("div", {
|
|
281
|
+
className: "flex items-center justify-between border-t border-border-seam pt-2",
|
|
282
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
277
283
|
className: "text-xs text-text-secondary",
|
|
278
284
|
children: "Invested on"
|
|
279
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ b("p", {
|
|
280
286
|
className: "text-sm font-medium text-text-primary",
|
|
281
287
|
children: o(e.investmentDate, {
|
|
282
288
|
hour: void 0,
|
|
283
289
|
minute: void 0
|
|
284
290
|
})
|
|
285
|
-
})] }), /* @__PURE__ */
|
|
291
|
+
})] }), /* @__PURE__ */ x("button", {
|
|
286
292
|
type: "button",
|
|
287
293
|
onClick: () => u(`/investor/investments/${e.id}`),
|
|
288
|
-
className: "flex items-center gap-2 rounded-lg border border-border-
|
|
289
|
-
children: [/* @__PURE__ */
|
|
294
|
+
className: "flex items-center gap-2 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
295
|
+
children: [/* @__PURE__ */ b(m, { className: "h-4 w-4" }), "View Details"]
|
|
290
296
|
})]
|
|
291
297
|
})
|
|
292
298
|
]
|
|
293
|
-
}), /* @__PURE__ */
|
|
299
|
+
}), /* @__PURE__ */ x("div", {
|
|
294
300
|
className: "hidden lg:flex lg:items-center lg:justify-between",
|
|
295
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ x("div", {
|
|
296
302
|
className: "min-w-0 flex-1",
|
|
297
303
|
children: [
|
|
298
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ x("div", {
|
|
299
305
|
className: "mb-2 flex items-center justify-between",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
306
|
+
children: [/* @__PURE__ */ b("h3", {
|
|
301
307
|
className: "text-lg font-semibold text-text-primary",
|
|
302
308
|
children: e.cartName
|
|
303
|
-
}), /* @__PURE__ */
|
|
304
|
-
className: t("flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium",
|
|
305
|
-
children: [
|
|
309
|
+
}), /* @__PURE__ */ x("span", {
|
|
310
|
+
className: t("flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium", E(e.status)),
|
|
311
|
+
children: [D(e.status), /* @__PURE__ */ b("span", {
|
|
306
312
|
className: "capitalize",
|
|
307
313
|
children: e.status
|
|
308
314
|
})]
|
|
309
315
|
})]
|
|
310
316
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ x("p", {
|
|
312
318
|
className: "mb-4 text-sm text-text-secondary",
|
|
313
319
|
children: ["by ", e.cartOwner]
|
|
314
320
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ x("div", {
|
|
316
322
|
className: "grid grid-cols-5 gap-6",
|
|
317
323
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
319
325
|
className: "text-sm text-text-secondary",
|
|
320
326
|
children: "Invested"
|
|
321
|
-
}), /* @__PURE__ */
|
|
327
|
+
}), /* @__PURE__ */ b("p", {
|
|
322
328
|
className: "font-semibold text-text-primary",
|
|
323
329
|
children: a(e.investmentAmount, { minimumFractionDigits: 0 })
|
|
324
330
|
})] }),
|
|
325
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
326
332
|
className: "text-sm text-text-secondary",
|
|
327
333
|
children: "Current Value"
|
|
328
|
-
}), /* @__PURE__ */
|
|
334
|
+
}), /* @__PURE__ */ b("p", {
|
|
329
335
|
className: "font-semibold text-text-primary",
|
|
330
336
|
children: a(e.currentValue, { minimumFractionDigits: 0 })
|
|
331
337
|
})] }),
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ x("div", { children: [
|
|
339
|
+
/* @__PURE__ */ b("p", {
|
|
334
340
|
className: "text-sm text-text-secondary",
|
|
335
341
|
children: "P&L"
|
|
336
342
|
}),
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
className: t("font-semibold", e.profitLoss >= 0 ? "text-
|
|
343
|
+
/* @__PURE__ */ x("p", {
|
|
344
|
+
className: t("font-semibold", e.profitLoss >= 0 ? "text-status-success-text" : "text-status-error-text"),
|
|
339
345
|
children: [e.profitLoss >= 0 ? "+" : "", a(e.profitLoss, { minimumFractionDigits: 0 })]
|
|
340
346
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
className: t("text-xs", e.profitLoss >= 0 ? "text-
|
|
347
|
+
/* @__PURE__ */ x("p", {
|
|
348
|
+
className: t("text-xs", e.profitLoss >= 0 ? "text-status-success-text" : "text-status-error-text"),
|
|
343
349
|
children: [
|
|
344
350
|
"(",
|
|
345
351
|
e.profitLossPercentage >= 0 ? "+" : "",
|
|
@@ -348,17 +354,17 @@ function T() {
|
|
|
348
354
|
]
|
|
349
355
|
})
|
|
350
356
|
] }),
|
|
351
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
352
358
|
className: "text-sm text-text-secondary",
|
|
353
359
|
children: "ROI"
|
|
354
|
-
}), /* @__PURE__ */
|
|
360
|
+
}), /* @__PURE__ */ x("p", {
|
|
355
361
|
className: "font-semibold text-text-primary",
|
|
356
362
|
children: [e.roiAnnual, "% p.a."]
|
|
357
363
|
})] }),
|
|
358
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
359
365
|
className: "text-sm text-text-secondary",
|
|
360
366
|
children: "Invested on"
|
|
361
|
-
}), /* @__PURE__ */
|
|
367
|
+
}), /* @__PURE__ */ b("p", {
|
|
362
368
|
className: "font-semibold text-text-primary",
|
|
363
369
|
children: o(e.investmentDate, {
|
|
364
370
|
hour: void 0,
|
|
@@ -368,21 +374,22 @@ function T() {
|
|
|
368
374
|
]
|
|
369
375
|
})
|
|
370
376
|
]
|
|
371
|
-
}), /* @__PURE__ */
|
|
377
|
+
}), /* @__PURE__ */ b("div", {
|
|
372
378
|
className: "ml-6",
|
|
373
|
-
children: /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ x("button", {
|
|
374
380
|
type: "button",
|
|
375
381
|
onClick: () => u(`/investor/investments/${e.id}`),
|
|
376
|
-
className: "flex items-center gap-2 rounded-lg border border-border-
|
|
377
|
-
children: [/* @__PURE__ */
|
|
382
|
+
className: "flex items-center gap-2 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
383
|
+
children: [/* @__PURE__ */ b(m, { className: "h-4 w-4" }), "View Details"]
|
|
378
384
|
})
|
|
379
385
|
})]
|
|
380
386
|
})]
|
|
381
|
-
}, e.id)) : /* @__PURE__ */
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
387
|
+
}, e.id)) : /* @__PURE__ */ b(i, {
|
|
388
|
+
illustration: "empty-data",
|
|
389
|
+
icon: /* @__PURE__ */ b(_, { className: "h-12 w-12" }),
|
|
390
|
+
title: `No ${k === "all" ? "" : k} investments found`,
|
|
391
|
+
description: k === "all" ? "You haven't made any investments yet. Start exploring opportunities to grow your wealth." : `You don't have any ${k} investments at the moment.`,
|
|
392
|
+
action: /* @__PURE__ */ b("button", {
|
|
386
393
|
type: "button",
|
|
387
394
|
onClick: () => u("/investor/opportunities"),
|
|
388
395
|
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",
|
|
@@ -394,6 +401,6 @@ function T() {
|
|
|
394
401
|
});
|
|
395
402
|
}
|
|
396
403
|
//#endregion
|
|
397
|
-
export {
|
|
404
|
+
export { O as InvestorInvestmentsPage };
|
|
398
405
|
|
|
399
406
|
//# sourceMappingURL=InvestorInvestmentsPage.js.map
|