@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.
Files changed (104) hide show
  1. package/dist/subscriberbot/components/EmptyState.js +17 -10
  2. package/dist/subscriberbot/components/EmptyState.js.map +1 -1
  3. package/dist/subscriberbot/components/InvestmentCard.js +23 -22
  4. package/dist/subscriberbot/components/InvestmentCard.js.map +1 -1
  5. package/dist/subscriberbot/components/MetricsCard.js +15 -12
  6. package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
  7. package/dist/subscriberbot/components/PageLayout.js +27 -15
  8. package/dist/subscriberbot/components/PageLayout.js.map +1 -1
  9. package/dist/subscriberbot/components/RatingDisplay.js +3 -3
  10. package/dist/subscriberbot/components/RatingDisplay.js.map +1 -1
  11. package/dist/subscriberbot/components/StatusBadge.js +25 -13
  12. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  13. package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
  14. package/dist/subscriberbot/pages/HomePage.js +72 -63
  15. package/dist/subscriberbot/pages/HomePage.js.map +1 -1
  16. package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js +106 -100
  17. package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js.map +1 -1
  18. package/dist/subscriberbot/pages/admin/AdminDashboard.js +125 -85
  19. package/dist/subscriberbot/pages/admin/AdminDashboard.js.map +1 -1
  20. package/dist/subscriberbot/pages/admin/AdminFinancialPage.js +51 -45
  21. package/dist/subscriberbot/pages/admin/AdminFinancialPage.js.map +1 -1
  22. package/dist/subscriberbot/pages/admin/AdminOrdersPage.js +246 -241
  23. package/dist/subscriberbot/pages/admin/AdminOrdersPage.js.map +1 -1
  24. package/dist/subscriberbot/pages/admin/AdminProfilePage.js +131 -129
  25. package/dist/subscriberbot/pages/admin/AdminProfilePage.js.map +1 -1
  26. package/dist/subscriberbot/pages/admin/AdminSettingsPage.js +247 -242
  27. package/dist/subscriberbot/pages/admin/AdminSettingsPage.js.map +1 -1
  28. package/dist/subscriberbot/pages/admin/CartManagementPage.js +307 -302
  29. package/dist/subscriberbot/pages/admin/CartManagementPage.js.map +1 -1
  30. package/dist/subscriberbot/pages/admin/UserManagementPage.js +308 -303
  31. package/dist/subscriberbot/pages/admin/UserManagementPage.js.map +1 -1
  32. package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js +89 -84
  33. package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
  34. package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js +269 -264
  35. package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
  36. package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js +269 -227
  37. package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
  38. package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js +191 -186
  39. package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
  40. package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js +168 -166
  41. package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
  42. package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js +344 -347
  43. package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js.map +1 -1
  44. package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js +270 -272
  45. package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js.map +1 -1
  46. package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js +294 -289
  47. package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js.map +1 -1
  48. package/dist/subscriberbot/pages/common/HelpSupportPage.js +156 -158
  49. package/dist/subscriberbot/pages/common/HelpSupportPage.js.map +1 -1
  50. package/dist/subscriberbot/pages/common/NotificationCenterPage.js +94 -87
  51. package/dist/subscriberbot/pages/common/NotificationCenterPage.js.map +1 -1
  52. package/dist/subscriberbot/pages/common/SettingsPage.js +749 -740
  53. package/dist/subscriberbot/pages/common/SettingsPage.js.map +1 -1
  54. package/dist/subscriberbot/pages/customer/BookingDetailsPage.js +357 -324
  55. package/dist/subscriberbot/pages/customer/BookingDetailsPage.js.map +1 -1
  56. package/dist/subscriberbot/pages/customer/CartDetailPage.js +281 -247
  57. package/dist/subscriberbot/pages/customer/CartDetailPage.js.map +1 -1
  58. package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js +106 -98
  59. package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js.map +1 -1
  60. package/dist/subscriberbot/pages/customer/CheckoutPage.js +235 -238
  61. package/dist/subscriberbot/pages/customer/CheckoutPage.js.map +1 -1
  62. package/dist/subscriberbot/pages/customer/CustomerDashboard.js +426 -390
  63. package/dist/subscriberbot/pages/customer/CustomerDashboard.js.map +1 -1
  64. package/dist/subscriberbot/pages/customer/CustomerProfilePage.js +488 -479
  65. package/dist/subscriberbot/pages/customer/CustomerProfilePage.js.map +1 -1
  66. package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js +522 -512
  67. package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js.map +1 -1
  68. package/dist/subscriberbot/pages/customer/FavoritesPage.js +73 -66
  69. package/dist/subscriberbot/pages/customer/FavoritesPage.js.map +1 -1
  70. package/dist/subscriberbot/pages/customer/OrderHistoryPage.js +75 -67
  71. package/dist/subscriberbot/pages/customer/OrderHistoryPage.js.map +1 -1
  72. package/dist/subscriberbot/pages/customer/OrderTrackingPage.js +82 -76
  73. package/dist/subscriberbot/pages/customer/OrderTrackingPage.js.map +1 -1
  74. package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js +100 -93
  75. package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js.map +1 -1
  76. package/dist/subscriberbot/pages/customer/ReviewsPage.js +97 -90
  77. package/dist/subscriberbot/pages/customer/ReviewsPage.js.map +1 -1
  78. package/dist/subscriberbot/pages/customer/SavedAddressesPage.js +86 -79
  79. package/dist/subscriberbot/pages/customer/SavedAddressesPage.js.map +1 -1
  80. package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js +330 -293
  81. package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js.map +1 -1
  82. package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js +269 -261
  83. package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
  84. package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js +97 -91
  85. package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js.map +1 -1
  86. package/dist/subscriberbot/pages/investor/InvestorDashboard.js +354 -322
  87. package/dist/subscriberbot/pages/investor/InvestorDashboard.js.map +1 -1
  88. package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js +118 -111
  89. package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js.map +1 -1
  90. package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js +75 -69
  91. package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js.map +1 -1
  92. package/dist/subscriberbot/pages/investor/InvestorProfilePage.js +435 -430
  93. package/dist/subscriberbot/pages/investor/InvestorProfilePage.js.map +1 -1
  94. package/dist/subscriberbot/pages/worker/TaskDetailsPage.js +328 -289
  95. package/dist/subscriberbot/pages/worker/TaskDetailsPage.js.map +1 -1
  96. package/dist/subscriberbot/pages/worker/WorkerDashboard.js +135 -103
  97. package/dist/subscriberbot/pages/worker/WorkerDashboard.js.map +1 -1
  98. package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js +120 -114
  99. package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js.map +1 -1
  100. package/dist/subscriberbot/pages/worker/WorkerProfilePage.js +125 -120
  101. package/dist/subscriberbot/pages/worker/WorkerProfilePage.js.map +1 -1
  102. package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js +354 -344
  103. package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js.map +1 -1
  104. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"AdminDashboard.js","names":[],"sources":["../../../../src/subscriberbot/pages/admin/AdminDashboard.tsx"],"sourcesContent":["/**\n * Admin Dashboard Page\n * @module subscriberbot/pages/admin\n *\n * Full-featured admin dashboard with loading state, 8 stats cards,\n * user distribution, recent activity, system health, financial overview,\n * management links, pending approvals banner, and quick actions.\n */\n\nimport { useState, useEffect } from 'react';\nimport {\n Users,\n Store,\n ShoppingBag,\n IndianRupee,\n Activity,\n ArrowRight,\n CheckCircle2,\n AlertCircle,\n Clock,\n UserPlus,\n Settings,\n BarChart3,\n ShieldCheck,\n Server,\n Database,\n Wifi,\n CreditCard,\n TrendingUp,\n FileText,\n AlertTriangle,\n Loader2,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { MetricsCard } from '../../components/MetricsCard';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { cn } from '../../utils/cn';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\ninterface SystemMetrics {\n totalUsers: number;\n totalCarts: number;\n totalOrders: number;\n totalInvestments: number;\n activeUsers: number;\n pendingApprovals: number;\n totalRevenue: number;\n platformCommission: number;\n}\n\ninterface RecentActivity {\n id: string;\n type: 'user_registration' | 'cart_approval' | 'investment' | 'order' | 'dispute';\n description: string;\n timestamp: string;\n status: 'completed' | 'pending' | 'failed';\n user?: string;\n amount?: number;\n}\n\ninterface UserStats {\n customers: number;\n cartOwners: number;\n workers: number;\n investors: number;\n growth: number;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport function AdminDashboard() {\n const { navigateTo, currentUser } = useSubscriberBot();\n const firstName = currentUser?.firstName ?? currentUser?.name ?? 'Admin';\n\n const [metrics, setMetrics] = useState<SystemMetrics | null>(null);\n const [activities, setActivities] = useState<RecentActivity[]>([]);\n const [userStats, setUserStats] = useState<UserStats | null>(null);\n const [isLoading, setIsLoading] = useState(true);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setMetrics({\n totalUsers: 12847,\n totalCarts: 2934,\n totalOrders: 45621,\n totalInvestments: 1256,\n activeUsers: 8934,\n pendingApprovals: 47,\n totalRevenue: 2450000,\n platformCommission: 122500,\n });\n\n setUserStats({\n customers: 8934,\n cartOwners: 2456,\n workers: 1245,\n investors: 212,\n growth: 15.7,\n });\n\n setActivities([\n {\n id: 'ACT-001',\n type: 'user_registration',\n description: 'New cart owner registered: Rajesh Kumar',\n timestamp: '2 minutes ago',\n status: 'completed',\n user: 'Rajesh Kumar',\n },\n {\n id: 'ACT-002',\n type: 'cart_approval',\n description: 'Cart approval request from Mumbai Chaat Corner',\n timestamp: '5 minutes ago',\n status: 'pending',\n user: 'Priya Sharma',\n },\n {\n id: 'ACT-003',\n type: 'investment',\n description: 'New investment in Dosa Express',\n timestamp: '12 minutes ago',\n status: 'completed',\n user: 'Amit Patel',\n amount: 75000,\n },\n {\n id: 'ACT-004',\n type: 'order',\n description: 'Large order placed: ₹2,500',\n timestamp: '18 minutes ago',\n status: 'completed',\n amount: 2500,\n },\n {\n id: 'ACT-005',\n type: 'dispute',\n description: 'Payment dispute raised by customer',\n timestamp: '25 minutes ago',\n status: 'pending',\n user: 'Suresh Nair',\n amount: 450,\n },\n {\n id: 'ACT-006',\n type: 'user_registration',\n description: 'New investor registered: Fatima Ali',\n timestamp: '32 minutes ago',\n status: 'completed',\n user: 'Fatima Ali',\n },\n ]);\n\n setIsLoading(false);\n }, 1000);\n\n return () => clearTimeout(timer);\n }, []);\n\n const getActivityIcon = (type: RecentActivity['type']) => {\n const iconMap = {\n user_registration: UserPlus,\n cart_approval: Store,\n investment: IndianRupee,\n order: ShoppingBag,\n dispute: AlertTriangle,\n };\n const Icon = iconMap[type] ?? Activity;\n return <Icon className=\"h-4 w-4\" />;\n };\n\n const getActivityIconColor = (type: RecentActivity['type']) => {\n const colorMap: Record<string, string> = {\n user_registration: 'text-blue-600 dark:text-blue-400',\n cart_approval: 'text-purple-600 dark:text-purple-400',\n investment: 'text-emerald-600 dark:text-emerald-400',\n order: 'text-green-600 dark:text-green-400',\n dispute: 'text-yellow-600 dark:text-yellow-400',\n };\n return colorMap[type] ?? 'text-text-secondary';\n };\n\n const getStatusBadge = (status: RecentActivity['status']) => {\n const config = {\n completed: 'bg-green-500/20 text-green-600 dark:text-green-400',\n pending: 'bg-yellow-500/20 text-yellow-600 dark:text-yellow-400',\n failed: 'bg-red-500/20 text-red-600 dark:text-red-400',\n };\n return config[status] ?? 'bg-secondary text-secondary-foreground';\n };\n\n /* ---- Loading state ---- */\n if (isLoading) {\n return (\n <PageLayout title=\"Admin Dashboard\" description=\"Loading...\">\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 className=\"h-10 w-10 animate-spin text-text-secondary mb-4\" />\n <p className=\"text-text-secondary\">Loading admin dashboard...</p>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"Admin Dashboard\"\n description={`Welcome, ${firstName}! Monitor and manage the platform.`}\n actions={\n metrics?.pendingApprovals && metrics.pendingApprovals > 0 ? (\n <div className=\"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2\">\n <AlertTriangle className=\"h-4 w-4 text-red-600 dark:text-red-400\" />\n <span className=\"text-sm font-medium text-red-600 dark:text-red-400\">\n {metrics.pendingApprovals} pending approvals\n </span>\n </div>\n ) : undefined\n }\n >\n {/* Quick Actions */}\n <div className=\"mb-8\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">Quick Actions</h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/carts')}\n className=\"flex items-center gap-3 rounded-lg bg-red-600 hover:bg-red-700 text-white p-3 text-sm font-medium transition-colors\"\n >\n <AlertTriangle className=\"h-5 w-5\" />\n Approve Carts ({metrics?.pendingApprovals})\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/carts')}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <Store className=\"h-5 w-5 text-text-secondary\" />\n Manage Carts\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/users')}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <Users className=\"h-5 w-5 text-text-secondary\" />\n User Management\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/orders')}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <ShoppingBag className=\"h-5 w-5 text-text-secondary\" />\n Order Management\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/financial')}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <IndianRupee className=\"h-5 w-5 text-text-secondary\" />\n Financial Analytics\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/analytics')}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <BarChart3 className=\"h-5 w-5 text-text-secondary\" />\n Analytics\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/settings')}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <Settings className=\"h-5 w-5 text-text-secondary\" />\n Settings\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/analytics')}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <FileText className=\"h-5 w-5 text-text-secondary\" />\n Reports\n </button>\n </div>\n </div>\n\n {/* Platform Overview - 4 Primary Stats */}\n {metrics && (\n <div className=\"mb-8\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">Platform Overview</h2>\n <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-4\">\n <MetricsCard\n icon={<Users className=\"h-5 w-5\" />}\n value={metrics.totalUsers.toLocaleString('en-IN')}\n label=\"Total Users\"\n trend=\"up\"\n trendValue=\"+15.7%\"\n />\n <MetricsCard\n icon={<Store className=\"h-5 w-5\" />}\n value={metrics.totalCarts.toLocaleString('en-IN')}\n label=\"Active Carts\"\n trend=\"up\"\n trendValue=\"+8 this week\"\n />\n <MetricsCard\n icon={<ShoppingBag className=\"h-5 w-5\" />}\n value={metrics.totalOrders.toLocaleString('en-IN')}\n label=\"Total Orders\"\n trend=\"up\"\n trendValue=\"+12.3%\"\n />\n <MetricsCard\n icon={<IndianRupee className=\"h-5 w-5\" />}\n value={`₹${(metrics.totalRevenue / 100000).toFixed(1)}L`}\n label=\"Total Revenue\"\n trend=\"up\"\n trendValue=\"+8.5%\"\n />\n </div>\n\n {/* 4 Additional Metric Cards */}\n <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-4 mt-4\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <p className=\"text-xs text-text-secondary\">Active Users (24h)</p>\n <p className=\"text-xl font-bold text-green-600 dark:text-green-400\">\n {metrics.activeUsers.toLocaleString('en-IN')}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <p className=\"text-xs text-text-secondary\">Pending Approvals</p>\n <p className=\"text-xl font-bold text-red-600 dark:text-red-400\">\n {metrics.pendingApprovals}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <p className=\"text-xs text-text-secondary\">Total Investments</p>\n <p className=\"text-xl font-bold text-blue-600 dark:text-blue-400\">\n {metrics.totalInvestments.toLocaleString('en-IN')}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <p className=\"text-xs text-text-secondary\">Platform Commission</p>\n <p className=\"text-xl font-bold text-purple-600 dark:text-purple-400\">\n ₹{(metrics.platformCommission / 1000).toFixed(0)}K\n </p>\n </div>\n </div>\n </div>\n )}\n\n {/* User Distribution */}\n {userStats && (\n <div className=\"mb-8\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">User Distribution</h2>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-6\">\n <div className=\"text-center\">\n <div className=\"text-2xl sm:text-3xl font-bold text-blue-600 dark:text-blue-400\">\n {userStats.customers.toLocaleString('en-IN')}\n </div>\n <div className=\"text-sm text-text-secondary\">Customers</div>\n <div className=\"text-xs text-text-secondary\">69.5%</div>\n </div>\n <div className=\"text-center\">\n <div className=\"text-2xl sm:text-3xl font-bold text-green-600 dark:text-green-400\">\n {userStats.cartOwners.toLocaleString('en-IN')}\n </div>\n <div className=\"text-sm text-text-secondary\">Cart Owners</div>\n <div className=\"text-xs text-text-secondary\">19.1%</div>\n </div>\n <div className=\"text-center\">\n <div className=\"text-2xl sm:text-3xl font-bold text-yellow-600 dark:text-yellow-400\">\n {userStats.workers.toLocaleString('en-IN')}\n </div>\n <div className=\"text-sm text-text-secondary\">Workers</div>\n <div className=\"text-xs text-text-secondary\">9.7%</div>\n </div>\n <div className=\"text-center\">\n <div className=\"text-2xl sm:text-3xl font-bold text-purple-600 dark:text-purple-400\">\n {userStats.investors.toLocaleString('en-IN')}\n </div>\n <div className=\"text-sm text-text-secondary\">Investors</div>\n <div className=\"text-xs text-text-secondary\">1.7%</div>\n </div>\n </div>\n <div className=\"mt-4 pt-4 border-t border-border-subtle\">\n <div className=\"flex justify-between items-center\">\n <span className=\"text-sm text-text-secondary\">User Growth (This Month)</span>\n <span className=\"text-sm font-medium text-green-600 dark:text-green-400\">\n +{userStats.growth}%\n </span>\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* Recent Activity */}\n <div className=\"mb-8\">\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Recent Platform Activity</h2>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/analytics')}\n className=\"flex items-center gap-1 text-sm font-medium text-text-secondary hover:text-text-primary transition-colors\"\n >\n View all activities\n <ArrowRight className=\"h-4 w-4\" />\n </button>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface divide-y divide-border\">\n {activities.map((activity) => (\n <div key={activity.id} className=\"flex items-start gap-3 px-4 py-3\">\n <div\n className={cn(\n 'flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-bg-sunken mt-0.5',\n getActivityIconColor(activity.type)\n )}\n >\n {getActivityIcon(activity.type)}\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex flex-col sm:flex-row sm:items-center justify-between gap-2\">\n <p className=\"text-sm font-medium text-text-primary\">{activity.description}</p>\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium capitalize w-fit',\n getStatusBadge(activity.status)\n )}\n >\n {activity.status}\n </span>\n </div>\n <div className=\"flex flex-wrap items-center mt-1 text-xs text-text-secondary gap-3\">\n <span>{activity.timestamp}</span>\n {activity.user && (\n <span className=\"flex items-center gap-1\">\n <Users className=\"h-3 w-3\" />\n {activity.user}\n </span>\n )}\n {activity.amount && (\n <span className=\"flex items-center gap-1\">\n <IndianRupee className=\"h-3 w-3\" />₹{activity.amount.toLocaleString('en-IN')}\n </span>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n\n {/* System Health & Financial Overview */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8\">\n {/* System Health */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-4\">\n <ShieldCheck className=\"h-5 w-5 text-text-secondary\" />\n <h3 className=\"text-lg font-semibold text-text-primary\">System Health</h3>\n </div>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <Server className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-secondary\">Server Status</span>\n </div>\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-green-500/20 px-3 py-1 text-xs font-medium text-green-600 dark:text-green-400\">\n <CheckCircle2 className=\"h-3 w-3\" />\n Healthy\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <Database className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-secondary\">Database Performance</span>\n </div>\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-green-500/20 px-3 py-1 text-xs font-medium text-green-600 dark:text-green-400\">\n <CheckCircle2 className=\"h-3 w-3\" />\n Optimal\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <CreditCard className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-secondary\">Payment Gateway</span>\n </div>\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-green-500/20 px-3 py-1 text-xs font-medium text-green-600 dark:text-green-400\">\n <CheckCircle2 className=\"h-3 w-3\" />\n Online\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <Wifi className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-secondary\">API Response Time</span>\n </div>\n <span className=\"text-sm font-medium text-text-primary\">145ms</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <Clock className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-secondary\">Uptime (30 days)</span>\n </div>\n <span className=\"text-sm font-medium text-text-primary\">99.8%</span>\n </div>\n </div>\n </div>\n\n {/* Financial Overview */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-4\">\n <IndianRupee className=\"h-5 w-5 text-text-secondary\" />\n <h3 className=\"text-lg font-semibold text-text-primary\">Financial Overview</h3>\n </div>\n <div className=\"space-y-3\">\n <div className=\"flex justify-between\">\n <span className=\"text-sm text-text-secondary\">Today&apos;s Revenue</span>\n <span className=\"font-medium text-text-primary\">₹1,45,230</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-sm text-text-secondary\">This Month</span>\n <span className=\"font-medium text-text-primary\">₹24,50,000</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-sm text-text-secondary\">Platform Commission</span>\n <span className=\"font-medium text-text-primary\">₹1,22,500</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-sm text-text-secondary\">Active Investments</span>\n <span className=\"font-medium text-text-primary\">₹1.52Cr</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-sm text-text-secondary\">Pending Payouts</span>\n <span className=\"font-medium text-text-primary\">₹45,600</span>\n </div>\n </div>\n </div>\n </div>\n\n {/* Management Links */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4\">\n {[\n {\n icon: Store,\n label: 'Cart Management',\n desc: 'Approve, manage, and monitor carts',\n path: '/admin/carts',\n },\n {\n icon: Users,\n label: 'User Management',\n desc: 'Manage users and permissions',\n path: '/admin/users',\n },\n {\n icon: BarChart3,\n label: 'Analytics & Reports',\n desc: 'View detailed platform analytics',\n path: '/admin/analytics',\n },\n {\n icon: IndianRupee,\n label: 'Financial Analytics',\n desc: 'View revenue, investments, and financial metrics',\n path: '/admin/financial',\n },\n {\n icon: AlertTriangle,\n label: 'Order & Dispute Management',\n desc: 'Handle orders, disputes, and customer issues',\n path: '/admin/orders',\n },\n {\n icon: Settings,\n label: 'Platform Settings',\n desc: 'Configure platform-wide settings',\n path: '/admin/settings',\n },\n ].map((link) => {\n const LinkIcon = link.icon;\n return (\n <button\n key={link.label}\n type=\"button\"\n onClick={() => navigateTo(link.path)}\n className={cn(\n 'flex items-center gap-4 rounded-lg border border-border-subtle bg-bg-surface p-4 sm:p-6 text-left shadow-sm transition-all',\n 'hover:bg-accent hover:shadow-md'\n )}\n >\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary\">\n <LinkIcon className=\"h-5 w-5\" />\n </div>\n <div className=\"min-w-0\">\n <h3 className=\"font-semibold text-text-primary text-sm sm:text-base\">{link.label}</h3>\n <p className=\"text-xs sm:text-sm text-text-secondary\">{link.desc}</p>\n </div>\n </button>\n );\n })}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;AA2EA,SAAgB,IAAiB;CAC/B,IAAM,EAAE,eAAY,mBAAgB,GAAkB,EAChD,IAAY,GAAa,aAAa,GAAa,QAAQ,SAE3D,CAAC,GAAS,KAAc,EAA+B,KAAK,EAC5D,CAAC,GAAY,KAAiB,EAA2B,EAAE,CAAC,EAC5D,CAAC,GAAW,KAAgB,EAA2B,KAAK,EAC5D,CAAC,GAAW,KAAgB,EAAS,GAAK;AAEhD,SAAgB;EACd,IAAM,IAAQ,iBAAiB;AAyE7B,GAxEA,EAAW;IACT,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,aAAa;IACb,kBAAkB;IAClB,cAAc;IACd,oBAAoB;IACrB,CAAC,EAEF,EAAa;IACX,WAAW;IACX,YAAY;IACZ,SAAS;IACT,WAAW;IACX,QAAQ;IACT,CAAC,EAEF,EAAc;IACZ;KACE,IAAI;KACJ,MAAM;KACN,aAAa;KACb,WAAW;KACX,QAAQ;KACR,MAAM;KACP;IACD;KACE,IAAI;KACJ,MAAM;KACN,aAAa;KACb,WAAW;KACX,QAAQ;KACR,MAAM;KACP;IACD;KACE,IAAI;KACJ,MAAM;KACN,aAAa;KACb,WAAW;KACX,QAAQ;KACR,MAAM;KACN,QAAQ;KACT;IACD;KACE,IAAI;KACJ,MAAM;KACN,aAAa;KACb,WAAW;KACX,QAAQ;KACR,QAAQ;KACT;IACD;KACE,IAAI;KACJ,MAAM;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F;OACF;;GAGN,kBAAC,OAAD;IAAK,WAAU;cACZ;KACC;MACE,MAAM;MACN,OAAO;MACP,MAAM;MACN,MAAM;MACP;KACD;MACE,MAAM;MACN,OAAO;MACP,MAAM;MACN,MAAM;MACP;KACD;MACE,MAAM;MACN,OAAO;MACP,MAAM;MACN,MAAM;MACP;KACD;MACE,MAAM;MACN,OAAO;MACP,MAAM;MACN,MAAM;MACP;KACD;MACE,MAAM;MACN,OAAO;MACP,MAAM;MACN,MAAM;MACP;KACD;MACE,MAAM;MACN,OAAO;MACP,MAAM;MACN,MAAM;MACP;KACF,CAAC,KAAK,MAAS;KACd,IAAM,IAAW,EAAK;AACtB,YACE,kBAAC,UAAD;MAEE,MAAK;MACL,eAAe,EAAW,EAAK,KAAK;MACpC,WAAW,EACT,8HACA,kCACD;gBAPH,CASE,kBAAC,OAAD;OAAK,WAAU;iBACb,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;OAC5B,CAAA,EACN,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,MAAD;QAAI,WAAU;kBAAwD,EAAK;QAAW,CAAA,EACtF,kBAAC,KAAD;QAAG,WAAU;kBAA0C,EAAK;QAAS,CAAA,CACjE;SACC;QAfF,EAAK,MAeH;MAEX;IACE,CAAA;GACK"}
1
+ {"version":3,"file":"AdminDashboard.js","names":[],"sources":["../../../../src/subscriberbot/pages/admin/AdminDashboard.tsx"],"sourcesContent":["/**\n * Admin Dashboard Page\n * @module subscriberbot/pages/admin\n *\n * Full-featured admin dashboard with loading state, 8 stats cards,\n * user distribution, recent activity, system health, financial overview,\n * management links, pending approvals banner, and quick actions.\n */\n\nimport { useState, useEffect } from 'react';\nimport {\n Users,\n Store,\n ShoppingBag,\n IndianRupee,\n Activity,\n ArrowRight,\n CheckCircle2,\n AlertCircle,\n Clock,\n UserPlus,\n Settings,\n BarChart3,\n ShieldCheck,\n Server,\n Database,\n Wifi,\n CreditCard,\n TrendingUp,\n FileText,\n AlertTriangle,\n Loader2,\n} from 'lucide-react';\nimport { PagePurpose, NextSteps, EmphasisPanel } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { MetricsCard } from '../../components/MetricsCard';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { cn } from '../../utils/cn';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\ninterface SystemMetrics {\n totalUsers: number;\n totalCarts: number;\n totalOrders: number;\n totalInvestments: number;\n activeUsers: number;\n pendingApprovals: number;\n totalRevenue: number;\n platformCommission: number;\n}\n\ninterface RecentActivity {\n id: string;\n type: 'user_registration' | 'cart_approval' | 'investment' | 'order' | 'dispute';\n description: string;\n timestamp: string;\n status: 'completed' | 'pending' | 'failed';\n user?: string;\n amount?: number;\n}\n\ninterface UserStats {\n customers: number;\n cartOwners: number;\n workers: number;\n investors: number;\n growth: number;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport function AdminDashboard() {\n const { navigateTo, currentUser } = useSubscriberBot();\n const firstName = currentUser?.firstName ?? currentUser?.name ?? 'Admin';\n\n const [metrics, setMetrics] = useState<SystemMetrics | null>(null);\n const [activities, setActivities] = useState<RecentActivity[]>([]);\n const [userStats, setUserStats] = useState<UserStats | null>(null);\n const [isLoading, setIsLoading] = useState(true);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setMetrics({\n totalUsers: 12847,\n totalCarts: 2934,\n totalOrders: 45621,\n totalInvestments: 1256,\n activeUsers: 8934,\n pendingApprovals: 47,\n totalRevenue: 2450000,\n platformCommission: 122500,\n });\n\n setUserStats({\n customers: 8934,\n cartOwners: 2456,\n workers: 1245,\n investors: 212,\n growth: 15.7,\n });\n\n setActivities([\n {\n id: 'ACT-001',\n type: 'user_registration',\n description: 'New cart owner registered: Rajesh Kumar',\n timestamp: '2 minutes ago',\n status: 'completed',\n user: 'Rajesh Kumar',\n },\n {\n id: 'ACT-002',\n type: 'cart_approval',\n description: 'Cart approval request from Mumbai Chaat Corner',\n timestamp: '5 minutes ago',\n status: 'pending',\n user: 'Priya Sharma',\n },\n {\n id: 'ACT-003',\n type: 'investment',\n description: 'New investment in Dosa Express',\n timestamp: '12 minutes ago',\n status: 'completed',\n user: 'Amit Patel',\n amount: 75000,\n },\n {\n id: 'ACT-004',\n type: 'order',\n description: 'Large order placed: ₹2,500',\n timestamp: '18 minutes ago',\n status: 'completed',\n amount: 2500,\n },\n {\n id: 'ACT-005',\n type: 'dispute',\n description: 'Payment dispute raised by customer',\n timestamp: '25 minutes ago',\n status: 'pending',\n user: 'Suresh Nair',\n amount: 450,\n },\n {\n id: 'ACT-006',\n type: 'user_registration',\n description: 'New investor registered: Fatima Ali',\n timestamp: '32 minutes ago',\n status: 'completed',\n user: 'Fatima Ali',\n },\n ]);\n\n setIsLoading(false);\n }, 1000);\n\n return () => clearTimeout(timer);\n }, []);\n\n const getActivityIcon = (type: RecentActivity['type']) => {\n const iconMap = {\n user_registration: UserPlus,\n cart_approval: Store,\n investment: IndianRupee,\n order: ShoppingBag,\n dispute: AlertTriangle,\n };\n const Icon = iconMap[type] ?? Activity;\n return <Icon className=\"h-4 w-4\" />;\n };\n\n const getActivityIconColor = (type: RecentActivity['type']) => {\n const colorMap: Record<string, string> = {\n user_registration: 'text-status-info-text',\n cart_approval: 'text-accent-purple',\n investment: 'text-status-success-text',\n order: 'text-status-success-text',\n dispute: 'text-status-warning-text',\n };\n return colorMap[type] ?? 'text-text-secondary';\n };\n\n const getStatusBadge = (status: RecentActivity['status']) => {\n const config = {\n completed: 'bg-status-success-bg/20 text-status-success-text',\n pending: 'bg-status-warning-bg/20 text-status-warning-text',\n failed: 'bg-status-error-bg/20 text-status-error-text',\n };\n return config[status] ?? 'bg-secondary text-secondary-foreground';\n };\n\n /* ---- Loading state ---- */\n if (isLoading) {\n return (\n <PageLayout title=\"Admin Dashboard\" description=\"Loading...\">\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 className=\"h-10 w-10 animate-spin text-text-secondary mb-4\" />\n <p className=\"text-text-secondary\">Loading admin dashboard...</p>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"Admin Dashboard\"\n description={`Welcome, ${firstName}! Monitor and manage the platform.`}\n titleGradient\n actions={\n metrics?.pendingApprovals && metrics.pendingApprovals > 0 ? (\n <div className=\"flex items-center gap-2 rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-3 py-2\">\n <AlertTriangle className=\"h-4 w-4 text-status-error-text\" />\n <span className=\"text-sm font-medium text-status-error-text\">\n {metrics.pendingApprovals} pending approvals\n </span>\n </div>\n ) : undefined\n }\n >\n <PagePurpose\n icon={<ShieldCheck className=\"h-4 w-4\" />}\n className=\"mb-6\"\n >\n Your control room for the whole SubscriberBot marketplace. Use this dashboard to\n keep the platform healthy at a glance — approve new carts before they go live,\n watch user growth and revenue trends, and jump straight to the area that needs\n attention. Start with anything flagged as pending; everything else can wait.\n </PagePurpose>\n\n <NextSteps\n storageKey=\"subscriberbot-admin-dashboard\"\n steps={[\n {\n id: 'approve-carts',\n label: 'Review pending cart approvals',\n description: 'Vet new service providers before customers can find them.',\n icon: <AlertTriangle className=\"h-4 w-4\" />,\n onClick: () => navigateTo('/admin/carts'),\n },\n {\n id: 'check-users',\n label: 'Check on user accounts',\n description: 'Spot suspicious sign-ups or accounts needing action.',\n icon: <Users className=\"h-4 w-4\" />,\n onClick: () => navigateTo('/admin/users'),\n },\n {\n id: 'review-finance',\n label: 'Review platform finances',\n description: 'Track revenue, commission and payouts at a glance.',\n icon: <IndianRupee className=\"h-4 w-4\" />,\n onClick: () => navigateTo('/admin/financial'),\n },\n {\n id: 'dive-analytics',\n label: 'Dive into analytics',\n description: 'Understand growth, retention and order trends in depth.',\n icon: <BarChart3 className=\"h-4 w-4\" />,\n onClick: () => navigateTo('/admin/analytics'),\n },\n ]}\n />\n\n {/* Quick Actions */}\n <div className=\"mb-8\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">Quick Actions</h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/carts')}\n className=\"flex items-center gap-3 rounded-lg bg-status-error-text hover:bg-status-error-text text-text-inverse p-3 text-sm font-medium transition-colors\"\n >\n <AlertTriangle className=\"h-5 w-5\" />\n Approve Carts ({metrics?.pendingApprovals})\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/carts')}\n className=\"flex items-center gap-3 rounded-lg border border-border-seam bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <Store className=\"h-5 w-5 text-text-secondary\" />\n Manage Carts\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/users')}\n className=\"flex items-center gap-3 rounded-lg border border-border-seam bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <Users className=\"h-5 w-5 text-text-secondary\" />\n User Management\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/orders')}\n className=\"flex items-center gap-3 rounded-lg border border-border-seam bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <ShoppingBag className=\"h-5 w-5 text-text-secondary\" />\n Order Management\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/financial')}\n className=\"flex items-center gap-3 rounded-lg border border-border-seam bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <IndianRupee className=\"h-5 w-5 text-text-secondary\" />\n Financial Analytics\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/analytics')}\n className=\"flex items-center gap-3 rounded-lg border border-border-seam bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <BarChart3 className=\"h-5 w-5 text-text-secondary\" />\n Analytics\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/settings')}\n className=\"flex items-center gap-3 rounded-lg border border-border-seam bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <Settings className=\"h-5 w-5 text-text-secondary\" />\n Settings\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/analytics')}\n className=\"flex items-center gap-3 rounded-lg border border-border-seam bg-bg-surface hover:bg-accent p-3 text-sm font-medium text-text-primary transition-colors\"\n >\n <FileText className=\"h-5 w-5 text-text-secondary\" />\n Reports\n </button>\n </div>\n </div>\n\n {/* Platform Overview - 4 Primary Stats — the ONE emphasis zone */}\n {metrics && (\n <EmphasisPanel className=\"mb-8\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">Platform Overview</h2>\n <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-4\">\n <MetricsCard\n icon={<Users className=\"h-5 w-5\" />}\n value={metrics.totalUsers.toLocaleString('en-IN')}\n label=\"Total Users\"\n trend=\"up\"\n trendValue=\"+15.7%\"\n />\n <MetricsCard\n icon={<Store className=\"h-5 w-5\" />}\n value={metrics.totalCarts.toLocaleString('en-IN')}\n label=\"Active Carts\"\n trend=\"up\"\n trendValue=\"+8 this week\"\n />\n <MetricsCard\n icon={<ShoppingBag className=\"h-5 w-5\" />}\n value={metrics.totalOrders.toLocaleString('en-IN')}\n label=\"Total Orders\"\n trend=\"up\"\n trendValue=\"+12.3%\"\n />\n <MetricsCard\n icon={<IndianRupee className=\"h-5 w-5\" />}\n value={`₹${(metrics.totalRevenue / 100000).toFixed(1)}L`}\n label=\"Total Revenue\"\n trend=\"up\"\n trendValue=\"+8.5%\"\n />\n </div>\n\n {/* 4 Additional Metric Cards */}\n <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-4 mt-4\">\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4\">\n <p className=\"text-xs text-text-secondary\">Active Users (24h)</p>\n <p className=\"text-xl font-bold text-status-success-text\">\n {metrics.activeUsers.toLocaleString('en-IN')}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4\">\n <p className=\"text-xs text-text-secondary\">Pending Approvals</p>\n <p className=\"text-xl font-bold text-status-error-text\">{metrics.pendingApprovals}</p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4\">\n <p className=\"text-xs text-text-secondary\">Total Investments</p>\n <p className=\"text-xl font-bold text-status-info-text\">\n {metrics.totalInvestments.toLocaleString('en-IN')}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4\">\n <p className=\"text-xs text-text-secondary\">Platform Commission</p>\n <p className=\"text-xl font-bold text-accent-purple\">\n ₹{(metrics.platformCommission / 1000).toFixed(0)}K\n </p>\n </div>\n </div>\n </EmphasisPanel>\n )}\n\n {/* User Distribution */}\n {userStats && (\n <div className=\"mb-8\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">User Distribution</h2>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6\">\n <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-6\">\n <div className=\"text-center\">\n <div className=\"text-2xl sm:text-3xl font-bold text-status-info-text\">\n {userStats.customers.toLocaleString('en-IN')}\n </div>\n <div className=\"text-sm text-text-secondary\">Customers</div>\n <div className=\"text-xs text-text-secondary\">69.5%</div>\n </div>\n <div className=\"text-center\">\n <div className=\"text-2xl sm:text-3xl font-bold text-status-success-text\">\n {userStats.cartOwners.toLocaleString('en-IN')}\n </div>\n <div className=\"text-sm text-text-secondary\">Cart Owners</div>\n <div className=\"text-xs text-text-secondary\">19.1%</div>\n </div>\n <div className=\"text-center\">\n <div className=\"text-2xl sm:text-3xl font-bold text-status-warning-text\">\n {userStats.workers.toLocaleString('en-IN')}\n </div>\n <div className=\"text-sm text-text-secondary\">Workers</div>\n <div className=\"text-xs text-text-secondary\">9.7%</div>\n </div>\n <div className=\"text-center\">\n <div className=\"text-2xl sm:text-3xl font-bold text-accent-purple\">\n {userStats.investors.toLocaleString('en-IN')}\n </div>\n <div className=\"text-sm text-text-secondary\">Investors</div>\n <div className=\"text-xs text-text-secondary\">1.7%</div>\n </div>\n </div>\n <div className=\"mt-4 pt-4 border-t border-border-seam\">\n <div className=\"flex justify-between items-center\">\n <span className=\"text-sm text-text-secondary\">User Growth (This Month)</span>\n <span className=\"text-sm font-medium text-status-success-text\">\n +{userStats.growth}%\n </span>\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* Recent Activity */}\n <div className=\"mb-8\">\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Recent Platform Activity</h2>\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin/analytics')}\n className=\"flex items-center gap-1 text-sm font-medium text-text-secondary hover:text-text-primary transition-colors\"\n >\n View all activities\n <ArrowRight className=\"h-4 w-4\" />\n </button>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface divide-y divide-border\">\n {activities.map((activity) => (\n <div key={activity.id} className=\"flex items-start gap-3 px-4 py-3\">\n <div\n className={cn(\n 'flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-bg-sunken mt-0.5',\n getActivityIconColor(activity.type)\n )}\n >\n {getActivityIcon(activity.type)}\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex flex-col sm:flex-row sm:items-center justify-between gap-2\">\n <p className=\"text-sm font-medium text-text-primary\">{activity.description}</p>\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium capitalize w-fit',\n getStatusBadge(activity.status)\n )}\n >\n {activity.status}\n </span>\n </div>\n <div className=\"flex flex-wrap items-center mt-1 text-xs text-text-secondary gap-3\">\n <span>{activity.timestamp}</span>\n {activity.user && (\n <span className=\"flex items-center gap-1\">\n <Users className=\"h-3 w-3\" />\n {activity.user}\n </span>\n )}\n {activity.amount && (\n <span className=\"flex items-center gap-1\">\n <IndianRupee className=\"h-3 w-3\" />₹{activity.amount.toLocaleString('en-IN')}\n </span>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n\n {/* System Health & Financial Overview */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8\">\n {/* System Health */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-4\">\n <ShieldCheck className=\"h-5 w-5 text-text-secondary\" />\n <h3 className=\"text-lg font-semibold text-text-primary\">System Health</h3>\n </div>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <Server className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-secondary\">Server Status</span>\n </div>\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-status-success-bg/20 px-3 py-1 text-xs font-medium text-status-success-text\">\n <CheckCircle2 className=\"h-3 w-3\" />\n Healthy\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <Database className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-secondary\">Database Performance</span>\n </div>\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-status-success-bg/20 px-3 py-1 text-xs font-medium text-status-success-text\">\n <CheckCircle2 className=\"h-3 w-3\" />\n Optimal\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <CreditCard className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-secondary\">Payment Gateway</span>\n </div>\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-status-success-bg/20 px-3 py-1 text-xs font-medium text-status-success-text\">\n <CheckCircle2 className=\"h-3 w-3\" />\n Online\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <Wifi className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-secondary\">API Response Time</span>\n </div>\n <span className=\"text-sm font-medium text-text-primary\">145ms</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <Clock className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-secondary\">Uptime (30 days)</span>\n </div>\n <span className=\"text-sm font-medium text-text-primary\">99.8%</span>\n </div>\n </div>\n </div>\n\n {/* Financial Overview */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-4\">\n <IndianRupee className=\"h-5 w-5 text-text-secondary\" />\n <h3 className=\"text-lg font-semibold text-text-primary\">Financial Overview</h3>\n </div>\n <div className=\"space-y-3\">\n <div className=\"flex justify-between\">\n <span className=\"text-sm text-text-secondary\">Today&apos;s Revenue</span>\n <span className=\"font-medium text-text-primary\">₹1,45,230</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-sm text-text-secondary\">This Month</span>\n <span className=\"font-medium text-text-primary\">₹24,50,000</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-sm text-text-secondary\">Platform Commission</span>\n <span className=\"font-medium text-text-primary\">₹1,22,500</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-sm text-text-secondary\">Active Investments</span>\n <span className=\"font-medium text-text-primary\">₹1.52Cr</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-sm text-text-secondary\">Pending Payouts</span>\n <span className=\"font-medium text-text-primary\">₹45,600</span>\n </div>\n </div>\n </div>\n </div>\n\n {/* Management Links */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4\">\n {[\n {\n icon: Store,\n label: 'Cart Management',\n desc: 'Approve, manage, and monitor carts',\n path: '/admin/carts',\n },\n {\n icon: Users,\n label: 'User Management',\n desc: 'Manage users and permissions',\n path: '/admin/users',\n },\n {\n icon: BarChart3,\n label: 'Analytics & Reports',\n desc: 'View detailed platform analytics',\n path: '/admin/analytics',\n },\n {\n icon: IndianRupee,\n label: 'Financial Analytics',\n desc: 'View revenue, investments, and financial metrics',\n path: '/admin/financial',\n },\n {\n icon: AlertTriangle,\n label: 'Order & Dispute Management',\n desc: 'Handle orders, disputes, and customer issues',\n path: '/admin/orders',\n },\n {\n icon: Settings,\n label: 'Platform Settings',\n desc: 'Configure platform-wide settings',\n path: '/admin/settings',\n },\n ].map((link) => {\n const LinkIcon = link.icon;\n return (\n <button\n key={link.label}\n type=\"button\"\n onClick={() => navigateTo(link.path)}\n className={cn(\n 'flex items-center gap-4 rounded-lg border border-border-seam bg-bg-surface p-4 sm:p-6 text-left shadow-sm transition-all',\n 'hover:bg-accent hover:shadow-md'\n )}\n >\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary\">\n <LinkIcon className=\"h-5 w-5\" />\n </div>\n <div className=\"min-w-0\">\n <h3 className=\"font-semibold text-text-primary text-sm sm:text-base\">\n {link.label}\n </h3>\n <p className=\"text-xs sm:text-sm text-text-secondary\">{link.desc}</p>\n </div>\n </button>\n );\n })}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;AA4EA,SAAgB,IAAiB;CAC/B,IAAM,EAAE,eAAY,mBAAgB,GAAkB,EAChD,IAAY,GAAa,aAAa,GAAa,QAAQ,SAE3D,CAAC,GAAS,KAAc,EAA+B,KAAK,EAC5D,CAAC,GAAY,KAAiB,EAA2B,EAAE,CAAC,EAC5D,CAAC,GAAW,KAAgB,EAA2B,KAAK,EAC5D,CAAC,GAAW,KAAgB,EAAS,GAAK;AAEhD,SAAgB;EACd,IAAM,IAAQ,iBAAiB;AAyE7B,GAxEA,EAAW;IACT,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,aAAa;IACb,kBAAkB;IAClB,cAAc;IACd,oBAAoB;IACrB,CAAC,EAEF,EAAa;IACX,WAAW;IACX,YAAY;IACZ,SAAS;IACT,WAAW;IACX,QAAQ;IACT,CAAC,EAEF,EAAc;IACZ;KACE,IAAI;KACJ,MAAM;KACN,aAAa;KACb,WAAW;KACX,QAAQ;KACR,MAAM;KACP;IACD;KACE,IAAI;KACJ,MAAM;KACN,aAAa;KACb,WAAW;KACX,QAAQ;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,CAAC,KAAK,MAAS;KACd,IAAM,IAAW,EAAK;AACtB,YACE,kBAAC,UAAD;MAEE,MAAK;MACL,eAAe,EAAW,EAAK,KAAK;MACpC,WAAW,EACT,4HACA,kCACD;gBAPH,CASE,kBAAC,OAAD;OAAK,WAAU;iBACb,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;OAC5B,CAAA,EACN,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,MAAD;QAAI,WAAU;kBACX,EAAK;QACH,CAAA,EACL,kBAAC,KAAD;QAAG,WAAU;kBAA0C,EAAK;QAAS,CAAA,CACjE;SACC;QAjBF,EAAK,MAiBH;MAEX;IACE,CAAA;GACK"}
@@ -5,13 +5,14 @@ import { formatCurrency as r } from "../../utils/formatters.js";
5
5
  import { useEffect as i, useState as a } from "react";
6
6
  import { ArrowLeft as o, Award as s, BarChart3 as c, Calendar as l, Download as u, IndianRupee as d, Loader2 as f, PieChart as p, ShoppingBag as m, ShoppingCart as h, TrendingDown as g, TrendingUp as _ } from "lucide-react";
7
7
  import { jsx as v, jsxs as y } from "react/jsx-runtime";
8
+ import { EmphasisPanel as b, PagePurpose as x } from "@burdenoff/fe-libs/ui";
8
9
  //#region src/subscriberbot/pages/admin/AdminFinancialPage.tsx
9
- function b() {
10
- let { navigateTo: b } = e(), [x, S] = a(!0), [C, w] = a("30d"), [T, E] = a(null);
10
+ function S() {
11
+ let { navigateTo: S } = e(), [C, w] = a(!0), [T, E] = a("30d"), [D, O] = a(null);
11
12
  i(() => {
12
- S(!0);
13
+ w(!0);
13
14
  let e = setTimeout(() => {
14
- E({
15
+ O({
15
16
  totalRevenue: 285e4,
16
17
  monthlyRevenue: 425e3,
17
18
  revenueGrowth: 12.5,
@@ -122,17 +123,17 @@ function b() {
122
123
  commission: 21250
123
124
  }
124
125
  ]
125
- }), S(!1);
126
+ }), w(!1);
126
127
  }, 1e3);
127
128
  return () => clearTimeout(e);
128
- }, [C]);
129
- let D = (e) => r(e, { minimumFractionDigits: 0 }), O = () => {
129
+ }, [T]);
130
+ let k = (e) => r(e, { minimumFractionDigits: 0 }), A = () => {
130
131
  alert("Financial report export initiated");
131
- }, k = (e) => e === 0 ? /* @__PURE__ */ v(s, { className: "h-5 w-5 text-yellow-500" }) : e === 1 ? /* @__PURE__ */ v(s, { className: "h-5 w-5 text-gray-400" }) : e === 2 ? /* @__PURE__ */ v(s, { className: "h-5 w-5 text-amber-700" }) : /* @__PURE__ */ v("span", {
132
+ }, j = (e) => e === 0 ? /* @__PURE__ */ v(s, { className: "h-5 w-5 text-status-warning-text" }) : e === 1 ? /* @__PURE__ */ v(s, { className: "h-5 w-5 text-text-secondary" }) : e === 2 ? /* @__PURE__ */ v(s, { className: "h-5 w-5 text-status-warning-text" }) : /* @__PURE__ */ v("span", {
132
133
  className: "flex h-5 w-5 items-center justify-center rounded-full bg-bg-sunken text-xs font-bold text-text-secondary",
133
134
  children: e + 1
134
135
  });
135
- return x ? /* @__PURE__ */ v(t, {
136
+ return C ? /* @__PURE__ */ v(t, {
136
137
  title: "Financial Reports",
137
138
  description: "Loading financial data...",
138
139
  children: /* @__PURE__ */ y("div", {
@@ -142,7 +143,7 @@ function b() {
142
143
  children: "Loading financial data..."
143
144
  })]
144
145
  })
145
- }) : T ? /* @__PURE__ */ y(t, {
146
+ }) : D ? /* @__PURE__ */ y(t, {
146
147
  title: "Financial Reports",
147
148
  description: "Revenue, commissions, payouts, and financial trends",
148
149
  actions: /* @__PURE__ */ y("div", {
@@ -150,14 +151,14 @@ function b() {
150
151
  children: [
151
152
  /* @__PURE__ */ y("button", {
152
153
  type: "button",
153
- onClick: () => b("/admin"),
154
- className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
154
+ onClick: () => S("/admin"),
155
+ className: "flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
155
156
  children: [/* @__PURE__ */ v(o, { className: "h-4 w-4" }), " Back"]
156
157
  }),
157
158
  /* @__PURE__ */ y("select", {
158
- value: C,
159
- onChange: (e) => w(e.target.value),
160
- className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
159
+ value: T,
160
+ onChange: (e) => E(e.target.value),
161
+ className: "rounded-lg border border-border-seam bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
161
162
  children: [
162
163
  /* @__PURE__ */ v("option", {
163
164
  value: "7d",
@@ -179,38 +180,43 @@ function b() {
179
180
  }),
180
181
  /* @__PURE__ */ y("button", {
181
182
  type: "button",
182
- onClick: O,
183
+ onClick: A,
183
184
  className: "flex items-center gap-1.5 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",
184
185
  children: [/* @__PURE__ */ v(u, { className: "h-4 w-4" }), " Export Report"]
185
186
  })
186
187
  ]
187
188
  }),
188
189
  children: [
189
- /* @__PURE__ */ y("div", {
190
+ /* @__PURE__ */ v(x, {
191
+ icon: /* @__PURE__ */ v(d, { className: "h-4 w-4" }),
192
+ className: "mb-6",
193
+ children: "The money view of the marketplace. Track total and monthly revenue, the commission the platform earns, and payouts still owed to cart owners. Change the date range to compare periods, see which carts drive the most revenue, and export a report when you need to share the numbers or reconcile payouts."
194
+ }),
195
+ /* @__PURE__ */ y(b, {
190
196
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",
191
197
  children: [
192
198
  /* @__PURE__ */ v(n, {
193
199
  icon: /* @__PURE__ */ v(d, { className: "h-5 w-5" }),
194
- value: D(T.totalRevenue),
200
+ value: k(D.totalRevenue),
195
201
  label: "Total Revenue",
196
202
  trend: "up",
197
- trendValue: `+${T.revenueGrowth}% vs last period`
203
+ trendValue: `+${D.revenueGrowth}% vs last period`
198
204
  }),
199
205
  /* @__PURE__ */ v(n, {
200
206
  icon: /* @__PURE__ */ v(_, { className: "h-5 w-5" }),
201
- value: D(T.monthlyRevenue),
207
+ value: k(D.monthlyRevenue),
202
208
  label: "Monthly Revenue",
203
209
  trendValue: "Current month"
204
210
  }),
205
211
  /* @__PURE__ */ v(n, {
206
212
  icon: /* @__PURE__ */ v(p, { className: "h-5 w-5" }),
207
- value: D(T.commission),
213
+ value: k(D.commission),
208
214
  label: "Commission Earned",
209
215
  trendValue: "Platform commission"
210
216
  }),
211
217
  /* @__PURE__ */ v(n, {
212
218
  icon: /* @__PURE__ */ v(g, { className: "h-5 w-5" }),
213
- value: D(T.pendingPayouts),
219
+ value: k(D.pendingPayouts),
214
220
  label: "Pending Payouts",
215
221
  trendValue: "Amount pending"
216
222
  })
@@ -219,7 +225,7 @@ function b() {
219
225
  /* @__PURE__ */ y("div", {
220
226
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8",
221
227
  children: [/* @__PURE__ */ y("div", {
222
- className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
228
+ className: "rounded-lg border border-border-seam bg-bg-surface p-6",
223
229
  children: [/* @__PURE__ */ y("div", {
224
230
  className: "flex items-center gap-2 mb-4",
225
231
  children: [/* @__PURE__ */ v(h, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ v("h3", {
@@ -228,11 +234,11 @@ function b() {
228
234
  })]
229
235
  }), /* @__PURE__ */ v("div", {
230
236
  className: "space-y-3",
231
- children: T.topPerformingCarts.map((e, t) => /* @__PURE__ */ y("div", {
237
+ children: D.topPerformingCarts.map((e, t) => /* @__PURE__ */ y("div", {
232
238
  className: "flex items-center justify-between rounded-lg bg-bg-sunken/50 p-3",
233
239
  children: [/* @__PURE__ */ y("div", {
234
240
  className: "flex items-center gap-3",
235
- children: [k(t), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
241
+ children: [j(t), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
236
242
  className: "text-sm font-medium text-text-primary",
237
243
  children: e.name
238
244
  }), /* @__PURE__ */ y("p", {
@@ -241,12 +247,12 @@ function b() {
241
247
  })] })]
242
248
  }), /* @__PURE__ */ v("p", {
243
249
  className: "text-sm font-semibold text-text-primary",
244
- children: D(e.revenue)
250
+ children: k(e.revenue)
245
251
  })]
246
252
  }, e.id))
247
253
  })]
248
254
  }), /* @__PURE__ */ y("div", {
249
- className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
255
+ className: "rounded-lg border border-border-seam bg-bg-surface p-6",
250
256
  children: [/* @__PURE__ */ y("div", {
251
257
  className: "flex items-center gap-2 mb-4",
252
258
  children: [/* @__PURE__ */ v(c, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ v("h3", {
@@ -255,7 +261,7 @@ function b() {
255
261
  })]
256
262
  }), /* @__PURE__ */ v("div", {
257
263
  className: "space-y-3",
258
- children: T.revenueByCategory.map((e) => /* @__PURE__ */ y("div", { children: [
264
+ children: D.revenueByCategory.map((e) => /* @__PURE__ */ y("div", { children: [
259
265
  /* @__PURE__ */ y("div", {
260
266
  className: "flex items-center justify-between mb-1",
261
267
  children: [/* @__PURE__ */ v("span", {
@@ -277,7 +283,7 @@ function b() {
277
283
  className: "text-right mt-1",
278
284
  children: /* @__PURE__ */ v("span", {
279
285
  className: "text-sm font-semibold text-text-primary",
280
- children: D(e.amount)
286
+ children: k(e.amount)
281
287
  })
282
288
  })
283
289
  ] }, e.category))
@@ -285,7 +291,7 @@ function b() {
285
291
  })]
286
292
  }),
287
293
  /* @__PURE__ */ y("div", {
288
- className: "rounded-lg border border-border-subtle bg-bg-surface p-6 mb-8",
294
+ className: "rounded-lg border border-border-seam bg-bg-surface p-6 mb-8",
289
295
  children: [/* @__PURE__ */ y("div", {
290
296
  className: "flex items-center gap-2 mb-4",
291
297
  children: [/* @__PURE__ */ v(l, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ v("h3", {
@@ -297,7 +303,7 @@ function b() {
297
303
  children: /* @__PURE__ */ y("table", {
298
304
  className: "w-full",
299
305
  children: [/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ y("tr", {
300
- className: "border-b border-border-subtle bg-bg-sunken/50",
306
+ className: "border-b border-border-seam bg-bg-sunken/50",
301
307
  children: [
302
308
  /* @__PURE__ */ v("th", {
303
309
  className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
@@ -318,7 +324,7 @@ function b() {
318
324
  ]
319
325
  }) }), /* @__PURE__ */ v("tbody", {
320
326
  className: "divide-y divide-border",
321
- children: T.monthlyTrends.map((e) => /* @__PURE__ */ y("tr", {
327
+ children: D.monthlyTrends.map((e) => /* @__PURE__ */ y("tr", {
322
328
  className: "hover:bg-accent/50 transition-colors",
323
329
  children: [
324
330
  /* @__PURE__ */ v("td", {
@@ -327,7 +333,7 @@ function b() {
327
333
  }),
328
334
  /* @__PURE__ */ v("td", {
329
335
  className: "px-4 py-3 text-sm text-right text-text-primary",
330
- children: D(e.revenue)
336
+ children: k(e.revenue)
331
337
  }),
332
338
  /* @__PURE__ */ v("td", {
333
339
  className: "px-4 py-3 text-sm text-right text-text-primary",
@@ -335,7 +341,7 @@ function b() {
335
341
  }),
336
342
  /* @__PURE__ */ v("td", {
337
343
  className: "px-4 py-3 text-sm text-right text-text-primary",
338
- children: D(e.commission)
344
+ children: k(e.commission)
339
345
  })
340
346
  ]
341
347
  }, e.month))
@@ -347,7 +353,7 @@ function b() {
347
353
  className: "grid grid-cols-1 md:grid-cols-3 gap-6",
348
354
  children: [
349
355
  /* @__PURE__ */ y("div", {
350
- className: "rounded-lg border border-border-subtle bg-bg-surface p-6 text-center",
356
+ className: "rounded-lg border border-border-seam bg-bg-surface p-6 text-center",
351
357
  children: [
352
358
  /* @__PURE__ */ v(m, { className: "h-8 w-8 text-primary mx-auto mb-3" }),
353
359
  /* @__PURE__ */ v("h4", {
@@ -356,7 +362,7 @@ function b() {
356
362
  }),
357
363
  /* @__PURE__ */ v("p", {
358
364
  className: "text-2xl font-bold text-primary",
359
- children: T.totalOrders.toLocaleString("en-IN")
365
+ children: D.totalOrders.toLocaleString("en-IN")
360
366
  }),
361
367
  /* @__PURE__ */ v("p", {
362
368
  className: "text-sm text-text-secondary mt-1",
@@ -365,16 +371,16 @@ function b() {
365
371
  ]
366
372
  }),
367
373
  /* @__PURE__ */ y("div", {
368
- className: "rounded-lg border border-border-subtle bg-bg-surface p-6 text-center",
374
+ className: "rounded-lg border border-border-seam bg-bg-surface p-6 text-center",
369
375
  children: [
370
- /* @__PURE__ */ v(c, { className: "h-8 w-8 text-green-600 dark:text-green-400 mx-auto mb-3" }),
376
+ /* @__PURE__ */ v(c, { className: "h-8 w-8 text-status-success-text mx-auto mb-3" }),
371
377
  /* @__PURE__ */ v("h4", {
372
378
  className: "text-lg font-semibold text-text-primary mb-2",
373
379
  children: "Average Order Value"
374
380
  }),
375
381
  /* @__PURE__ */ v("p", {
376
- className: "text-2xl font-bold text-green-600 dark:text-green-400",
377
- children: D(T.averageOrderValue)
382
+ className: "text-2xl font-bold text-status-success-text",
383
+ children: k(D.averageOrderValue)
378
384
  }),
379
385
  /* @__PURE__ */ v("p", {
380
386
  className: "text-sm text-text-secondary mt-1",
@@ -383,16 +389,16 @@ function b() {
383
389
  ]
384
390
  }),
385
391
  /* @__PURE__ */ y("div", {
386
- className: "rounded-lg border border-border-subtle bg-bg-surface p-6 text-center",
392
+ className: "rounded-lg border border-border-seam bg-bg-surface p-6 text-center",
387
393
  children: [
388
- /* @__PURE__ */ v(d, { className: "h-8 w-8 text-blue-600 dark:text-blue-400 mx-auto mb-3" }),
394
+ /* @__PURE__ */ v(d, { className: "h-8 w-8 text-status-info-text mx-auto mb-3" }),
389
395
  /* @__PURE__ */ v("h4", {
390
396
  className: "text-lg font-semibold text-text-primary mb-2",
391
397
  children: "Total Payouts"
392
398
  }),
393
399
  /* @__PURE__ */ v("p", {
394
- className: "text-2xl font-bold text-blue-600 dark:text-blue-400",
395
- children: D(T.payouts)
400
+ className: "text-2xl font-bold text-status-info-text",
401
+ children: k(D.payouts)
396
402
  }),
397
403
  /* @__PURE__ */ v("p", {
398
404
  className: "text-sm text-text-secondary mt-1",
@@ -416,6 +422,6 @@ function b() {
416
422
  });
417
423
  }
418
424
  //#endregion
419
- export { b as AdminFinancialPage };
425
+ export { S as AdminFinancialPage };
420
426
 
421
427
  //# sourceMappingURL=AdminFinancialPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminFinancialPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/admin/AdminFinancialPage.tsx"],"sourcesContent":["/**\n * Admin Financial Page\n * @module subscriberbot/pages/admin\n *\n * Full-featured financial reports with date range filter, export button,\n * 4 MetricsGrid cards, top performing carts with medals, revenue by\n * category with progress bars, monthly trends table, 3 additional\n * cards, loading state, and back navigation.\n */\n\nimport { useState, useEffect } from 'react';\nimport {\n IndianRupee,\n TrendingUp,\n TrendingDown,\n Download,\n Calendar,\n BarChart3,\n ShoppingCart,\n ArrowLeft,\n Loader2,\n Award,\n Star,\n ShoppingBag,\n PieChart,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { MetricsCard } from '../../components/MetricsCard';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency } from '../../utils/formatters';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\ninterface FinancialMetrics {\n totalRevenue: number;\n monthlyRevenue: number;\n revenueGrowth: number;\n totalOrders: number;\n averageOrderValue: number;\n commission: number;\n payouts: number;\n pendingPayouts: number;\n topPerformingCarts: Array<{ id: string; name: string; revenue: number; orders: number }>;\n revenueByCategory: Array<{ category: string; amount: number; percentage: number }>;\n monthlyTrends: Array<{ month: string; revenue: number; orders: number; commission: number }>;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport function AdminFinancialPage() {\n const { navigateTo } = useSubscriberBot();\n const [loading, setLoading] = useState(true);\n const [dateRange, setDateRange] = useState('30d');\n const [metrics, setMetrics] = useState<FinancialMetrics | null>(null);\n\n useEffect(() => {\n setLoading(true);\n const timer = setTimeout(() => {\n setMetrics({\n totalRevenue: 2850000,\n monthlyRevenue: 425000,\n revenueGrowth: 12.5,\n totalOrders: 15420,\n averageOrderValue: 185,\n commission: 142500,\n payouts: 280000,\n pendingPayouts: 45000,\n topPerformingCarts: [\n { id: '1', name: 'South Indian Express', revenue: 125000, orders: 850 },\n { id: '2', name: 'Pizza Corner', revenue: 98000, orders: 620 },\n { id: '3', name: 'Biryani House', revenue: 87000, orders: 580 },\n { id: '4', name: 'Healthy Bites', revenue: 76000, orders: 490 },\n { id: '5', name: 'Street Food Junction', revenue: 65000, orders: 420 },\n ],\n revenueByCategory: [\n { category: 'South Indian', amount: 750000, percentage: 26.3 },\n { category: 'North Indian', amount: 620000, percentage: 21.8 },\n { category: 'Chinese', amount: 485000, percentage: 17.0 },\n { category: 'Fast Food', amount: 425000, percentage: 14.9 },\n { category: 'Beverages', amount: 320000, percentage: 11.2 },\n { category: 'Desserts', amount: 250000, percentage: 8.8 },\n ],\n monthlyTrends: [\n { month: 'Jan', revenue: 380000, orders: 1200, commission: 19000 },\n { month: 'Feb', revenue: 420000, orders: 1350, commission: 21000 },\n { month: 'Mar', revenue: 395000, orders: 1280, commission: 19750 },\n { month: 'Apr', revenue: 440000, orders: 1420, commission: 22000 },\n { month: 'May', revenue: 465000, orders: 1580, commission: 23250 },\n { month: 'Jun', revenue: 425000, orders: 1400, commission: 21250 },\n ],\n });\n setLoading(false);\n }, 1000);\n return () => clearTimeout(timer);\n }, [dateRange]);\n\n const fmtCur = (amount: number) => formatCurrency(amount, { minimumFractionDigits: 0 });\n\n const handleExportReport = () => {\n alert('Financial report export initiated');\n };\n\n const medalIcon = (index: number) => {\n if (index === 0) return <Award className=\"h-5 w-5 text-yellow-500\" />;\n if (index === 1) return <Award className=\"h-5 w-5 text-gray-400\" />;\n if (index === 2) return <Award className=\"h-5 w-5 text-amber-700\" />;\n return (\n <span className=\"flex h-5 w-5 items-center justify-center rounded-full bg-bg-sunken text-xs font-bold text-text-secondary\">\n {index + 1}\n </span>\n );\n };\n\n if (loading) {\n return (\n <PageLayout title=\"Financial Reports\" description=\"Loading financial data...\">\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 className=\"h-10 w-10 animate-spin text-text-secondary mb-4\" />\n <p className=\"text-text-secondary\">Loading financial data...</p>\n </div>\n </PageLayout>\n );\n }\n\n if (!metrics) {\n return (\n <PageLayout title=\"Financial Reports\" description=\"Unable to load financial data\">\n <div className=\"flex flex-col items-center justify-center py-20\">\n <p className=\"text-text-secondary\">Unable to load financial data</p>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"Financial Reports\"\n description=\"Revenue, commissions, payouts, and financial trends\"\n actions={\n <div className=\"flex flex-col sm:flex-row items-stretch sm:items-center gap-3\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin')}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <ArrowLeft className=\"h-4 w-4\" /> Back\n </button>\n <select\n value={dateRange}\n onChange={(e) => setDateRange(e.target.value)}\n className=\"rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"7d\">Last 7 days</option>\n <option value=\"30d\">Last 30 days</option>\n <option value=\"90d\">Last 3 months</option>\n <option value=\"1y\">Last year</option>\n </select>\n <button\n type=\"button\"\n onClick={handleExportReport}\n className=\"flex items-center gap-1.5 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 <Download className=\"h-4 w-4\" /> Export Report\n </button>\n </div>\n }\n >\n {/* 4 Key Metrics */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8\">\n <MetricsCard\n icon={<IndianRupee className=\"h-5 w-5\" />}\n value={fmtCur(metrics.totalRevenue)}\n label=\"Total Revenue\"\n trend=\"up\"\n trendValue={`+${metrics.revenueGrowth}% vs last period`}\n />\n <MetricsCard\n icon={<TrendingUp className=\"h-5 w-5\" />}\n value={fmtCur(metrics.monthlyRevenue)}\n label=\"Monthly Revenue\"\n trendValue=\"Current month\"\n />\n <MetricsCard\n icon={<PieChart className=\"h-5 w-5\" />}\n value={fmtCur(metrics.commission)}\n label=\"Commission Earned\"\n trendValue=\"Platform commission\"\n />\n <MetricsCard\n icon={<TrendingDown className=\"h-5 w-5\" />}\n value={fmtCur(metrics.pendingPayouts)}\n label=\"Pending Payouts\"\n trendValue=\"Amount pending\"\n />\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8\">\n {/* Top Performing Carts */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-4\">\n <ShoppingCart className=\"h-5 w-5 text-text-secondary\" />\n <h3 className=\"text-lg font-semibold text-text-primary\">Top Performing Carts</h3>\n </div>\n <div className=\"space-y-3\">\n {metrics.topPerformingCarts.map((cart, index) => (\n <div\n key={cart.id}\n className=\"flex items-center justify-between rounded-lg bg-bg-sunken/50 p-3\"\n >\n <div className=\"flex items-center gap-3\">\n {medalIcon(index)}\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{cart.name}</p>\n <p className=\"text-xs text-text-secondary\">{cart.orders} orders</p>\n </div>\n </div>\n <p className=\"text-sm font-semibold text-text-primary\">{fmtCur(cart.revenue)}</p>\n </div>\n ))}\n </div>\n </div>\n\n {/* Revenue by Category */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-4\">\n <BarChart3 className=\"h-5 w-5 text-text-secondary\" />\n <h3 className=\"text-lg font-semibold text-text-primary\">Revenue by Category</h3>\n </div>\n <div className=\"space-y-3\">\n {metrics.revenueByCategory.map((category) => (\n <div key={category.category}>\n <div className=\"flex items-center justify-between mb-1\">\n <span className=\"text-sm font-medium text-text-primary\">{category.category}</span>\n <span className=\"text-sm text-text-secondary\">{category.percentage}%</span>\n </div>\n <div className=\"w-full bg-bg-sunken rounded-full h-2\">\n <div\n className=\"bg-action-primary-bg h-2 rounded-full transition-all duration-300\"\n style={{ width: `${category.percentage}%` }}\n />\n </div>\n <div className=\"text-right mt-1\">\n <span className=\"text-sm font-semibold text-text-primary\">\n {fmtCur(category.amount)}\n </span>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Monthly Trends Table */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6 mb-8\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Calendar className=\"h-5 w-5 text-text-secondary\" />\n <h3 className=\"text-lg font-semibold text-text-primary\">Monthly Trends</h3>\n </div>\n <div className=\"overflow-x-auto\">\n <table className=\"w-full\">\n <thead>\n <tr className=\"border-b border-border-subtle bg-bg-sunken/50\">\n <th className=\"px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider\">\n Month\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider\">\n Revenue\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider\">\n Orders\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider\">\n Commission\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border\">\n {metrics.monthlyTrends.map((trend) => (\n <tr key={trend.month} className=\"hover:bg-accent/50 transition-colors\">\n <td className=\"px-4 py-3 text-sm font-medium text-text-primary\">{trend.month}</td>\n <td className=\"px-4 py-3 text-sm text-right text-text-primary\">\n {fmtCur(trend.revenue)}\n </td>\n <td className=\"px-4 py-3 text-sm text-right text-text-primary\">\n {trend.orders.toLocaleString('en-IN')}\n </td>\n <td className=\"px-4 py-3 text-sm text-right text-text-primary\">\n {fmtCur(trend.commission)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n\n {/* 3 Additional Cards */}\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6 text-center\">\n <ShoppingBag className=\"h-8 w-8 text-primary mx-auto mb-3\" />\n <h4 className=\"text-lg font-semibold text-text-primary mb-2\">Total Orders</h4>\n <p className=\"text-2xl font-bold text-primary\">\n {metrics.totalOrders.toLocaleString('en-IN')}\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">All time orders</p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6 text-center\">\n <BarChart3 className=\"h-8 w-8 text-green-600 dark:text-green-400 mx-auto mb-3\" />\n <h4 className=\"text-lg font-semibold text-text-primary mb-2\">Average Order Value</h4>\n <p className=\"text-2xl font-bold text-green-600 dark:text-green-400\">\n {fmtCur(metrics.averageOrderValue)}\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">Per order average</p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6 text-center\">\n <IndianRupee className=\"h-8 w-8 text-blue-600 dark:text-blue-400 mx-auto mb-3\" />\n <h4 className=\"text-lg font-semibold text-text-primary mb-2\">Total Payouts</h4>\n <p className=\"text-2xl font-bold text-blue-600 dark:text-blue-400\">\n {fmtCur(metrics.payouts)}\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">Paid to cart owners</p>\n </div>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;AAsDA,SAAgB,IAAqB;CACnC,IAAM,EAAE,kBAAe,GAAkB,EACnC,CAAC,GAAS,KAAc,EAAS,GAAK,EACtC,CAAC,GAAW,KAAgB,EAAS,MAAM,EAC3C,CAAC,GAAS,KAAc,EAAkC,KAAK;AAErE,SAAgB;AACd,IAAW,GAAK;EAChB,IAAM,IAAQ,iBAAiB;AAkC7B,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AAD;QAAG,WAAU;kBACV,EAAO,EAAQ,QAAQ;QACtB,CAAA;OACJ,kBAAC,KAAD;QAAG,WAAU;kBAAmC;QAAuB,CAAA;OACnE;;KACF;;GACK;MArMX,kBAAC,GAAD;EAAY,OAAM;EAAoB,aAAY;YAChD,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,KAAD;IAAG,WAAU;cAAsB;IAAiC,CAAA;GAChE,CAAA;EACK,CAAA"}
1
+ {"version":3,"file":"AdminFinancialPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/admin/AdminFinancialPage.tsx"],"sourcesContent":["/**\n * Admin Financial Page\n * @module subscriberbot/pages/admin\n *\n * Full-featured financial reports with date range filter, export button,\n * 4 MetricsGrid cards, top performing carts with medals, revenue by\n * category with progress bars, monthly trends table, 3 additional\n * cards, loading state, and back navigation.\n */\n\nimport { useState, useEffect } from 'react';\nimport {\n IndianRupee,\n TrendingUp,\n TrendingDown,\n Download,\n Calendar,\n BarChart3,\n ShoppingCart,\n ArrowLeft,\n Loader2,\n Award,\n Star,\n ShoppingBag,\n PieChart,\n} from 'lucide-react';\nimport { PagePurpose, EmphasisPanel } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { MetricsCard } from '../../components/MetricsCard';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency } from '../../utils/formatters';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\ninterface FinancialMetrics {\n totalRevenue: number;\n monthlyRevenue: number;\n revenueGrowth: number;\n totalOrders: number;\n averageOrderValue: number;\n commission: number;\n payouts: number;\n pendingPayouts: number;\n topPerformingCarts: Array<{ id: string; name: string; revenue: number; orders: number }>;\n revenueByCategory: Array<{ category: string; amount: number; percentage: number }>;\n monthlyTrends: Array<{ month: string; revenue: number; orders: number; commission: number }>;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport function AdminFinancialPage() {\n const { navigateTo } = useSubscriberBot();\n const [loading, setLoading] = useState(true);\n const [dateRange, setDateRange] = useState('30d');\n const [metrics, setMetrics] = useState<FinancialMetrics | null>(null);\n\n useEffect(() => {\n setLoading(true);\n const timer = setTimeout(() => {\n setMetrics({\n totalRevenue: 2850000,\n monthlyRevenue: 425000,\n revenueGrowth: 12.5,\n totalOrders: 15420,\n averageOrderValue: 185,\n commission: 142500,\n payouts: 280000,\n pendingPayouts: 45000,\n topPerformingCarts: [\n { id: '1', name: 'South Indian Express', revenue: 125000, orders: 850 },\n { id: '2', name: 'Pizza Corner', revenue: 98000, orders: 620 },\n { id: '3', name: 'Biryani House', revenue: 87000, orders: 580 },\n { id: '4', name: 'Healthy Bites', revenue: 76000, orders: 490 },\n { id: '5', name: 'Street Food Junction', revenue: 65000, orders: 420 },\n ],\n revenueByCategory: [\n { category: 'South Indian', amount: 750000, percentage: 26.3 },\n { category: 'North Indian', amount: 620000, percentage: 21.8 },\n { category: 'Chinese', amount: 485000, percentage: 17.0 },\n { category: 'Fast Food', amount: 425000, percentage: 14.9 },\n { category: 'Beverages', amount: 320000, percentage: 11.2 },\n { category: 'Desserts', amount: 250000, percentage: 8.8 },\n ],\n monthlyTrends: [\n { month: 'Jan', revenue: 380000, orders: 1200, commission: 19000 },\n { month: 'Feb', revenue: 420000, orders: 1350, commission: 21000 },\n { month: 'Mar', revenue: 395000, orders: 1280, commission: 19750 },\n { month: 'Apr', revenue: 440000, orders: 1420, commission: 22000 },\n { month: 'May', revenue: 465000, orders: 1580, commission: 23250 },\n { month: 'Jun', revenue: 425000, orders: 1400, commission: 21250 },\n ],\n });\n setLoading(false);\n }, 1000);\n return () => clearTimeout(timer);\n }, [dateRange]);\n\n const fmtCur = (amount: number) => formatCurrency(amount, { minimumFractionDigits: 0 });\n\n const handleExportReport = () => {\n alert('Financial report export initiated');\n };\n\n const medalIcon = (index: number) => {\n if (index === 0) return <Award className=\"h-5 w-5 text-status-warning-text\" />;\n if (index === 1) return <Award className=\"h-5 w-5 text-text-secondary\" />;\n if (index === 2) return <Award className=\"h-5 w-5 text-status-warning-text\" />;\n return (\n <span className=\"flex h-5 w-5 items-center justify-center rounded-full bg-bg-sunken text-xs font-bold text-text-secondary\">\n {index + 1}\n </span>\n );\n };\n\n if (loading) {\n return (\n <PageLayout title=\"Financial Reports\" description=\"Loading financial data...\">\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 className=\"h-10 w-10 animate-spin text-text-secondary mb-4\" />\n <p className=\"text-text-secondary\">Loading financial data...</p>\n </div>\n </PageLayout>\n );\n }\n\n if (!metrics) {\n return (\n <PageLayout title=\"Financial Reports\" description=\"Unable to load financial data\">\n <div className=\"flex flex-col items-center justify-center py-20\">\n <p className=\"text-text-secondary\">Unable to load financial data</p>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"Financial Reports\"\n description=\"Revenue, commissions, payouts, and financial trends\"\n actions={\n <div className=\"flex flex-col sm:flex-row items-stretch sm:items-center gap-3\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/admin')}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <ArrowLeft className=\"h-4 w-4\" /> Back\n </button>\n <select\n value={dateRange}\n onChange={(e) => setDateRange(e.target.value)}\n className=\"rounded-lg border border-border-seam bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"7d\">Last 7 days</option>\n <option value=\"30d\">Last 30 days</option>\n <option value=\"90d\">Last 3 months</option>\n <option value=\"1y\">Last year</option>\n </select>\n <button\n type=\"button\"\n onClick={handleExportReport}\n className=\"flex items-center gap-1.5 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 <Download className=\"h-4 w-4\" /> Export Report\n </button>\n </div>\n }\n >\n <PagePurpose icon={<IndianRupee className=\"h-4 w-4\" />} className=\"mb-6\">\n The money view of the marketplace. Track total and monthly revenue, the commission\n the platform earns, and payouts still owed to cart owners. Change the date range to\n compare periods, see which carts drive the most revenue, and export a report when\n you need to share the numbers or reconcile payouts.\n </PagePurpose>\n\n {/* 4 Key Metrics — the ONE emphasis zone */}\n <EmphasisPanel className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8\">\n <MetricsCard\n icon={<IndianRupee className=\"h-5 w-5\" />}\n value={fmtCur(metrics.totalRevenue)}\n label=\"Total Revenue\"\n trend=\"up\"\n trendValue={`+${metrics.revenueGrowth}% vs last period`}\n />\n <MetricsCard\n icon={<TrendingUp className=\"h-5 w-5\" />}\n value={fmtCur(metrics.monthlyRevenue)}\n label=\"Monthly Revenue\"\n trendValue=\"Current month\"\n />\n <MetricsCard\n icon={<PieChart className=\"h-5 w-5\" />}\n value={fmtCur(metrics.commission)}\n label=\"Commission Earned\"\n trendValue=\"Platform commission\"\n />\n <MetricsCard\n icon={<TrendingDown className=\"h-5 w-5\" />}\n value={fmtCur(metrics.pendingPayouts)}\n label=\"Pending Payouts\"\n trendValue=\"Amount pending\"\n />\n </EmphasisPanel>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8\">\n {/* Top Performing Carts */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-4\">\n <ShoppingCart className=\"h-5 w-5 text-text-secondary\" />\n <h3 className=\"text-lg font-semibold text-text-primary\">Top Performing Carts</h3>\n </div>\n <div className=\"space-y-3\">\n {metrics.topPerformingCarts.map((cart, index) => (\n <div\n key={cart.id}\n className=\"flex items-center justify-between rounded-lg bg-bg-sunken/50 p-3\"\n >\n <div className=\"flex items-center gap-3\">\n {medalIcon(index)}\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{cart.name}</p>\n <p className=\"text-xs text-text-secondary\">{cart.orders} orders</p>\n </div>\n </div>\n <p className=\"text-sm font-semibold text-text-primary\">{fmtCur(cart.revenue)}</p>\n </div>\n ))}\n </div>\n </div>\n\n {/* Revenue by Category */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-4\">\n <BarChart3 className=\"h-5 w-5 text-text-secondary\" />\n <h3 className=\"text-lg font-semibold text-text-primary\">Revenue by Category</h3>\n </div>\n <div className=\"space-y-3\">\n {metrics.revenueByCategory.map((category) => (\n <div key={category.category}>\n <div className=\"flex items-center justify-between mb-1\">\n <span className=\"text-sm font-medium text-text-primary\">{category.category}</span>\n <span className=\"text-sm text-text-secondary\">{category.percentage}%</span>\n </div>\n <div className=\"w-full bg-bg-sunken rounded-full h-2\">\n <div\n className=\"bg-action-primary-bg h-2 rounded-full transition-all duration-300\"\n style={{ width: `${category.percentage}%` }}\n />\n </div>\n <div className=\"text-right mt-1\">\n <span className=\"text-sm font-semibold text-text-primary\">\n {fmtCur(category.amount)}\n </span>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Monthly Trends Table */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6 mb-8\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Calendar className=\"h-5 w-5 text-text-secondary\" />\n <h3 className=\"text-lg font-semibold text-text-primary\">Monthly Trends</h3>\n </div>\n <div className=\"overflow-x-auto\">\n <table className=\"w-full\">\n <thead>\n <tr className=\"border-b border-border-seam bg-bg-sunken/50\">\n <th className=\"px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider\">\n Month\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider\">\n Revenue\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider\">\n Orders\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider\">\n Commission\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border\">\n {metrics.monthlyTrends.map((trend) => (\n <tr key={trend.month} className=\"hover:bg-accent/50 transition-colors\">\n <td className=\"px-4 py-3 text-sm font-medium text-text-primary\">{trend.month}</td>\n <td className=\"px-4 py-3 text-sm text-right text-text-primary\">\n {fmtCur(trend.revenue)}\n </td>\n <td className=\"px-4 py-3 text-sm text-right text-text-primary\">\n {trend.orders.toLocaleString('en-IN')}\n </td>\n <td className=\"px-4 py-3 text-sm text-right text-text-primary\">\n {fmtCur(trend.commission)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n\n {/* 3 Additional Cards */}\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6 text-center\">\n <ShoppingBag className=\"h-8 w-8 text-primary mx-auto mb-3\" />\n <h4 className=\"text-lg font-semibold text-text-primary mb-2\">Total Orders</h4>\n <p className=\"text-2xl font-bold text-primary\">\n {metrics.totalOrders.toLocaleString('en-IN')}\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">All time orders</p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6 text-center\">\n <BarChart3 className=\"h-8 w-8 text-status-success-text mx-auto mb-3\" />\n <h4 className=\"text-lg font-semibold text-text-primary mb-2\">Average Order Value</h4>\n <p className=\"text-2xl font-bold text-status-success-text\">\n {fmtCur(metrics.averageOrderValue)}\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">Per order average</p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6 text-center\">\n <IndianRupee className=\"h-8 w-8 text-status-info-text mx-auto mb-3\" />\n <h4 className=\"text-lg font-semibold text-text-primary mb-2\">Total Payouts</h4>\n <p className=\"text-2xl font-bold text-status-info-text\">{fmtCur(metrics.payouts)}</p>\n <p className=\"text-sm text-text-secondary mt-1\">Paid to cart owners</p>\n </div>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;AAuDA,SAAgB,IA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