@burdenoff/microfe-subscriberbot 2026.624.1 → 2026.625.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/subscriberbot/components/EmptyState.js +17 -10
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/InvestmentCard.js +23 -22
- package/dist/subscriberbot/components/InvestmentCard.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.js +15 -12
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +27 -15
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/RatingDisplay.js +3 -3
- package/dist/subscriberbot/components/RatingDisplay.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +25 -13
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/pages/HomePage.js +67 -63
- package/dist/subscriberbot/pages/HomePage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js +42 -42
- package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminDashboard.js +42 -41
- package/dist/subscriberbot/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminFinancialPage.js +14 -14
- package/dist/subscriberbot/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminOrdersPage.js +24 -24
- package/dist/subscriberbot/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminProfilePage.js +11 -11
- package/dist/subscriberbot/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminSettingsPage.js +14 -14
- package/dist/subscriberbot/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/CartManagementPage.js +41 -41
- package/dist/subscriberbot/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/UserManagementPage.js +47 -47
- package/dist/subscriberbot/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js +44 -44
- package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js +17 -17
- package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js +94 -89
- package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js +58 -58
- package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js +51 -51
- package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js +54 -54
- package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js +54 -53
- package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js +51 -51
- package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/HelpSupportPage.js +65 -65
- package/dist/subscriberbot/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/NotificationCenterPage.js +46 -45
- package/dist/subscriberbot/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/SettingsPage.js +46 -46
- package/dist/subscriberbot/pages/common/SettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/BookingDetailsPage.js +24 -23
- package/dist/subscriberbot/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CartDetailPage.js +31 -30
- package/dist/subscriberbot/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js +25 -23
- package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CheckoutPage.js +26 -26
- package/dist/subscriberbot/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CustomerDashboard.js +39 -38
- package/dist/subscriberbot/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CustomerProfilePage.js +36 -36
- package/dist/subscriberbot/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js +37 -36
- package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/FavoritesPage.js +16 -15
- package/dist/subscriberbot/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/OrderHistoryPage.js +19 -17
- package/dist/subscriberbot/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/OrderTrackingPage.js +21 -20
- package/dist/subscriberbot/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js +22 -21
- package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/ReviewsPage.js +29 -28
- package/dist/subscriberbot/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/SavedAddressesPage.js +26 -25
- package/dist/subscriberbot/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js +46 -46
- package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js +34 -32
- package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js +38 -38
- package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorDashboard.js +26 -25
- package/dist/subscriberbot/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js +12 -11
- package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js +25 -25
- package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorProfilePage.js +58 -58
- package/dist/subscriberbot/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/TaskDetailsPage.js +26 -25
- package/dist/subscriberbot/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerDashboard.js +48 -47
- package/dist/subscriberbot/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js +41 -40
- package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerProfilePage.js +44 -44
- package/dist/subscriberbot/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js +32 -30
- package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminAnalyticsPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/admin/AdminAnalyticsPage.tsx"],"sourcesContent":["/**\n * Admin Analytics Page\n * @module subscriberbot/pages/admin\n *\n * Full-featured analytics with 4 tabs (Overview/Revenue/Users/Performance),\n * time period filter, order status distribution, top performing carts,\n * revenue by city, user role distribution, growth insights, financial\n * performance, and today's performance metrics.\n */\n\nimport { useState, useEffect } from 'react';\nimport {\n Users,\n TrendingUp,\n TrendingDown,\n ShoppingBag,\n IndianRupee,\n BarChart3,\n Zap,\n Loader2,\n Star,\n Award,\n MapPin,\n Clock,\n Timer,\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 AnalyticsData {\n revenue: { total: number; growth: number; thisMonth: number; lastMonth: number };\n orders: {\n total: number;\n growth: number;\n pending: number;\n completed: number;\n cancelled: number;\n averageOrderValue: number;\n ordersToday: number;\n };\n users: {\n total: number;\n growth: number;\n active: number;\n newThisMonth: number;\n customers: number;\n cartOwners: number;\n workers: number;\n investors: number;\n };\n carts: {\n total: number;\n active: number;\n pending: number;\n topPerforming: Array<{\n id: string;\n name: string;\n revenue: number;\n orders: number;\n rating: number;\n }>;\n };\n performance: {\n averageDeliveryTime: number;\n customerSatisfaction: number;\n platformFee: number;\n operatingCosts: number;\n netProfit: number;\n };\n geography: { topCities: Array<{ city: string; orders: number; revenue: number }> };\n}\n\ntype TimePeriod = 'today' | 'week' | 'month' | 'quarter' | 'year';\ntype TabKey = 'overview' | 'revenue' | 'users' | 'performance';\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport function AdminAnalyticsPage() {\n const { currentUser } = useSubscriberBot();\n\n const [analytics, setAnalytics] = useState<AnalyticsData | null>(null);\n const [loading, setLoading] = useState(true);\n const [selectedPeriod, setSelectedPeriod] = useState<TimePeriod>('month');\n const [activeTab, setActiveTab] = useState<TabKey>('overview');\n\n useEffect(() => {\n setLoading(true);\n const timer = setTimeout(() => {\n setAnalytics({\n revenue: { total: 12500000, growth: 15.2, thisMonth: 2100000, lastMonth: 1850000 },\n orders: {\n total: 45230,\n growth: 8.7,\n pending: 156,\n completed: 44890,\n cancelled: 184,\n averageOrderValue: 276,\n ordersToday: 89,\n },\n users: {\n total: 12450,\n growth: 12.3,\n active: 9870,\n newThisMonth: 456,\n customers: 9850,\n cartOwners: 1240,\n workers: 890,\n investors: 470,\n },\n carts: {\n total: 1240,\n active: 1156,\n pending: 84,\n topPerforming: [\n { id: 'c1', name: 'South Indian Express', revenue: 285000, orders: 1250, rating: 4.8 },\n { id: 'c2', name: 'Mumbai Street Chaat', revenue: 245000, orders: 980, rating: 4.7 },\n { id: 'c3', name: 'Delhi Paratha Corner', revenue: 198000, orders: 876, rating: 4.6 },\n { id: 'c4', name: 'Bangalore Dosa House', revenue: 176000, orders: 743, rating: 4.9 },\n { id: 'c5', name: 'Kolkata Fish Fry', revenue: 154000, orders: 632, rating: 4.5 },\n ],\n },\n performance: {\n averageDeliveryTime: 28,\n customerSatisfaction: 4.6,\n platformFee: 8.5,\n operatingCosts: 2100000,\n netProfit: 850000,\n },\n geography: {\n topCities: [\n { city: 'Bangalore', orders: 15670, revenue: 4250000 },\n { city: 'Mumbai', orders: 12340, revenue: 3890000 },\n { city: 'Delhi', orders: 9870, revenue: 2980000 },\n { city: 'Hyderabad', orders: 7650, revenue: 2140000 },\n { city: 'Chennai', orders: 6540, revenue: 1890000 },\n ],\n },\n });\n setLoading(false);\n }, 800);\n return () => clearTimeout(timer);\n }, [selectedPeriod]);\n\n const fmtCur = (amount: number) => {\n if (amount >= 10000000) return `₹${(amount / 10000000).toFixed(1)}Cr`;\n if (amount >= 100000) return `₹${(amount / 100000).toFixed(1)}L`;\n return formatCurrency(amount, { minimumFractionDigits: 0 });\n };\n\n const fmtGrowth = (growth: number) => {\n const isPositive = growth >= 0;\n return (\n <span\n className={cn(\n 'flex items-center gap-1 text-sm font-medium',\n isPositive ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400'\n )}\n >\n {isPositive ? (\n <TrendingUp className=\"h-3.5 w-3.5\" />\n ) : (\n <TrendingDown className=\"h-3.5 w-3.5\" />\n )}\n {Math.abs(growth).toFixed(1)}%\n </span>\n );\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 <BarChart3 className=\"h-5 w-5 text-text-secondary\" />;\n };\n\n if (loading || !analytics) {\n return (\n <PageLayout title=\"Platform Analytics\" description=\"Loading analytics...\">\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 analytics...</p>\n </div>\n </PageLayout>\n );\n }\n\n const tabs: Array<{ key: TabKey; label: string; icon: typeof BarChart3 }> = [\n { key: 'overview', label: 'Overview', icon: BarChart3 },\n { key: 'revenue', label: 'Revenue', icon: IndianRupee },\n { key: 'users', label: 'Users', icon: Users },\n { key: 'performance', label: 'Performance', icon: Zap },\n ];\n\n return (\n <PageLayout title=\"Platform Analytics\" description=\"Comprehensive platform metrics and trends\">\n {/* Time Period Filter */}\n <div className=\"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6\">\n <select\n value={selectedPeriod}\n onChange={(e) => setSelectedPeriod(e.target.value as TimePeriod)}\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)] w-fit\"\n >\n <option value=\"today\">Today</option>\n <option value=\"week\">This Week</option>\n <option value=\"month\">This Month</option>\n <option value=\"quarter\">This Quarter</option>\n <option value=\"year\">This Year</option>\n </select>\n <span className=\"text-sm text-text-secondary\">\n Last updated: {new Date().toLocaleString('en-IN')}\n </span>\n </div>\n\n {/* 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(analytics.revenue.total)}\n label=\"Total Revenue\"\n trend=\"up\"\n trendValue={`+${analytics.revenue.growth}%`}\n />\n <MetricsCard\n icon={<ShoppingBag className=\"h-5 w-5\" />}\n value={analytics.orders.total.toLocaleString('en-IN')}\n label=\"Total Orders\"\n trend=\"up\"\n trendValue={`+${analytics.orders.growth}%`}\n />\n <MetricsCard\n icon={<Users className=\"h-5 w-5\" />}\n value={analytics.users.active.toLocaleString('en-IN')}\n label=\"Active Users\"\n trend=\"up\"\n trendValue={`+${analytics.users.growth}%`}\n />\n <MetricsCard\n icon={<BarChart3 className=\"h-5 w-5\" />}\n value={analytics.carts.active.toLocaleString('en-IN')}\n label=\"Active Carts\"\n trendValue={`${analytics.carts.pending} pending`}\n />\n </div>\n\n {/* Tabs */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface mb-8\">\n <div className=\"border-b border-border-subtle\">\n <nav className=\"flex -mb-px overflow-x-auto\">\n {tabs.map((tab) => {\n const TabIcon = tab.icon;\n return (\n <button\n key={tab.key}\n type=\"button\"\n onClick={() => setActiveTab(tab.key)}\n className={cn(\n 'flex items-center gap-2 py-3 px-4 sm:px-6 text-sm font-medium whitespace-nowrap border-b-2 transition-colors',\n activeTab === tab.key\n ? 'border-primary text-primary'\n : 'border-transparent text-text-secondary hover:text-text-primary'\n )}\n >\n <TabIcon className=\"h-4 w-4\" />\n <span className=\"hidden sm:inline\">{tab.label}</span>\n </button>\n );\n })}\n </nav>\n </div>\n\n <div className=\"p-4 sm:p-6\">\n {/* Overview Tab */}\n {activeTab === 'overview' && (\n <div className=\"space-y-8\">\n <div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">\n Order Status Distribution\n </h3>\n <div className=\"grid grid-cols-1 sm:grid-cols-3 gap-4\">\n <div className=\"rounded-lg border border-green-500/30 bg-green-500/10 p-4\">\n <p className=\"text-sm text-green-600 dark:text-green-400\">Completed Orders</p>\n <p className=\"text-2xl font-bold text-green-700 dark:text-green-300\">\n {analytics.orders.completed.toLocaleString('en-IN')}\n </p>\n <p className=\"text-sm text-green-600/80 dark:text-green-400/80\">\n {((analytics.orders.completed / analytics.orders.total) * 100).toFixed(1)}% of\n total\n </p>\n </div>\n <div className=\"rounded-lg border border-yellow-500/30 bg-yellow-500/10 p-4\">\n <p className=\"text-sm text-yellow-600 dark:text-yellow-400\">Pending Orders</p>\n <p className=\"text-2xl font-bold text-yellow-700 dark:text-yellow-300\">\n {analytics.orders.pending.toLocaleString('en-IN')}\n </p>\n <p className=\"text-sm text-yellow-600/80 dark:text-yellow-400/80\">\n {((analytics.orders.pending / analytics.orders.total) * 100).toFixed(1)}% of\n total\n </p>\n </div>\n <div className=\"rounded-lg border border-red-500/30 bg-red-500/10 p-4\">\n <p className=\"text-sm text-red-600 dark:text-red-400\">Cancelled Orders</p>\n <p className=\"text-2xl font-bold text-red-700 dark:text-red-300\">\n {analytics.orders.cancelled.toLocaleString('en-IN')}\n </p>\n <p className=\"text-sm text-red-600/80 dark:text-red-400/80\">\n {((analytics.orders.cancelled / analytics.orders.total) * 100).toFixed(1)}% of\n total\n </p>\n </div>\n </div>\n </div>\n\n <div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">Top Performing Carts</h3>\n <div className=\"rounded-lg border border-border-subtle overflow-hidden\">\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\">\n Cart Name\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase\">\n Revenue\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase\">\n Orders\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase\">\n Rating\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border\">\n {analytics.carts.topPerforming.map((cart, i) => (\n <tr key={cart.id} className=\"hover:bg-accent/50 transition-colors\">\n <td className=\"px-4 py-3\">\n <div className=\"flex items-center gap-2\">\n {medalIcon(i)}\n <span className=\"text-sm font-medium text-text-primary\">\n {cart.name}\n </span>\n </div>\n </td>\n <td className=\"px-4 py-3 text-sm text-right font-medium text-text-primary\">\n {fmtCur(cart.revenue)}\n </td>\n <td className=\"px-4 py-3 text-sm text-right text-text-primary\">\n {cart.orders.toLocaleString('en-IN')}\n </td>\n <td className=\"px-4 py-3 text-sm text-right text-text-primary\">\n <span className=\"flex items-center justify-end gap-1\">\n <Star className=\"h-3.5 w-3.5 fill-yellow-400 text-yellow-400\" />\n {cart.rating}\n </span>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n </div>\n )}\n\n {/* Revenue Tab */}\n {activeTab === 'revenue' && (\n <div className=\"space-y-8\">\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-4\">\n <div className=\"rounded-lg border border-blue-500/30 bg-blue-500/10 p-6\">\n <h4 className=\"text-sm font-medium text-blue-600 dark:text-blue-400 mb-2\">\n This Month\n </h4>\n <p className=\"text-2xl font-bold text-blue-700 dark:text-blue-300\">\n {fmtCur(analytics.revenue.thisMonth)}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken/30 p-6\">\n <h4 className=\"text-sm font-medium text-text-secondary mb-2\">Last Month</h4>\n <p className=\"text-2xl font-bold text-text-primary\">\n {fmtCur(analytics.revenue.lastMonth)}\n </p>\n </div>\n <div className=\"rounded-lg border border-green-500/30 bg-green-500/10 p-6\">\n <h4 className=\"text-sm font-medium text-green-600 dark:text-green-400 mb-2\">\n Average Order Value\n </h4>\n <p className=\"text-2xl font-bold text-green-700 dark:text-green-300\">\n ₹{analytics.orders.averageOrderValue}\n </p>\n </div>\n </div>\n\n <div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">Revenue by City</h3>\n <div className=\"space-y-3\">\n {analytics.geography.topCities.map((city, i) => (\n <div\n key={city.city}\n className=\"flex items-center justify-between p-4 rounded-lg border border-border-subtle bg-bg-sunken/30\"\n >\n <div className=\"flex items-center gap-3\">\n {medalIcon(i)}\n <div>\n <p className=\"font-medium text-text-primary\">{city.city}</p>\n <p className=\"text-sm text-text-secondary\">\n {city.orders.toLocaleString('en-IN')} orders\n </p>\n </div>\n </div>\n <div className=\"text-right\">\n <p className=\"font-bold text-text-primary\">{fmtCur(city.revenue)}</p>\n <p className=\"text-sm text-text-secondary\">\n {((city.revenue / analytics.revenue.total) * 100).toFixed(1)}%\n </p>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n )}\n\n {/* Users Tab */}\n {activeTab === 'users' && (\n <div className=\"space-y-8\">\n <div className=\"grid grid-cols-1 md:grid-cols-4 gap-4\">\n {[\n { label: 'Customers', value: analytics.users.customers, color: 'blue' },\n { label: 'Cart Owners', value: analytics.users.cartOwners, color: 'green' },\n { label: 'Workers', value: analytics.users.workers, color: 'yellow' },\n { label: 'Investors', value: analytics.users.investors, color: 'purple' },\n ].map((item) => (\n <div\n key={item.label}\n className={cn(\n 'rounded-lg border p-4',\n `border-${item.color}-500/30 bg-${item.color}-500/10`\n )}\n >\n <h4\n className={cn(\n 'text-sm font-medium',\n `text-${item.color}-600 dark:text-${item.color}-400`\n )}\n >\n {item.label}\n </h4>\n <p\n className={cn(\n 'text-2xl font-bold',\n `text-${item.color}-700 dark:text-${item.color}-300`\n )}\n >\n {item.value.toLocaleString('en-IN')}\n </p>\n <p\n className={cn(\n 'text-sm',\n `text-${item.color}-600/80 dark:text-${item.color}-400/80`\n )}\n >\n {((item.value / analytics.users.total) * 100).toFixed(1)}%\n </p>\n </div>\n ))}\n </div>\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken/20 p-6\">\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">User Growth Insights</h3>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">New Users This Month</p>\n <p className=\"text-3xl font-bold text-blue-600 dark:text-blue-400\">\n {analytics.users.newThisMonth}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Active Users Rate</p>\n <p className=\"text-3xl font-bold text-green-600 dark:text-green-400\">\n {((analytics.users.active / analytics.users.total) * 100).toFixed(1)}%\n </p>\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* Performance Tab */}\n {activeTab === 'performance' && (\n <div className=\"space-y-8\">\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\">\n <div className=\"flex items-center gap-2 mb-2\">\n <Timer className=\"h-4 w-4 text-text-secondary\" />\n <h4 className=\"text-sm font-medium text-text-secondary\">Avg Delivery Time</h4>\n </div>\n <p className=\"text-3xl font-bold text-text-primary\">\n {analytics.performance.averageDeliveryTime} min\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">Target: < 30 min</p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-2\">\n <Star className=\"h-4 w-4 text-text-secondary\" />\n <h4 className=\"text-sm font-medium text-text-secondary\">\n Customer Satisfaction\n </h4>\n </div>\n <p className=\"text-3xl font-bold text-text-primary flex items-center gap-1\">\n <Star className=\"h-6 w-6 fill-yellow-400 text-yellow-400\" />\n {analytics.performance.customerSatisfaction}\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">Based on ratings</p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-2\">\n <IndianRupee className=\"h-4 w-4 text-text-secondary\" />\n <h4 className=\"text-sm font-medium text-text-secondary\">Platform Fee</h4>\n </div>\n <p className=\"text-3xl font-bold text-text-primary\">\n {analytics.performance.platformFee}%\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">Per transaction</p>\n </div>\n </div>\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken/20 p-6\">\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">\n Financial Performance\n </h3>\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Operating Costs</p>\n <p className=\"text-2xl font-bold text-red-600 dark:text-red-400\">\n {fmtCur(analytics.performance.operatingCosts)}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Total Revenue</p>\n <p className=\"text-2xl font-bold text-blue-600 dark:text-blue-400\">\n {fmtCur(analytics.revenue.total)}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Net Profit</p>\n <p className=\"text-2xl font-bold text-green-600 dark:text-green-400\">\n {fmtCur(analytics.performance.netProfit)}\n </p>\n </div>\n </div>\n <div className=\"mt-4 rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <p className=\"text-sm text-text-secondary\">Profit Margin</p>\n <p className=\"text-xl font-bold text-text-primary\">\n {((analytics.performance.netProfit / analytics.revenue.total) * 100).toFixed(1)}\n %\n </p>\n </div>\n </div>\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">\n Today's Performance\n </h3>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Orders Today</p>\n <p className=\"text-3xl font-bold text-blue-600 dark:text-blue-400\">\n {analytics.orders.ordersToday}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Estimated Revenue</p>\n <p className=\"text-3xl font-bold text-green-600 dark:text-green-400\">\n {fmtCur(analytics.orders.ordersToday * analytics.orders.averageOrderValue)}\n </p>\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;AAsFA,SAAgB,IAAqB;CACnC,IAAM,EAAE,mBAAgB,GAAkB,EAEpC,CAAC,GAAW,KAAgB,EAA+B,KAAK,EAChE,CAAC,GAAS,KA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,CAAA,EACrE,kBAAC,KAAD;WAAG,WAAU;qBACV,EAAO,EAAU,OAAO,cAAc,EAAU,OAAO,kBAAkB;WACxE,CAAA,CACA,EAAA,CAAA,CACF;YACF;;QACF;;MAEJ;OACF;;GACK"}
|
|
1
|
+
{"version":3,"file":"AdminAnalyticsPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/admin/AdminAnalyticsPage.tsx"],"sourcesContent":["/**\n * Admin Analytics Page\n * @module subscriberbot/pages/admin\n *\n * Full-featured analytics with 4 tabs (Overview/Revenue/Users/Performance),\n * time period filter, order status distribution, top performing carts,\n * revenue by city, user role distribution, growth insights, financial\n * performance, and today's performance metrics.\n */\n\nimport { useState, useEffect } from 'react';\nimport {\n Users,\n TrendingUp,\n TrendingDown,\n ShoppingBag,\n IndianRupee,\n BarChart3,\n Zap,\n Loader2,\n Star,\n Award,\n MapPin,\n Clock,\n Timer,\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 AnalyticsData {\n revenue: { total: number; growth: number; thisMonth: number; lastMonth: number };\n orders: {\n total: number;\n growth: number;\n pending: number;\n completed: number;\n cancelled: number;\n averageOrderValue: number;\n ordersToday: number;\n };\n users: {\n total: number;\n growth: number;\n active: number;\n newThisMonth: number;\n customers: number;\n cartOwners: number;\n workers: number;\n investors: number;\n };\n carts: {\n total: number;\n active: number;\n pending: number;\n topPerforming: Array<{\n id: string;\n name: string;\n revenue: number;\n orders: number;\n rating: number;\n }>;\n };\n performance: {\n averageDeliveryTime: number;\n customerSatisfaction: number;\n platformFee: number;\n operatingCosts: number;\n netProfit: number;\n };\n geography: { topCities: Array<{ city: string; orders: number; revenue: number }> };\n}\n\ntype TimePeriod = 'today' | 'week' | 'month' | 'quarter' | 'year';\ntype TabKey = 'overview' | 'revenue' | 'users' | 'performance';\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport function AdminAnalyticsPage() {\n const { currentUser } = useSubscriberBot();\n\n const [analytics, setAnalytics] = useState<AnalyticsData | null>(null);\n const [loading, setLoading] = useState(true);\n const [selectedPeriod, setSelectedPeriod] = useState<TimePeriod>('month');\n const [activeTab, setActiveTab] = useState<TabKey>('overview');\n\n useEffect(() => {\n setLoading(true);\n const timer = setTimeout(() => {\n setAnalytics({\n revenue: { total: 12500000, growth: 15.2, thisMonth: 2100000, lastMonth: 1850000 },\n orders: {\n total: 45230,\n growth: 8.7,\n pending: 156,\n completed: 44890,\n cancelled: 184,\n averageOrderValue: 276,\n ordersToday: 89,\n },\n users: {\n total: 12450,\n growth: 12.3,\n active: 9870,\n newThisMonth: 456,\n customers: 9850,\n cartOwners: 1240,\n workers: 890,\n investors: 470,\n },\n carts: {\n total: 1240,\n active: 1156,\n pending: 84,\n topPerforming: [\n { id: 'c1', name: 'South Indian Express', revenue: 285000, orders: 1250, rating: 4.8 },\n { id: 'c2', name: 'Mumbai Street Chaat', revenue: 245000, orders: 980, rating: 4.7 },\n { id: 'c3', name: 'Delhi Paratha Corner', revenue: 198000, orders: 876, rating: 4.6 },\n { id: 'c4', name: 'Bangalore Dosa House', revenue: 176000, orders: 743, rating: 4.9 },\n { id: 'c5', name: 'Kolkata Fish Fry', revenue: 154000, orders: 632, rating: 4.5 },\n ],\n },\n performance: {\n averageDeliveryTime: 28,\n customerSatisfaction: 4.6,\n platformFee: 8.5,\n operatingCosts: 2100000,\n netProfit: 850000,\n },\n geography: {\n topCities: [\n { city: 'Bangalore', orders: 15670, revenue: 4250000 },\n { city: 'Mumbai', orders: 12340, revenue: 3890000 },\n { city: 'Delhi', orders: 9870, revenue: 2980000 },\n { city: 'Hyderabad', orders: 7650, revenue: 2140000 },\n { city: 'Chennai', orders: 6540, revenue: 1890000 },\n ],\n },\n });\n setLoading(false);\n }, 800);\n return () => clearTimeout(timer);\n }, [selectedPeriod]);\n\n const fmtCur = (amount: number) => {\n if (amount >= 10000000) return `₹${(amount / 10000000).toFixed(1)}Cr`;\n if (amount >= 100000) return `₹${(amount / 100000).toFixed(1)}L`;\n return formatCurrency(amount, { minimumFractionDigits: 0 });\n };\n\n const fmtGrowth = (growth: number) => {\n const isPositive = growth >= 0;\n return (\n <span\n className={cn(\n 'flex items-center gap-1 text-sm font-medium',\n isPositive ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {isPositive ? (\n <TrendingUp className=\"h-3.5 w-3.5\" />\n ) : (\n <TrendingDown className=\"h-3.5 w-3.5\" />\n )}\n {Math.abs(growth).toFixed(1)}%\n </span>\n );\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 <BarChart3 className=\"h-5 w-5 text-text-secondary\" />;\n };\n\n if (loading || !analytics) {\n return (\n <PageLayout title=\"Platform Analytics\" description=\"Loading analytics...\">\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 analytics...</p>\n </div>\n </PageLayout>\n );\n }\n\n const tabs: Array<{ key: TabKey; label: string; icon: typeof BarChart3 }> = [\n { key: 'overview', label: 'Overview', icon: BarChart3 },\n { key: 'revenue', label: 'Revenue', icon: IndianRupee },\n { key: 'users', label: 'Users', icon: Users },\n { key: 'performance', label: 'Performance', icon: Zap },\n ];\n\n return (\n <PageLayout title=\"Platform Analytics\" description=\"Comprehensive platform metrics and trends\">\n {/* Time Period Filter */}\n <div className=\"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6\">\n <select\n value={selectedPeriod}\n onChange={(e) => setSelectedPeriod(e.target.value as TimePeriod)}\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)] w-fit\"\n >\n <option value=\"today\">Today</option>\n <option value=\"week\">This Week</option>\n <option value=\"month\">This Month</option>\n <option value=\"quarter\">This Quarter</option>\n <option value=\"year\">This Year</option>\n </select>\n <span className=\"text-sm text-text-secondary\">\n Last updated: {new Date().toLocaleString('en-IN')}\n </span>\n </div>\n\n {/* 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(analytics.revenue.total)}\n label=\"Total Revenue\"\n trend=\"up\"\n trendValue={`+${analytics.revenue.growth}%`}\n />\n <MetricsCard\n icon={<ShoppingBag className=\"h-5 w-5\" />}\n value={analytics.orders.total.toLocaleString('en-IN')}\n label=\"Total Orders\"\n trend=\"up\"\n trendValue={`+${analytics.orders.growth}%`}\n />\n <MetricsCard\n icon={<Users className=\"h-5 w-5\" />}\n value={analytics.users.active.toLocaleString('en-IN')}\n label=\"Active Users\"\n trend=\"up\"\n trendValue={`+${analytics.users.growth}%`}\n />\n <MetricsCard\n icon={<BarChart3 className=\"h-5 w-5\" />}\n value={analytics.carts.active.toLocaleString('en-IN')}\n label=\"Active Carts\"\n trendValue={`${analytics.carts.pending} pending`}\n />\n </div>\n\n {/* Tabs */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface mb-8\">\n <div className=\"border-b border-border-seam\">\n <nav className=\"flex -mb-px overflow-x-auto\">\n {tabs.map((tab) => {\n const TabIcon = tab.icon;\n return (\n <button\n key={tab.key}\n type=\"button\"\n onClick={() => setActiveTab(tab.key)}\n className={cn(\n 'flex items-center gap-2 py-3 px-4 sm:px-6 text-sm font-medium whitespace-nowrap border-b-2 transition-colors',\n activeTab === tab.key\n ? 'border-primary text-primary'\n : 'border-transparent text-text-secondary hover:text-text-primary'\n )}\n >\n <TabIcon className=\"h-4 w-4\" />\n <span className=\"hidden sm:inline\">{tab.label}</span>\n </button>\n );\n })}\n </nav>\n </div>\n\n <div className=\"p-4 sm:p-6\">\n {/* Overview Tab */}\n {activeTab === 'overview' && (\n <div className=\"space-y-8\">\n <div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">\n Order Status Distribution\n </h3>\n <div className=\"grid grid-cols-1 sm:grid-cols-3 gap-4\">\n <div className=\"rounded-lg border border-status-success-border/30 bg-status-success-bg/10 p-4\">\n <p className=\"text-sm text-status-success-text\">Completed Orders</p>\n <p className=\"text-2xl font-bold text-status-success-text\">\n {analytics.orders.completed.toLocaleString('en-IN')}\n </p>\n <p className=\"text-sm text-status-success-text/80\">\n {((analytics.orders.completed / analytics.orders.total) * 100).toFixed(1)}% of\n total\n </p>\n </div>\n <div className=\"rounded-lg border border-status-warning-border/30 bg-status-warning-bg/10 p-4\">\n <p className=\"text-sm text-status-warning-text\">Pending Orders</p>\n <p className=\"text-2xl font-bold text-status-warning-text\">\n {analytics.orders.pending.toLocaleString('en-IN')}\n </p>\n <p className=\"text-sm text-status-warning-text/80\">\n {((analytics.orders.pending / analytics.orders.total) * 100).toFixed(1)}% of\n total\n </p>\n </div>\n <div className=\"rounded-lg border border-status-error-border/30 bg-status-error-bg/10 p-4\">\n <p className=\"text-sm text-status-error-text\">Cancelled Orders</p>\n <p className=\"text-2xl font-bold text-status-error-text\">\n {analytics.orders.cancelled.toLocaleString('en-IN')}\n </p>\n <p className=\"text-sm text-status-error-text/80\">\n {((analytics.orders.cancelled / analytics.orders.total) * 100).toFixed(1)}% of\n total\n </p>\n </div>\n </div>\n </div>\n\n <div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">\n Top Performing Carts\n </h3>\n <div className=\"rounded-lg border border-border-seam overflow-hidden\">\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\">\n Cart Name\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase\">\n Revenue\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase\">\n Orders\n </th>\n <th className=\"px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase\">\n Rating\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border\">\n {analytics.carts.topPerforming.map((cart, i) => (\n <tr key={cart.id} className=\"hover:bg-accent/50 transition-colors\">\n <td className=\"px-4 py-3\">\n <div className=\"flex items-center gap-2\">\n {medalIcon(i)}\n <span className=\"text-sm font-medium text-text-primary\">\n {cart.name}\n </span>\n </div>\n </td>\n <td className=\"px-4 py-3 text-sm text-right font-medium text-text-primary\">\n {fmtCur(cart.revenue)}\n </td>\n <td className=\"px-4 py-3 text-sm text-right text-text-primary\">\n {cart.orders.toLocaleString('en-IN')}\n </td>\n <td className=\"px-4 py-3 text-sm text-right text-text-primary\">\n <span className=\"flex items-center justify-end gap-1\">\n <Star className=\"h-3.5 w-3.5 fill-status-warning-text text-status-warning-text\" />\n {cart.rating}\n </span>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n </div>\n )}\n\n {/* Revenue Tab */}\n {activeTab === 'revenue' && (\n <div className=\"space-y-8\">\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-4\">\n <div className=\"rounded-lg border border-status-info-border/30 bg-status-info-bg/10 p-6\">\n <h4 className=\"text-sm font-medium text-status-info-text mb-2\">This Month</h4>\n <p className=\"text-2xl font-bold text-status-info-text\">\n {fmtCur(analytics.revenue.thisMonth)}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-sunken/30 p-6\">\n <h4 className=\"text-sm font-medium text-text-secondary mb-2\">Last Month</h4>\n <p className=\"text-2xl font-bold text-text-primary\">\n {fmtCur(analytics.revenue.lastMonth)}\n </p>\n </div>\n <div className=\"rounded-lg border border-status-success-border/30 bg-status-success-bg/10 p-6\">\n <h4 className=\"text-sm font-medium text-status-success-text mb-2\">\n Average Order Value\n </h4>\n <p className=\"text-2xl font-bold text-status-success-text\">\n ₹{analytics.orders.averageOrderValue}\n </p>\n </div>\n </div>\n\n <div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">Revenue by City</h3>\n <div className=\"space-y-3\">\n {analytics.geography.topCities.map((city, i) => (\n <div\n key={city.city}\n className=\"flex items-center justify-between p-4 rounded-lg border border-border-seam bg-bg-sunken/30\"\n >\n <div className=\"flex items-center gap-3\">\n {medalIcon(i)}\n <div>\n <p className=\"font-medium text-text-primary\">{city.city}</p>\n <p className=\"text-sm text-text-secondary\">\n {city.orders.toLocaleString('en-IN')} orders\n </p>\n </div>\n </div>\n <div className=\"text-right\">\n <p className=\"font-bold text-text-primary\">{fmtCur(city.revenue)}</p>\n <p className=\"text-sm text-text-secondary\">\n {((city.revenue / analytics.revenue.total) * 100).toFixed(1)}%\n </p>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n )}\n\n {/* Users Tab */}\n {activeTab === 'users' && (\n <div className=\"space-y-8\">\n <div className=\"grid grid-cols-1 md:grid-cols-4 gap-4\">\n {[\n { label: 'Customers', value: analytics.users.customers, color: 'blue' },\n { label: 'Cart Owners', value: analytics.users.cartOwners, color: 'green' },\n { label: 'Workers', value: analytics.users.workers, color: 'yellow' },\n { label: 'Investors', value: analytics.users.investors, color: 'purple' },\n ].map((item) => (\n <div\n key={item.label}\n className={cn(\n 'rounded-lg border p-4',\n `border-${item.color}-500/30 bg-${item.color}-500/10`\n )}\n >\n <h4\n className={cn(\n 'text-sm font-medium',\n `text-${item.color}-600 dark:text-${item.color}-400`\n )}\n >\n {item.label}\n </h4>\n <p\n className={cn(\n 'text-2xl font-bold',\n `text-${item.color}-700 dark:text-${item.color}-300`\n )}\n >\n {item.value.toLocaleString('en-IN')}\n </p>\n <p\n className={cn(\n 'text-sm',\n `text-${item.color}-600/80 dark:text-${item.color}-400/80`\n )}\n >\n {((item.value / analytics.users.total) * 100).toFixed(1)}%\n </p>\n </div>\n ))}\n </div>\n\n <div className=\"rounded-lg border border-border-seam bg-bg-sunken/20 p-6\">\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">\n User Growth Insights\n </h3>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">New Users This Month</p>\n <p className=\"text-3xl font-bold text-status-info-text\">\n {analytics.users.newThisMonth}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Active Users Rate</p>\n <p className=\"text-3xl font-bold text-status-success-text\">\n {((analytics.users.active / analytics.users.total) * 100).toFixed(1)}%\n </p>\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* Performance Tab */}\n {activeTab === 'performance' && (\n <div className=\"space-y-8\">\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\">\n <div className=\"flex items-center gap-2 mb-2\">\n <Timer className=\"h-4 w-4 text-text-secondary\" />\n <h4 className=\"text-sm font-medium text-text-secondary\">Avg Delivery Time</h4>\n </div>\n <p className=\"text-3xl font-bold text-text-primary\">\n {analytics.performance.averageDeliveryTime} min\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">Target: < 30 min</p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-2\">\n <Star className=\"h-4 w-4 text-text-secondary\" />\n <h4 className=\"text-sm font-medium text-text-secondary\">\n Customer Satisfaction\n </h4>\n </div>\n <p className=\"text-3xl font-bold text-text-primary flex items-center gap-1\">\n <Star className=\"h-6 w-6 fill-status-warning-text text-status-warning-text\" />\n {analytics.performance.customerSatisfaction}\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">Based on ratings</p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6\">\n <div className=\"flex items-center gap-2 mb-2\">\n <IndianRupee className=\"h-4 w-4 text-text-secondary\" />\n <h4 className=\"text-sm font-medium text-text-secondary\">Platform Fee</h4>\n </div>\n <p className=\"text-3xl font-bold text-text-primary\">\n {analytics.performance.platformFee}%\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">Per transaction</p>\n </div>\n </div>\n\n <div className=\"rounded-lg border border-border-seam bg-bg-sunken/20 p-6\">\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">\n Financial Performance\n </h3>\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Operating Costs</p>\n <p className=\"text-2xl font-bold text-status-error-text\">\n {fmtCur(analytics.performance.operatingCosts)}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Total Revenue</p>\n <p className=\"text-2xl font-bold text-status-info-text\">\n {fmtCur(analytics.revenue.total)}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Net Profit</p>\n <p className=\"text-2xl font-bold text-status-success-text\">\n {fmtCur(analytics.performance.netProfit)}\n </p>\n </div>\n </div>\n <div className=\"mt-4 rounded-lg border border-border-seam bg-bg-surface p-4\">\n <p className=\"text-sm text-text-secondary\">Profit Margin</p>\n <p className=\"text-xl font-bold text-text-primary\">\n {((analytics.performance.netProfit / analytics.revenue.total) * 100).toFixed(1)}\n %\n </p>\n </div>\n </div>\n\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-6\">\n <h3 className=\"text-lg font-semibold text-text-primary mb-4\">\n Today's Performance\n </h3>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Orders Today</p>\n <p className=\"text-3xl font-bold text-status-info-text\">\n {analytics.orders.ordersToday}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary mb-2\">Estimated Revenue</p>\n <p className=\"text-3xl font-bold text-status-success-text\">\n {fmtCur(analytics.orders.ordersToday * analytics.orders.averageOrderValue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AC,KAAD;WAAG,WAAU;qBAAmC;WAAgB,CAAA,EAChE,kBAAC,KAAD;WAAG,WAAU;qBACV,EAAU,OAAO;WAChB,CAAA,CACA,EAAA,CAAA,EACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;WAAG,WAAU;qBAAmC;WAAqB,CAAA,EACrE,kBAAC,KAAD;WAAG,WAAU;qBACV,EAAO,EAAU,OAAO,cAAc,EAAU,OAAO,kBAAkB;WACxE,CAAA,CACA,EAAA,CAAA,CACF;YACF;;QACF;;MAEJ;OACF;;GACK"}
|
|
@@ -87,15 +87,15 @@ function D() {
|
|
|
87
87
|
order: b,
|
|
88
88
|
dispute: s
|
|
89
89
|
}[e] ?? o, { className: "h-4 w-4" }), z = (e) => ({
|
|
90
|
-
user_registration: "text-
|
|
91
|
-
cart_approval: "text-
|
|
92
|
-
investment: "text-
|
|
93
|
-
order: "text-
|
|
94
|
-
dispute: "text-
|
|
90
|
+
user_registration: "text-status-info-text",
|
|
91
|
+
cart_approval: "text-accent-purple",
|
|
92
|
+
investment: "text-status-success-text",
|
|
93
|
+
order: "text-status-success-text",
|
|
94
|
+
dispute: "text-status-warning-text"
|
|
95
95
|
})[e] ?? "text-text-secondary", B = (e) => ({
|
|
96
|
-
completed: "bg-
|
|
97
|
-
pending: "bg-
|
|
98
|
-
failed: "bg-
|
|
96
|
+
completed: "bg-status-success-bg/20 text-status-success-text",
|
|
97
|
+
pending: "bg-status-warning-bg/20 text-status-warning-text",
|
|
98
|
+
failed: "bg-status-error-bg/20 text-status-error-text"
|
|
99
99
|
})[e] ?? "bg-secondary text-secondary-foreground";
|
|
100
100
|
return I ? /* @__PURE__ */ T(n, {
|
|
101
101
|
title: "Admin Dashboard",
|
|
@@ -110,10 +110,11 @@ function D() {
|
|
|
110
110
|
}) : /* @__PURE__ */ E(n, {
|
|
111
111
|
title: "Admin Dashboard",
|
|
112
112
|
description: `Welcome, ${k}! Monitor and manage the platform.`,
|
|
113
|
+
titleGradient: !0,
|
|
113
114
|
actions: A?.pendingApprovals && A.pendingApprovals > 0 ? /* @__PURE__ */ E("div", {
|
|
114
|
-
className: "flex items-center gap-2 rounded-lg border border-
|
|
115
|
-
children: [/* @__PURE__ */ T(s, { className: "h-4 w-4 text-
|
|
116
|
-
className: "text-sm font-medium text-
|
|
115
|
+
className: "flex items-center gap-2 rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-3 py-2",
|
|
116
|
+
children: [/* @__PURE__ */ T(s, { className: "h-4 w-4 text-status-error-text" }), /* @__PURE__ */ E("span", {
|
|
117
|
+
className: "text-sm font-medium text-status-error-text",
|
|
117
118
|
children: [A.pendingApprovals, " pending approvals"]
|
|
118
119
|
})]
|
|
119
120
|
}) : void 0,
|
|
@@ -129,7 +130,7 @@ function D() {
|
|
|
129
130
|
/* @__PURE__ */ E("button", {
|
|
130
131
|
type: "button",
|
|
131
132
|
onClick: () => D("/admin/carts"),
|
|
132
|
-
className: "flex items-center gap-3 rounded-lg bg-
|
|
133
|
+
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",
|
|
133
134
|
children: [
|
|
134
135
|
/* @__PURE__ */ T(s, { className: "h-5 w-5" }),
|
|
135
136
|
"Approve Carts (",
|
|
@@ -140,43 +141,43 @@ function D() {
|
|
|
140
141
|
/* @__PURE__ */ E("button", {
|
|
141
142
|
type: "button",
|
|
142
143
|
onClick: () => D("/admin/carts"),
|
|
143
|
-
className: "flex items-center gap-3 rounded-lg border border-border-
|
|
144
|
+
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",
|
|
144
145
|
children: [/* @__PURE__ */ T(x, { className: "h-5 w-5 text-text-secondary" }), "Manage Carts"]
|
|
145
146
|
}),
|
|
146
147
|
/* @__PURE__ */ E("button", {
|
|
147
148
|
type: "button",
|
|
148
149
|
onClick: () => D("/admin/users"),
|
|
149
|
-
className: "flex items-center gap-3 rounded-lg border border-border-
|
|
150
|
+
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",
|
|
150
151
|
children: [/* @__PURE__ */ T(C, { className: "h-5 w-5 text-text-secondary" }), "User Management"]
|
|
151
152
|
}),
|
|
152
153
|
/* @__PURE__ */ E("button", {
|
|
153
154
|
type: "button",
|
|
154
155
|
onClick: () => D("/admin/orders"),
|
|
155
|
-
className: "flex items-center gap-3 rounded-lg border border-border-
|
|
156
|
+
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",
|
|
156
157
|
children: [/* @__PURE__ */ T(b, { className: "h-5 w-5 text-text-secondary" }), "Order Management"]
|
|
157
158
|
}),
|
|
158
159
|
/* @__PURE__ */ E("button", {
|
|
159
160
|
type: "button",
|
|
160
161
|
onClick: () => D("/admin/financial"),
|
|
161
|
-
className: "flex items-center gap-3 rounded-lg border border-border-
|
|
162
|
+
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",
|
|
162
163
|
children: [/* @__PURE__ */ T(h, { className: "h-5 w-5 text-text-secondary" }), "Financial Analytics"]
|
|
163
164
|
}),
|
|
164
165
|
/* @__PURE__ */ E("button", {
|
|
165
166
|
type: "button",
|
|
166
167
|
onClick: () => D("/admin/analytics"),
|
|
167
|
-
className: "flex items-center gap-3 rounded-lg border border-border-
|
|
168
|
+
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",
|
|
168
169
|
children: [/* @__PURE__ */ T(l, { className: "h-5 w-5 text-text-secondary" }), "Analytics"]
|
|
169
170
|
}),
|
|
170
171
|
/* @__PURE__ */ E("button", {
|
|
171
172
|
type: "button",
|
|
172
173
|
onClick: () => D("/admin/settings"),
|
|
173
|
-
className: "flex items-center gap-3 rounded-lg border border-border-
|
|
174
|
+
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",
|
|
174
175
|
children: [/* @__PURE__ */ T(v, { className: "h-5 w-5 text-text-secondary" }), "Settings"]
|
|
175
176
|
}),
|
|
176
177
|
/* @__PURE__ */ E("button", {
|
|
177
178
|
type: "button",
|
|
178
179
|
onClick: () => D("/admin/analytics"),
|
|
179
|
-
className: "flex items-center gap-3 rounded-lg border border-border-
|
|
180
|
+
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",
|
|
180
181
|
children: [/* @__PURE__ */ T(m, { className: "h-5 w-5 text-text-secondary" }), "Reports"]
|
|
181
182
|
})
|
|
182
183
|
]
|
|
@@ -226,42 +227,42 @@ function D() {
|
|
|
226
227
|
className: "grid grid-cols-2 lg:grid-cols-4 gap-4 mt-4",
|
|
227
228
|
children: [
|
|
228
229
|
/* @__PURE__ */ E("div", {
|
|
229
|
-
className: "rounded-lg border border-border-
|
|
230
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
230
231
|
children: [/* @__PURE__ */ T("p", {
|
|
231
232
|
className: "text-xs text-text-secondary",
|
|
232
233
|
children: "Active Users (24h)"
|
|
233
234
|
}), /* @__PURE__ */ T("p", {
|
|
234
|
-
className: "text-xl font-bold text-
|
|
235
|
+
className: "text-xl font-bold text-status-success-text",
|
|
235
236
|
children: A.activeUsers.toLocaleString("en-IN")
|
|
236
237
|
})]
|
|
237
238
|
}),
|
|
238
239
|
/* @__PURE__ */ E("div", {
|
|
239
|
-
className: "rounded-lg border border-border-
|
|
240
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
240
241
|
children: [/* @__PURE__ */ T("p", {
|
|
241
242
|
className: "text-xs text-text-secondary",
|
|
242
243
|
children: "Pending Approvals"
|
|
243
244
|
}), /* @__PURE__ */ T("p", {
|
|
244
|
-
className: "text-xl font-bold text-
|
|
245
|
+
className: "text-xl font-bold text-status-error-text",
|
|
245
246
|
children: A.pendingApprovals
|
|
246
247
|
})]
|
|
247
248
|
}),
|
|
248
249
|
/* @__PURE__ */ E("div", {
|
|
249
|
-
className: "rounded-lg border border-border-
|
|
250
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
250
251
|
children: [/* @__PURE__ */ T("p", {
|
|
251
252
|
className: "text-xs text-text-secondary",
|
|
252
253
|
children: "Total Investments"
|
|
253
254
|
}), /* @__PURE__ */ T("p", {
|
|
254
|
-
className: "text-xl font-bold text-
|
|
255
|
+
className: "text-xl font-bold text-status-info-text",
|
|
255
256
|
children: A.totalInvestments.toLocaleString("en-IN")
|
|
256
257
|
})]
|
|
257
258
|
}),
|
|
258
259
|
/* @__PURE__ */ E("div", {
|
|
259
|
-
className: "rounded-lg border border-border-
|
|
260
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
260
261
|
children: [/* @__PURE__ */ T("p", {
|
|
261
262
|
className: "text-xs text-text-secondary",
|
|
262
263
|
children: "Platform Commission"
|
|
263
264
|
}), /* @__PURE__ */ E("p", {
|
|
264
|
-
className: "text-xl font-bold text-
|
|
265
|
+
className: "text-xl font-bold text-accent-purple",
|
|
265
266
|
children: [
|
|
266
267
|
"₹",
|
|
267
268
|
(A.platformCommission / 1e3).toFixed(0),
|
|
@@ -279,7 +280,7 @@ function D() {
|
|
|
279
280
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
280
281
|
children: "User Distribution"
|
|
281
282
|
}), /* @__PURE__ */ E("div", {
|
|
282
|
-
className: "rounded-lg border border-border-
|
|
283
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-6",
|
|
283
284
|
children: [/* @__PURE__ */ E("div", {
|
|
284
285
|
className: "grid grid-cols-2 lg:grid-cols-4 gap-6",
|
|
285
286
|
children: [
|
|
@@ -287,7 +288,7 @@ function D() {
|
|
|
287
288
|
className: "text-center",
|
|
288
289
|
children: [
|
|
289
290
|
/* @__PURE__ */ T("div", {
|
|
290
|
-
className: "text-2xl sm:text-3xl font-bold text-
|
|
291
|
+
className: "text-2xl sm:text-3xl font-bold text-status-info-text",
|
|
291
292
|
children: P.customers.toLocaleString("en-IN")
|
|
292
293
|
}),
|
|
293
294
|
/* @__PURE__ */ T("div", {
|
|
@@ -304,7 +305,7 @@ function D() {
|
|
|
304
305
|
className: "text-center",
|
|
305
306
|
children: [
|
|
306
307
|
/* @__PURE__ */ T("div", {
|
|
307
|
-
className: "text-2xl sm:text-3xl font-bold text-
|
|
308
|
+
className: "text-2xl sm:text-3xl font-bold text-status-success-text",
|
|
308
309
|
children: P.cartOwners.toLocaleString("en-IN")
|
|
309
310
|
}),
|
|
310
311
|
/* @__PURE__ */ T("div", {
|
|
@@ -321,7 +322,7 @@ function D() {
|
|
|
321
322
|
className: "text-center",
|
|
322
323
|
children: [
|
|
323
324
|
/* @__PURE__ */ T("div", {
|
|
324
|
-
className: "text-2xl sm:text-3xl font-bold text-
|
|
325
|
+
className: "text-2xl sm:text-3xl font-bold text-status-warning-text",
|
|
325
326
|
children: P.workers.toLocaleString("en-IN")
|
|
326
327
|
}),
|
|
327
328
|
/* @__PURE__ */ T("div", {
|
|
@@ -338,7 +339,7 @@ function D() {
|
|
|
338
339
|
className: "text-center",
|
|
339
340
|
children: [
|
|
340
341
|
/* @__PURE__ */ T("div", {
|
|
341
|
-
className: "text-2xl sm:text-3xl font-bold text-
|
|
342
|
+
className: "text-2xl sm:text-3xl font-bold text-accent-purple",
|
|
342
343
|
children: P.investors.toLocaleString("en-IN")
|
|
343
344
|
}),
|
|
344
345
|
/* @__PURE__ */ T("div", {
|
|
@@ -353,14 +354,14 @@ function D() {
|
|
|
353
354
|
})
|
|
354
355
|
]
|
|
355
356
|
}), /* @__PURE__ */ T("div", {
|
|
356
|
-
className: "mt-4 pt-4 border-t border-border-
|
|
357
|
+
className: "mt-4 pt-4 border-t border-border-seam",
|
|
357
358
|
children: /* @__PURE__ */ E("div", {
|
|
358
359
|
className: "flex justify-between items-center",
|
|
359
360
|
children: [/* @__PURE__ */ T("span", {
|
|
360
361
|
className: "text-sm text-text-secondary",
|
|
361
362
|
children: "User Growth (This Month)"
|
|
362
363
|
}), /* @__PURE__ */ E("span", {
|
|
363
|
-
className: "text-sm font-medium text-
|
|
364
|
+
className: "text-sm font-medium text-status-success-text",
|
|
364
365
|
children: [
|
|
365
366
|
"+",
|
|
366
367
|
P.growth,
|
|
@@ -385,7 +386,7 @@ function D() {
|
|
|
385
386
|
children: ["View all activities", /* @__PURE__ */ T(c, { className: "h-4 w-4" })]
|
|
386
387
|
})]
|
|
387
388
|
}), /* @__PURE__ */ T("div", {
|
|
388
|
-
className: "rounded-lg border border-border-
|
|
389
|
+
className: "rounded-lg border border-border-seam bg-bg-surface divide-y divide-border",
|
|
389
390
|
children: M.map((e) => /* @__PURE__ */ E("div", {
|
|
390
391
|
className: "flex items-start gap-3 px-4 py-3",
|
|
391
392
|
children: [/* @__PURE__ */ T("div", {
|
|
@@ -427,7 +428,7 @@ function D() {
|
|
|
427
428
|
/* @__PURE__ */ E("div", {
|
|
428
429
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8",
|
|
429
430
|
children: [/* @__PURE__ */ E("div", {
|
|
430
|
-
className: "rounded-lg border border-border-
|
|
431
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-6",
|
|
431
432
|
children: [/* @__PURE__ */ E("div", {
|
|
432
433
|
className: "flex items-center gap-2 mb-4",
|
|
433
434
|
children: [/* @__PURE__ */ T(y, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ T("h3", {
|
|
@@ -446,7 +447,7 @@ function D() {
|
|
|
446
447
|
children: "Server Status"
|
|
447
448
|
})]
|
|
448
449
|
}), /* @__PURE__ */ E("span", {
|
|
449
|
-
className: "inline-flex items-center gap-1.5 rounded-full bg-
|
|
450
|
+
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",
|
|
450
451
|
children: [/* @__PURE__ */ T(u, { className: "h-3 w-3" }), "Healthy"]
|
|
451
452
|
})]
|
|
452
453
|
}),
|
|
@@ -459,7 +460,7 @@ function D() {
|
|
|
459
460
|
children: "Database Performance"
|
|
460
461
|
})]
|
|
461
462
|
}), /* @__PURE__ */ E("span", {
|
|
462
|
-
className: "inline-flex items-center gap-1.5 rounded-full bg-
|
|
463
|
+
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",
|
|
463
464
|
children: [/* @__PURE__ */ T(u, { className: "h-3 w-3" }), "Optimal"]
|
|
464
465
|
})]
|
|
465
466
|
}),
|
|
@@ -472,7 +473,7 @@ function D() {
|
|
|
472
473
|
children: "Payment Gateway"
|
|
473
474
|
})]
|
|
474
475
|
}), /* @__PURE__ */ E("span", {
|
|
475
|
-
className: "inline-flex items-center gap-1.5 rounded-full bg-
|
|
476
|
+
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",
|
|
476
477
|
children: [/* @__PURE__ */ T(u, { className: "h-3 w-3" }), "Online"]
|
|
477
478
|
})]
|
|
478
479
|
}),
|
|
@@ -505,7 +506,7 @@ function D() {
|
|
|
505
506
|
]
|
|
506
507
|
})]
|
|
507
508
|
}), /* @__PURE__ */ E("div", {
|
|
508
|
-
className: "rounded-lg border border-border-
|
|
509
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-6",
|
|
509
510
|
children: [/* @__PURE__ */ E("div", {
|
|
510
511
|
className: "flex items-center gap-2 mb-4",
|
|
511
512
|
children: [/* @__PURE__ */ T(h, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ T("h3", {
|
|
@@ -613,7 +614,7 @@ function D() {
|
|
|
613
614
|
return /* @__PURE__ */ E("button", {
|
|
614
615
|
type: "button",
|
|
615
616
|
onClick: () => D(e.path),
|
|
616
|
-
className: t("flex items-center gap-4 rounded-lg border border-border-
|
|
617
|
+
className: t("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", "hover:bg-accent hover:shadow-md"),
|
|
617
618
|
children: [/* @__PURE__ */ T("div", {
|
|
618
619
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
|
|
619
620
|
children: /* @__PURE__ */ T(n, { className: "h-5 w-5" })
|