@burdenoff/microfe-kadaikodi 2026.704.1 → 2026.704.3
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/kadaikodi/hooks/useKadaikodiApi.js +77 -26
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +297 -479
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminDashboard.js +114 -400
- package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +166 -292
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +282 -453
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminProfilePage.js +115 -242
- package/dist/kadaikodi/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminSettingsPage.js +2 -2
- package/dist/kadaikodi/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/UserManagementPage.js +5 -5
- package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +503 -627
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +339 -282
- package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +323 -422
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +374 -383
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +249 -208
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +1 -1
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +1 -1
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +171 -627
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/HelpSupportPage.js +331 -415
- package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/NotificationCenterPage.js +18 -670
- package/dist/kadaikodi/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CheckoutPage.js +4 -2
- package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js +191 -369
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +233 -389
- package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js +76 -118
- package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.js +135 -213
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +272 -774
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +232 -343
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js +112 -600
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js +127 -294
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +204 -290
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js +159 -500
- package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js +399 -487
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +13 -13
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js +192 -296
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +245 -397
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +85 -117
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +177 -395
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,436 +2,310 @@ import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
|
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
3
|
import { MetricsCard as n } from "../../components/MetricsCard.js";
|
|
4
4
|
import { EmptyState as r } from "../../components/EmptyState.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { useAdminAnalytics as i, useDashboardStats as a } from "../../hooks/useKadaikodiApi.js";
|
|
6
|
+
import { formatCurrency as o } from "../../utils/formatters.js";
|
|
7
|
+
import { useMemo as s } from "react";
|
|
8
|
+
import { ArrowLeft as c, Award as l, BarChart3 as u, Calendar as d, Clock as f, Download as p, IndianRupee as m, Loader2 as h, ShoppingBag as g, ShoppingCart as _, Star as v, Store as y, TrendingUp as b } from "lucide-react";
|
|
9
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
10
|
+
import { EmphasisPanel as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
|
|
10
11
|
//#region src/kadaikodi/pages/admin/AdminFinancialPage.tsx
|
|
11
|
-
function
|
|
12
|
-
let { navigateTo:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
id: "2",
|
|
34
|
-
name: "Pizza Corner",
|
|
35
|
-
revenue: 98e3,
|
|
36
|
-
orders: 620
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: "3",
|
|
40
|
-
name: "Biryani House",
|
|
41
|
-
revenue: 87e3,
|
|
42
|
-
orders: 580
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
id: "4",
|
|
46
|
-
name: "Healthy Bites",
|
|
47
|
-
revenue: 76e3,
|
|
48
|
-
orders: 490
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: "5",
|
|
52
|
-
name: "Street Food Junction",
|
|
53
|
-
revenue: 65e3,
|
|
54
|
-
orders: 420
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
revenueByCategory: [
|
|
58
|
-
{
|
|
59
|
-
category: "South Indian",
|
|
60
|
-
amount: 75e4,
|
|
61
|
-
percentage: 26.3
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
category: "North Indian",
|
|
65
|
-
amount: 62e4,
|
|
66
|
-
percentage: 21.8
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
category: "Chinese",
|
|
70
|
-
amount: 485e3,
|
|
71
|
-
percentage: 17
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
category: "Fast Food",
|
|
75
|
-
amount: 425e3,
|
|
76
|
-
percentage: 14.9
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
category: "Beverages",
|
|
80
|
-
amount: 32e4,
|
|
81
|
-
percentage: 11.2
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
category: "Desserts",
|
|
85
|
-
amount: 25e4,
|
|
86
|
-
percentage: 8.8
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
monthlyTrends: [
|
|
90
|
-
{
|
|
91
|
-
month: "Jan",
|
|
92
|
-
revenue: 38e4,
|
|
93
|
-
orders: 1200,
|
|
94
|
-
commission: 19e3
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
month: "Feb",
|
|
98
|
-
revenue: 42e4,
|
|
99
|
-
orders: 1350,
|
|
100
|
-
commission: 21e3
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
month: "Mar",
|
|
104
|
-
revenue: 395e3,
|
|
105
|
-
orders: 1280,
|
|
106
|
-
commission: 19750
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
month: "Apr",
|
|
110
|
-
revenue: 44e4,
|
|
111
|
-
orders: 1420,
|
|
112
|
-
commission: 22e3
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
month: "May",
|
|
116
|
-
revenue: 465e3,
|
|
117
|
-
orders: 1580,
|
|
118
|
-
commission: 23250
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
month: "Jun",
|
|
122
|
-
revenue: 425e3,
|
|
123
|
-
orders: 1400,
|
|
124
|
-
commission: 21250
|
|
125
|
-
}
|
|
126
|
-
]
|
|
127
|
-
}), T(!1);
|
|
128
|
-
}, 1e3);
|
|
129
|
-
return () => clearTimeout(e);
|
|
130
|
-
}, [E]);
|
|
131
|
-
let A = (e) => i(e, { minimumFractionDigits: 0 }), j = () => {
|
|
132
|
-
alert("Financial report export initiated");
|
|
133
|
-
}, M = (e) => e === 0 ? /* @__PURE__ */ y(c, { className: "h-5 w-5 text-status-warning-text" }) : e === 1 ? /* @__PURE__ */ y(c, { className: "h-5 w-5 text-text-secondary" }) : e === 2 ? /* @__PURE__ */ y(c, { className: "h-5 w-5 text-status-warning-text" }) : /* @__PURE__ */ y("span", {
|
|
12
|
+
function T() {
|
|
13
|
+
let { navigateTo: T } = e(), { data: E, isLoading: D } = a(), { data: O, isLoading: k } = i(), A = D || k, j = (e) => o(e, { minimumFractionDigits: 0 }), M = s(() => E && E.totalOrders > 0 ? E.totalRevenue / E.totalOrders : 0, [E]), N = s(() => {
|
|
14
|
+
let e = Object.entries(O?.categoryDistribution ?? {}), t = e.reduce((e, [, t]) => e + t, 0);
|
|
15
|
+
return e.map(([e, n]) => ({
|
|
16
|
+
category: e,
|
|
17
|
+
count: n,
|
|
18
|
+
percentage: t > 0 ? n / t * 100 : 0
|
|
19
|
+
})).sort((e, t) => t.count - e.count);
|
|
20
|
+
}, [O]), P = O?.topProviders ?? [], F = O?.orderTrends ?? [], I = (e) => e.replace(/_/g, " ").toLowerCase(), L = (e) => e === "delivered" ? "bg-status-success-bg-subtle text-status-success-text" : e === "cancelled" ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-warning-bg-subtle text-status-warning-text", R = () => {
|
|
21
|
+
let e = [];
|
|
22
|
+
e.push("Kadaikodi Financial Report"), e.push(""), e.push("Metric,Value"), e.push(`Total Revenue,${E?.totalRevenue ?? 0}`), e.push(`Total Orders,${E?.totalOrders ?? 0}`), e.push(`Average Order Value,${Math.round(M)}`), e.push(`Pending Orders,${E?.pendingOrders ?? 0}`), e.push(""), e.push("Cart Category Distribution"), e.push("Category,Carts,Share %"), N.forEach((t) => {
|
|
23
|
+
e.push(`${t.category},${t.count},${(t.percentage ?? 0).toFixed(1)}`);
|
|
24
|
+
}), e.push(""), e.push("Top Performing Carts"), e.push("Cart,Category,Rating"), P.forEach((t) => {
|
|
25
|
+
e.push(`${t.name},${t.category},${t.rating ?? 0}`);
|
|
26
|
+
}), e.push(""), e.push("Recent Orders"), e.push("Date,Status,Amount"), F.forEach((t) => {
|
|
27
|
+
e.push(`${new Date(t.createdAt).toISOString().slice(0, 10)},${t.status},${t.total ?? 0}`);
|
|
28
|
+
});
|
|
29
|
+
let t = new Blob([e.join("\n")], { type: "text/csv;charset=utf-8;" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
30
|
+
r.href = n, r.download = `kadaikodi-financial-report-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, r.click(), URL.revokeObjectURL(n);
|
|
31
|
+
}, z = (e) => e < 3 ? /* @__PURE__ */ x(l, { className: "h-5 w-5 text-status-warning-text" }) : /* @__PURE__ */ x("span", {
|
|
134
32
|
className: "flex h-5 w-5 items-center justify-center rounded-full bg-bg-sunken text-xs font-bold text-text-secondary",
|
|
135
33
|
children: e + 1
|
|
136
34
|
});
|
|
137
|
-
return
|
|
35
|
+
return A ? /* @__PURE__ */ x(t, {
|
|
138
36
|
title: "Financial Reports",
|
|
139
37
|
description: "Loading financial data...",
|
|
140
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ S("div", {
|
|
141
39
|
className: "flex flex-col items-center justify-center py-20",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ x(h, { className: "h-10 w-10 animate-spin text-text-secondary mb-4" }), /* @__PURE__ */ x("p", {
|
|
143
41
|
className: "text-text-secondary",
|
|
144
42
|
children: "Loading financial data..."
|
|
145
43
|
})]
|
|
146
44
|
})
|
|
147
|
-
}) :
|
|
45
|
+
}) : E ? /* @__PURE__ */ S(t, {
|
|
148
46
|
title: "Financial Reports",
|
|
149
|
-
description: "Revenue,
|
|
150
|
-
actions: /* @__PURE__ */
|
|
47
|
+
description: "Revenue, top carts and financial trends",
|
|
48
|
+
actions: /* @__PURE__ */ S("div", {
|
|
151
49
|
className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-3",
|
|
152
|
-
children: [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
children: [
|
|
164
|
-
/* @__PURE__ */ y("option", {
|
|
165
|
-
value: "7d",
|
|
166
|
-
children: "Last 7 days"
|
|
167
|
-
}),
|
|
168
|
-
/* @__PURE__ */ y("option", {
|
|
169
|
-
value: "30d",
|
|
170
|
-
children: "Last 30 days"
|
|
171
|
-
}),
|
|
172
|
-
/* @__PURE__ */ y("option", {
|
|
173
|
-
value: "90d",
|
|
174
|
-
children: "Last 3 months"
|
|
175
|
-
}),
|
|
176
|
-
/* @__PURE__ */ y("option", {
|
|
177
|
-
value: "1y",
|
|
178
|
-
children: "Last year"
|
|
179
|
-
})
|
|
180
|
-
]
|
|
181
|
-
}),
|
|
182
|
-
/* @__PURE__ */ b("button", {
|
|
183
|
-
type: "button",
|
|
184
|
-
onClick: j,
|
|
185
|
-
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",
|
|
186
|
-
children: [/* @__PURE__ */ y(d, { className: "h-4 w-4" }), " Export Report"]
|
|
187
|
-
})
|
|
188
|
-
]
|
|
50
|
+
children: [/* @__PURE__ */ S("button", {
|
|
51
|
+
type: "button",
|
|
52
|
+
onClick: () => T("/admin"),
|
|
53
|
+
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",
|
|
54
|
+
children: [/* @__PURE__ */ x(c, { className: "h-4 w-4" }), " Back"]
|
|
55
|
+
}), /* @__PURE__ */ S("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
onClick: R,
|
|
58
|
+
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",
|
|
59
|
+
children: [/* @__PURE__ */ x(p, { className: "h-4 w-4" }), " Export Report"]
|
|
60
|
+
})]
|
|
189
61
|
}),
|
|
190
62
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ x(w, {
|
|
192
64
|
className: "mb-6",
|
|
193
|
-
children: "The money view of Kadaikodi.
|
|
65
|
+
children: "The money view of Kadaikodi. Track total revenue and order volume, see which carts and categories drive the most business, and watch how orders trend over time — then export a CSV for accounting or investor updates."
|
|
194
66
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ S(C, {
|
|
196
68
|
className: "mb-8",
|
|
197
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
198
70
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
199
71
|
children: "Financial Summary"
|
|
200
|
-
}), /* @__PURE__ */
|
|
72
|
+
}), /* @__PURE__ */ S("div", {
|
|
201
73
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
|
|
202
74
|
children: [
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
trendValue: `+${O.revenueGrowth}% vs last period`
|
|
75
|
+
/* @__PURE__ */ x(n, {
|
|
76
|
+
featured: !0,
|
|
77
|
+
icon: /* @__PURE__ */ x(m, { className: "h-5 w-5" }),
|
|
78
|
+
value: j(E.totalRevenue),
|
|
79
|
+
label: "Total Revenue"
|
|
209
80
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
icon: /* @__PURE__ */
|
|
212
|
-
value:
|
|
213
|
-
label: "
|
|
214
|
-
trendValue: "Current month"
|
|
81
|
+
/* @__PURE__ */ x(n, {
|
|
82
|
+
icon: /* @__PURE__ */ x(g, { className: "h-5 w-5" }),
|
|
83
|
+
value: (E.totalOrders ?? 0).toLocaleString("en-IN"),
|
|
84
|
+
label: "Total Orders"
|
|
215
85
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
icon: /* @__PURE__ */
|
|
218
|
-
value:
|
|
219
|
-
label: "
|
|
220
|
-
trendValue: "Platform commission"
|
|
86
|
+
/* @__PURE__ */ x(n, {
|
|
87
|
+
icon: /* @__PURE__ */ x(b, { className: "h-5 w-5" }),
|
|
88
|
+
value: j(M),
|
|
89
|
+
label: "Avg Order Value"
|
|
221
90
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
icon: /* @__PURE__ */
|
|
224
|
-
value:
|
|
225
|
-
label: "Pending
|
|
226
|
-
trendValue: "Amount pending"
|
|
91
|
+
/* @__PURE__ */ x(n, {
|
|
92
|
+
icon: /* @__PURE__ */ x(f, { className: "h-5 w-5" }),
|
|
93
|
+
value: (E.pendingOrders ?? 0).toLocaleString("en-IN"),
|
|
94
|
+
label: "Pending Orders"
|
|
227
95
|
})
|
|
228
96
|
]
|
|
229
97
|
})]
|
|
230
98
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ S("div", {
|
|
232
100
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8",
|
|
233
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ S("div", {
|
|
234
102
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ S("div", {
|
|
236
104
|
className: "flex items-center gap-2 mb-4",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ x(_, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ x("h3", {
|
|
238
106
|
className: "text-lg font-semibold text-text-primary",
|
|
239
107
|
children: "Top Performing Carts"
|
|
240
108
|
})]
|
|
241
|
-
}), /* @__PURE__ */
|
|
109
|
+
}), P.length > 0 ? /* @__PURE__ */ x("div", {
|
|
242
110
|
className: "space-y-3",
|
|
243
|
-
children:
|
|
111
|
+
children: P.map((e, t) => /* @__PURE__ */ S("div", {
|
|
244
112
|
className: "flex items-center justify-between rounded-lg bg-bg-sunken/50 p-3",
|
|
245
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ S("div", {
|
|
246
114
|
className: "flex items-center gap-3",
|
|
247
|
-
children: [
|
|
115
|
+
children: [z(t), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
|
|
248
116
|
className: "text-sm font-medium text-text-primary",
|
|
249
117
|
children: e.name
|
|
250
|
-
}), /* @__PURE__ */
|
|
251
|
-
className: "text-xs text-text-secondary",
|
|
252
|
-
children:
|
|
118
|
+
}), /* @__PURE__ */ x("p", {
|
|
119
|
+
className: "text-xs text-text-secondary capitalize",
|
|
120
|
+
children: I(e.category)
|
|
253
121
|
})] })]
|
|
254
|
-
}), /* @__PURE__ */
|
|
255
|
-
className: "text-sm font-semibold text-text-primary",
|
|
256
|
-
children:
|
|
122
|
+
}), /* @__PURE__ */ S("p", {
|
|
123
|
+
className: "text-sm font-semibold text-text-primary flex items-center gap-1",
|
|
124
|
+
children: [/* @__PURE__ */ x(v, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" }), (e.rating ?? 0).toFixed(1)]
|
|
257
125
|
})]
|
|
258
126
|
}, e.id))
|
|
127
|
+
}) : /* @__PURE__ */ x("p", {
|
|
128
|
+
className: "text-sm text-text-secondary",
|
|
129
|
+
children: "Top-performing carts will be ranked here once orders start flowing."
|
|
259
130
|
})]
|
|
260
|
-
}), /* @__PURE__ */
|
|
131
|
+
}), /* @__PURE__ */ S("div", {
|
|
261
132
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
133
|
+
children: [/* @__PURE__ */ S("div", {
|
|
263
134
|
className: "flex items-center gap-2 mb-4",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ x(u, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ x("h3", {
|
|
265
136
|
className: "text-lg font-semibold text-text-primary",
|
|
266
|
-
children: "
|
|
137
|
+
children: "Cart Category Distribution"
|
|
267
138
|
})]
|
|
268
|
-
}), /* @__PURE__ */
|
|
139
|
+
}), N.length > 0 ? /* @__PURE__ */ x("div", {
|
|
269
140
|
className: "space-y-3",
|
|
270
|
-
children:
|
|
271
|
-
/* @__PURE__ */
|
|
141
|
+
children: N.map((e) => /* @__PURE__ */ S("div", { children: [
|
|
142
|
+
/* @__PURE__ */ S("div", {
|
|
272
143
|
className: "flex items-center justify-between mb-1",
|
|
273
|
-
children: [/* @__PURE__ */
|
|
274
|
-
className: "text-sm font-medium text-text-primary",
|
|
275
|
-
children: e.category
|
|
276
|
-
}), /* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ x("span", {
|
|
145
|
+
className: "text-sm font-medium text-text-primary capitalize",
|
|
146
|
+
children: I(e.category)
|
|
147
|
+
}), /* @__PURE__ */ S("span", {
|
|
277
148
|
className: "text-sm text-text-secondary",
|
|
278
|
-
children: [e.percentage, "%"]
|
|
149
|
+
children: [(e.percentage ?? 0).toFixed(1), "%"]
|
|
279
150
|
})]
|
|
280
151
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ x("div", {
|
|
282
153
|
className: "w-full bg-bg-sunken rounded-full h-2",
|
|
283
|
-
children: /* @__PURE__ */
|
|
154
|
+
children: /* @__PURE__ */ x("div", {
|
|
284
155
|
className: "bg-action-primary-bg h-2 rounded-full transition-all duration-300",
|
|
285
156
|
style: { width: `${e.percentage}%` }
|
|
286
157
|
})
|
|
287
158
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ x("div", {
|
|
289
160
|
className: "text-right mt-1",
|
|
290
|
-
children: /* @__PURE__ */
|
|
161
|
+
children: /* @__PURE__ */ S("span", {
|
|
291
162
|
className: "text-sm font-semibold text-text-primary",
|
|
292
|
-
children:
|
|
163
|
+
children: [
|
|
164
|
+
(e.count ?? 0).toLocaleString("en-IN"),
|
|
165
|
+
" ",
|
|
166
|
+
/* @__PURE__ */ x("span", {
|
|
167
|
+
className: "text-xs font-normal text-text-secondary",
|
|
168
|
+
children: e.count === 1 ? "cart" : "carts"
|
|
169
|
+
})
|
|
170
|
+
]
|
|
293
171
|
})
|
|
294
172
|
})
|
|
295
173
|
] }, e.category))
|
|
174
|
+
}) : /* @__PURE__ */ x("p", {
|
|
175
|
+
className: "text-sm text-text-secondary",
|
|
176
|
+
children: "Cart categories will appear here as carts are onboarded."
|
|
296
177
|
})]
|
|
297
178
|
})]
|
|
298
179
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
180
|
+
F.length > 0 && /* @__PURE__ */ S("div", {
|
|
300
181
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6 mb-8",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
182
|
+
children: [/* @__PURE__ */ S("div", {
|
|
302
183
|
className: "flex items-center gap-2 mb-4",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ x(d, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ x("h3", {
|
|
304
185
|
className: "text-lg font-semibold text-text-primary",
|
|
305
|
-
children: "
|
|
186
|
+
children: "Recent Orders"
|
|
306
187
|
})]
|
|
307
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ x("div", {
|
|
308
189
|
className: "overflow-x-auto",
|
|
309
|
-
children: /* @__PURE__ */
|
|
190
|
+
children: /* @__PURE__ */ S("table", {
|
|
310
191
|
className: "w-full",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ x("thead", { children: /* @__PURE__ */ S("tr", {
|
|
312
193
|
className: "border-b border-border-subtle bg-bg-sunken/50",
|
|
313
194
|
children: [
|
|
314
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ x("th", {
|
|
315
196
|
className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
316
|
-
children: "
|
|
317
|
-
}),
|
|
318
|
-
/* @__PURE__ */ y("th", {
|
|
319
|
-
className: "px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
320
|
-
children: "Revenue"
|
|
197
|
+
children: "Date"
|
|
321
198
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
className: "px-4 py-3 text-
|
|
324
|
-
children: "
|
|
199
|
+
/* @__PURE__ */ x("th", {
|
|
200
|
+
className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
201
|
+
children: "Status"
|
|
325
202
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ x("th", {
|
|
327
204
|
className: "px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
328
|
-
children: "
|
|
205
|
+
children: "Amount"
|
|
329
206
|
})
|
|
330
207
|
]
|
|
331
|
-
}) }), /* @__PURE__ */
|
|
208
|
+
}) }), /* @__PURE__ */ x("tbody", {
|
|
332
209
|
className: "divide-y divide-border",
|
|
333
|
-
children:
|
|
210
|
+
children: F.map((e) => /* @__PURE__ */ S("tr", {
|
|
334
211
|
className: "hover:bg-accent/50 transition-colors",
|
|
335
212
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ x("td", {
|
|
337
214
|
className: "px-4 py-3 text-sm font-medium text-text-primary",
|
|
338
|
-
children: e.
|
|
215
|
+
children: new Date(e.createdAt).toLocaleDateString("en-IN", {
|
|
216
|
+
day: "2-digit",
|
|
217
|
+
month: "short",
|
|
218
|
+
year: "numeric"
|
|
219
|
+
})
|
|
339
220
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
className: "px-4 py-3 text-sm
|
|
342
|
-
children:
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
children: e.orders.toLocaleString("en-IN")
|
|
221
|
+
/* @__PURE__ */ x("td", {
|
|
222
|
+
className: "px-4 py-3 text-sm",
|
|
223
|
+
children: /* @__PURE__ */ x("span", {
|
|
224
|
+
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium capitalize ${L(e.status)}`,
|
|
225
|
+
children: e.status.replace(/_/g, " ")
|
|
226
|
+
})
|
|
347
227
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ x("td", {
|
|
349
229
|
className: "px-4 py-3 text-sm text-right text-text-primary",
|
|
350
|
-
children:
|
|
230
|
+
children: j(e.total ?? 0)
|
|
351
231
|
})
|
|
352
232
|
]
|
|
353
|
-
}, e.
|
|
233
|
+
}, e.id))
|
|
354
234
|
})]
|
|
355
235
|
})
|
|
356
236
|
})]
|
|
357
237
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ S("div", {
|
|
359
239
|
className: "grid grid-cols-1 md:grid-cols-3 gap-6",
|
|
360
240
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ S("div", {
|
|
362
242
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6 text-center",
|
|
363
243
|
children: [
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ x(g, { className: "h-8 w-8 text-primary mx-auto mb-3" }),
|
|
245
|
+
/* @__PURE__ */ x("h4", {
|
|
366
246
|
className: "text-lg font-semibold text-text-primary mb-2",
|
|
367
247
|
children: "Total Orders"
|
|
368
248
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ x("p", {
|
|
370
250
|
className: "text-2xl font-bold text-primary",
|
|
371
|
-
children:
|
|
251
|
+
children: (E.totalOrders ?? 0).toLocaleString("en-IN")
|
|
372
252
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ x("p", {
|
|
374
254
|
className: "text-sm text-text-secondary mt-1",
|
|
375
|
-
children: "All
|
|
255
|
+
children: "All-time orders"
|
|
376
256
|
})
|
|
377
257
|
]
|
|
378
258
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ S("div", {
|
|
380
260
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6 text-center",
|
|
381
261
|
children: [
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ x(u, { className: "h-8 w-8 text-status-success-text mx-auto mb-3" }),
|
|
263
|
+
/* @__PURE__ */ x("h4", {
|
|
384
264
|
className: "text-lg font-semibold text-text-primary mb-2",
|
|
385
265
|
children: "Average Order Value"
|
|
386
266
|
}),
|
|
387
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ x("p", {
|
|
388
268
|
className: "text-2xl font-bold text-status-success-text",
|
|
389
|
-
children:
|
|
269
|
+
children: j(M)
|
|
390
270
|
}),
|
|
391
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ x("p", {
|
|
392
272
|
className: "text-sm text-text-secondary mt-1",
|
|
393
273
|
children: "Per order average"
|
|
394
274
|
})
|
|
395
275
|
]
|
|
396
276
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ S("div", {
|
|
398
278
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6 text-center",
|
|
399
279
|
children: [
|
|
400
|
-
/* @__PURE__ */ y
|
|
401
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ x(y, { className: "h-8 w-8 text-text-primary mx-auto mb-3" }),
|
|
281
|
+
/* @__PURE__ */ x("h4", {
|
|
402
282
|
className: "text-lg font-semibold text-text-primary mb-2",
|
|
403
|
-
children: "
|
|
283
|
+
children: "Active Carts"
|
|
404
284
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ x("p", {
|
|
406
286
|
className: "text-2xl font-bold text-text-primary",
|
|
407
|
-
children:
|
|
287
|
+
children: (E.activeProviders ?? 0).toLocaleString("en-IN")
|
|
408
288
|
}),
|
|
409
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ x("p", {
|
|
410
290
|
className: "text-sm text-text-secondary mt-1",
|
|
411
|
-
children: "
|
|
291
|
+
children: "Currently live on the platform"
|
|
412
292
|
})
|
|
413
293
|
]
|
|
414
294
|
})
|
|
415
295
|
]
|
|
416
296
|
})
|
|
417
297
|
]
|
|
418
|
-
}) : /* @__PURE__ */
|
|
298
|
+
}) : /* @__PURE__ */ x(t, {
|
|
419
299
|
title: "Financial Reports",
|
|
420
300
|
description: "Unable to load financial data",
|
|
421
|
-
children: /* @__PURE__ */
|
|
301
|
+
children: /* @__PURE__ */ x(r, {
|
|
422
302
|
illustration: "empty-data",
|
|
423
303
|
title: "No financial data available",
|
|
424
|
-
description: "We couldn't load the financial figures
|
|
425
|
-
action: /* @__PURE__ */ y("button", {
|
|
426
|
-
type: "button",
|
|
427
|
-
onClick: () => D("30d"),
|
|
428
|
-
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
429
|
-
children: "Reset to last 30 days"
|
|
430
|
-
})
|
|
304
|
+
description: "We couldn't load the financial figures right now. Please check back shortly."
|
|
431
305
|
})
|
|
432
306
|
});
|
|
433
307
|
}
|
|
434
308
|
//#endregion
|
|
435
|
-
export {
|
|
309
|
+
export { T as AdminFinancialPage };
|
|
436
310
|
|
|
437
311
|
//# sourceMappingURL=AdminFinancialPage.js.map
|