@burdenoff/microfe-kadaikodi 2026.802.1 → 2026.830.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/kadaikodi/KadaikodiRoot.d.ts.map +1 -1
- package/dist/kadaikodi/KadaikodiRoot.js +69 -72
- package/dist/kadaikodi/KadaikodiRoot.js.map +1 -1
- package/dist/kadaikodi/components/InvestmentCard.d.ts.map +1 -1
- package/dist/kadaikodi/components/InvestmentCard.js +58 -54
- package/dist/kadaikodi/components/InvestmentCard.js.map +1 -1
- package/dist/kadaikodi/components/OrderCard.d.ts.map +1 -1
- package/dist/kadaikodi/components/StatusBadge.d.ts.map +1 -1
- package/dist/kadaikodi/components/StatusBadge.js +25 -14
- package/dist/kadaikodi/components/StatusBadge.js.map +1 -1
- package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts +24 -0
- package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts.map +1 -1
- package/dist/kadaikodi/hooks/useKadaikodiApi.js +177 -132
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/HomePage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/HomePage.js +284 -282
- package/dist/kadaikodi/pages/HomePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.d.ts +7 -2
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +319 -228
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +1 -1
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/CartManagementPage.d.ts +10 -4
- package/dist/kadaikodi/pages/admin/CartManagementPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/admin/CartManagementPage.js +320 -279
- package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js +365 -292
- package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.d.ts +7 -2
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +300 -158
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/SettingsPage.js +286 -286
- package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDetailPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDetailPage.js +3 -3
- package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.d.ts +13 -3
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +270 -220
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js +97 -97
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.d.ts +5 -3
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +286 -199
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/kadaikodi/types/index.d.ts +46 -2
- package/dist/kadaikodi/types/index.d.ts.map +1 -1
- package/dist/shared/hooks/useTr.d.ts +2 -0
- package/dist/shared/hooks/useTr.d.ts.map +1 -0
- package/dist/shared/hooks/useTr.js +14 -0
- package/dist/shared/hooks/useTr.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,116 +1,158 @@
|
|
|
1
1
|
import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
-
import { useAdminAnalytics as r, useDashboardStats as i, useOrders as a, useProviders as
|
|
5
|
-
import { formatCurrency as
|
|
6
|
-
import { MetricsCard as
|
|
7
|
-
import { AreaChart as
|
|
8
|
-
import { HBarFunnel as
|
|
9
|
-
import { DonutChart as
|
|
4
|
+
import { useAdminAnalytics as r, useDashboardStats as i, useOrders as a, useProviders as ee } from "../../hooks/useKadaikodiApi.js";
|
|
5
|
+
import { formatCurrency as o } from "../../utils/formatters.js";
|
|
6
|
+
import { MetricsCard as s } from "../../components/MetricsCard.js";
|
|
7
|
+
import { AreaChart as c } from "../../components/viz/AreaChart.js";
|
|
8
|
+
import { HBarFunnel as l } from "../../components/viz/HBarFunnel.js";
|
|
9
|
+
import { DonutChart as te } from "../../components/viz/DonutChart.js";
|
|
10
10
|
import "../../components/viz/index.js";
|
|
11
|
-
import { useMemo as
|
|
12
|
-
import { Award as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { EmphasisPanel as
|
|
11
|
+
import { useMemo as u, useState as d } from "react";
|
|
12
|
+
import { Award as ne, BarChart3 as f, CalendarRange as re, IndianRupee as p, Loader2 as ie, ShoppingBag as ae, Star as m, Store as h, TrendingUp as g, Users as _, Zap as v } from "lucide-react";
|
|
13
|
+
import { Fragment as oe, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
14
|
+
import { EmphasisPanel as se, GlassCard as x, NextSteps as S, PagePurpose as ce } from "@burdenoff/fe-libs/ui";
|
|
15
15
|
//#region src/kadaikodi/pages/admin/AdminAnalyticsPage.tsx
|
|
16
|
-
var
|
|
16
|
+
var C = 1440 * 60 * 1e3, w = [
|
|
17
|
+
{
|
|
18
|
+
id: "7",
|
|
19
|
+
label: "Last 7 days",
|
|
20
|
+
days: 7
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "30",
|
|
24
|
+
label: "Last 30 days",
|
|
25
|
+
days: 30
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "90",
|
|
29
|
+
label: "Last 90 days",
|
|
30
|
+
days: 90
|
|
31
|
+
}
|
|
32
|
+
], T = (e) => e.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (e) => e.toUpperCase()), E = (e) => {
|
|
17
33
|
let t = new Date(e);
|
|
18
34
|
return t.setHours(0, 0, 0, 0), t.getTime();
|
|
19
|
-
},
|
|
35
|
+
}, D = (e) => new Date(e).toLocaleDateString("en-IN", {
|
|
20
36
|
day: "numeric",
|
|
21
37
|
month: "short"
|
|
22
38
|
});
|
|
23
|
-
function
|
|
24
|
-
let { navigateTo:
|
|
25
|
-
let e =
|
|
39
|
+
function O() {
|
|
40
|
+
let { navigateTo: O } = e(), { data: k, isLoading: A } = i(), { data: j, isLoading: le } = r(), { data: M = [], isLoading: ue } = ee(), { data: N = [], isLoading: de } = a({}), [P, F] = d("overview"), [I, L] = d("30"), R = u(() => w.find((e) => e.id === I)?.days ?? 30, [I]), z = u(() => w.find((e) => e.id === I)?.label ?? "Last 30 days", [I]), B = A || le || ue || de, V = (e) => e >= 1e7 ? `₹${(e / 1e7).toFixed(1)}Cr` : e >= 1e5 ? `₹${(e / 1e5).toFixed(1)}L` : o(e, { minimumFractionDigits: 0 }), H = u(() => {
|
|
41
|
+
let e = N.length, t = N.filter((e) => e.status === "delivered").length, n = N.filter((e) => e.status === "cancelled").length, r = N.filter((e) => e.status === "pending" || e.status === "confirmed").length, i = /* @__PURE__ */ new Date();
|
|
26
42
|
return i.setHours(0, 0, 0, 0), {
|
|
27
43
|
total: e,
|
|
28
44
|
completed: t,
|
|
29
45
|
cancelled: n,
|
|
30
46
|
pending: r,
|
|
31
|
-
ordersToday:
|
|
32
|
-
avgOrderValue:
|
|
47
|
+
ordersToday: N.filter((e) => new Date(e.orderDate).getTime() >= i.getTime()).length,
|
|
48
|
+
avgOrderValue: k && k.totalOrders > 0 ? k.totalRevenue / k.totalOrders : 0
|
|
33
49
|
};
|
|
34
|
-
}, [
|
|
35
|
-
let e = Object.entries(
|
|
50
|
+
}, [N, k]), U = u(() => M.filter((e) => !e.isOpen).length, [M]), W = j?.topProviders ?? [], fe = j?.customerGrowth?.customers ?? 0, G = u(() => {
|
|
51
|
+
let e = Object.entries(j?.categoryDistribution ?? {}), t = e.reduce((e, [, t]) => e + t, 0);
|
|
36
52
|
return e.map(([e, n]) => ({
|
|
37
53
|
category: e,
|
|
38
54
|
count: n,
|
|
39
55
|
percentage: t > 0 ? n / t * 100 : 0
|
|
40
56
|
})).sort((e, t) => t.count - e.count);
|
|
41
|
-
}, [
|
|
42
|
-
label:
|
|
57
|
+
}, [j]), K = (e) => e.replace(/_/g, " ").toLowerCase(), q = (e, t) => t > 0 ? e / t * 100 : 0, J = u(() => Object.entries(j?.categoryDistribution ?? {}).sort((e, t) => t[1] - e[1]).map(([e, t]) => ({
|
|
58
|
+
label: T(e),
|
|
43
59
|
value: t
|
|
44
|
-
})), [
|
|
45
|
-
let e =
|
|
46
|
-
for (let
|
|
47
|
-
for (let e of
|
|
48
|
-
let
|
|
49
|
-
|
|
60
|
+
})), [j]), Y = u(() => J.reduce((e, t) => e + t.value, 0), [J]), X = u(() => E(/* @__PURE__ */ new Date()) - (R - 1) * C, [R]), { gmvTrend: pe, volumeTrend: me } = u(() => {
|
|
61
|
+
let e = E(/* @__PURE__ */ new Date()), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
62
|
+
for (let r = X; r <= e; r += C) t.set(r, 0), n.set(r, 0);
|
|
63
|
+
for (let e of N) {
|
|
64
|
+
let r = E(new Date(e.orderDate));
|
|
65
|
+
t.has(r) && (t.set(r, (t.get(r) ?? 0) + (e.total ?? 0)), n.set(r, (n.get(r) ?? 0) + 1));
|
|
50
66
|
}
|
|
51
67
|
return {
|
|
52
|
-
gmvTrend: [...
|
|
53
|
-
label:
|
|
68
|
+
gmvTrend: [...t.entries()].map(([e, t]) => ({
|
|
69
|
+
label: D(e),
|
|
54
70
|
value: t
|
|
55
71
|
})),
|
|
56
|
-
volumeTrend: [...
|
|
57
|
-
label:
|
|
72
|
+
volumeTrend: [...n.entries()].map(([e, t]) => ({
|
|
73
|
+
label: D(e),
|
|
58
74
|
value: t
|
|
59
75
|
}))
|
|
60
76
|
};
|
|
61
|
-
}, [
|
|
62
|
-
let e =
|
|
63
|
-
|
|
77
|
+
}, [N, X]), Z = u(() => {
|
|
78
|
+
let e = j?.orderTrends ?? [];
|
|
79
|
+
if (e.length === 0) return [];
|
|
80
|
+
let t = E(/* @__PURE__ */ new Date()), n = /* @__PURE__ */ new Map();
|
|
81
|
+
for (let t of e) {
|
|
82
|
+
let e = t.customerId;
|
|
83
|
+
if (!e) continue;
|
|
84
|
+
let r = E(new Date(t.createdAt));
|
|
85
|
+
if (Number.isNaN(r)) continue;
|
|
86
|
+
let i = n.get(e);
|
|
87
|
+
(i === void 0 || r < i) && n.set(e, r);
|
|
88
|
+
}
|
|
89
|
+
if (n.size === 0) return [];
|
|
90
|
+
let r = [...n.values()], i = [];
|
|
91
|
+
for (let e = X; e <= t; e += C) i.push({
|
|
92
|
+
label: D(e),
|
|
93
|
+
value: r.filter((t) => t <= e).length
|
|
94
|
+
});
|
|
95
|
+
return i;
|
|
96
|
+
}, [j, X]), Q = u(() => ({
|
|
97
|
+
count: M.filter((e) => {
|
|
98
|
+
if (!e.createdAt) return !1;
|
|
99
|
+
let t = new Date(e.createdAt).getTime();
|
|
100
|
+
return !Number.isNaN(t) && t >= X;
|
|
101
|
+
}).length,
|
|
102
|
+
isFloor: M.length >= 100
|
|
103
|
+
}), [M, X]), $ = u(() => {
|
|
104
|
+
let e = new Map(M.map((e) => [e.id, e.category])), t = /* @__PURE__ */ new Map();
|
|
105
|
+
for (let n of N) {
|
|
64
106
|
let r = e.get(n.cartId) ?? "OTHER";
|
|
65
107
|
t.set(r, (t.get(r) ?? 0) + (n.total ?? 0));
|
|
66
108
|
}
|
|
67
109
|
return [...t.entries()].filter(([, e]) => e > 0).sort((e, t) => t[1] - e[1]).slice(0, 6).map(([e, t]) => ({
|
|
68
|
-
label:
|
|
110
|
+
label: T(e),
|
|
69
111
|
value: t
|
|
70
112
|
}));
|
|
71
|
-
}, [
|
|
72
|
-
if (
|
|
113
|
+
}, [N, M]), he = (e) => e < 3 ? /* @__PURE__ */ y(ne, { className: "h-5 w-5 text-status-warning-text" }) : /* @__PURE__ */ y(f, { className: "h-5 w-5 text-text-secondary" });
|
|
114
|
+
if (B || !k) return /* @__PURE__ */ y(n, {
|
|
73
115
|
title: "Platform Analytics",
|
|
74
116
|
description: "Loading analytics...",
|
|
75
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ b("div", {
|
|
76
118
|
className: "flex flex-col items-center justify-center py-20",
|
|
77
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ y(ie, { className: "h-10 w-10 animate-spin text-text-secondary mb-4" }), /* @__PURE__ */ y("p", {
|
|
78
120
|
className: "text-text-secondary",
|
|
79
121
|
children: "Loading analytics..."
|
|
80
122
|
})]
|
|
81
123
|
})
|
|
82
124
|
});
|
|
83
|
-
let
|
|
125
|
+
let ge = [
|
|
84
126
|
{
|
|
85
127
|
key: "overview",
|
|
86
128
|
label: "Overview",
|
|
87
|
-
icon:
|
|
129
|
+
icon: f
|
|
88
130
|
},
|
|
89
131
|
{
|
|
90
132
|
key: "revenue",
|
|
91
133
|
label: "Revenue",
|
|
92
|
-
icon:
|
|
134
|
+
icon: p
|
|
93
135
|
},
|
|
94
136
|
{
|
|
95
137
|
key: "users",
|
|
96
138
|
label: "Users",
|
|
97
|
-
icon:
|
|
139
|
+
icon: _
|
|
98
140
|
},
|
|
99
141
|
{
|
|
100
142
|
key: "performance",
|
|
101
143
|
label: "Performance",
|
|
102
|
-
icon:
|
|
144
|
+
icon: v
|
|
103
145
|
}
|
|
104
146
|
];
|
|
105
|
-
return /* @__PURE__ */
|
|
147
|
+
return /* @__PURE__ */ b(n, {
|
|
106
148
|
title: "Platform Analytics",
|
|
107
149
|
description: "Comprehensive platform metrics and trends",
|
|
108
150
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ y(ce, {
|
|
110
152
|
className: "mb-6",
|
|
111
153
|
children: "Your bird's-eye view of how Kadaikodi is performing. Spot revenue and order trends, see which carts and categories drive the most business, and understand where customers are growing — so you can decide where to invest and which carts to promote. Switch tabs to drill into revenue, users, and operational performance."
|
|
112
154
|
}),
|
|
113
|
-
/* @__PURE__ */ S
|
|
155
|
+
/* @__PURE__ */ y(S, {
|
|
114
156
|
storageKey: "kadaikodi-admin-analytics",
|
|
115
157
|
className: "mb-6",
|
|
116
158
|
steps: [
|
|
@@ -118,403 +160,452 @@ function M() {
|
|
|
118
160
|
id: "review-carts",
|
|
119
161
|
label: "Review top-performing carts",
|
|
120
162
|
description: "See which carts drive the most revenue and orders.",
|
|
121
|
-
onClick: () =>
|
|
163
|
+
onClick: () => F("overview")
|
|
122
164
|
},
|
|
123
165
|
{
|
|
124
166
|
id: "check-revenue",
|
|
125
167
|
label: "Break down revenue by category",
|
|
126
168
|
description: "Find your strongest categories in the Revenue tab.",
|
|
127
|
-
onClick: () =>
|
|
169
|
+
onClick: () => F("revenue")
|
|
128
170
|
},
|
|
129
171
|
{
|
|
130
172
|
id: "manage-carts",
|
|
131
173
|
label: "Approve pending carts",
|
|
132
174
|
description: "Onboard the carts waiting for review.",
|
|
133
|
-
onClick: () =>
|
|
134
|
-
done:
|
|
175
|
+
onClick: () => O("/admin/carts"),
|
|
176
|
+
done: U === 0
|
|
135
177
|
}
|
|
136
178
|
]
|
|
137
179
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
className: "flex justify-end
|
|
140
|
-
children: /* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ b("div", {
|
|
181
|
+
className: "mb-6 flex flex-wrap items-center justify-end gap-3",
|
|
182
|
+
children: [/* @__PURE__ */ b("span", {
|
|
141
183
|
className: "text-sm text-text-secondary",
|
|
142
184
|
children: ["Last updated: ", (/* @__PURE__ */ new Date()).toLocaleString("en-IN")]
|
|
143
|
-
})
|
|
185
|
+
}), /* @__PURE__ */ b("label", {
|
|
186
|
+
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ y(re, { className: "h-4 w-4" }),
|
|
189
|
+
/* @__PURE__ */ y("span", {
|
|
190
|
+
className: "sr-only",
|
|
191
|
+
children: "Reporting period"
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ y("select", {
|
|
194
|
+
value: I,
|
|
195
|
+
onChange: (e) => L(e.target.value),
|
|
196
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
197
|
+
children: w.map((e) => /* @__PURE__ */ y("option", {
|
|
198
|
+
value: e.id,
|
|
199
|
+
children: e.label
|
|
200
|
+
}, e.id))
|
|
201
|
+
})
|
|
202
|
+
]
|
|
203
|
+
})]
|
|
144
204
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ b(se, {
|
|
146
206
|
className: "mb-8",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
148
208
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
149
209
|
children: "Key Metrics"
|
|
150
|
-
}), /* @__PURE__ */
|
|
151
|
-
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-
|
|
210
|
+
}), /* @__PURE__ */ b("div", {
|
|
211
|
+
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4",
|
|
152
212
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ y(s, {
|
|
154
214
|
featured: !0,
|
|
155
|
-
icon: /* @__PURE__ */
|
|
156
|
-
value:
|
|
215
|
+
icon: /* @__PURE__ */ y(p, { className: "h-5 w-5" }),
|
|
216
|
+
value: V(k.totalRevenue),
|
|
157
217
|
label: "Total Revenue"
|
|
158
218
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
icon: /* @__PURE__ */
|
|
161
|
-
value: (
|
|
219
|
+
/* @__PURE__ */ y(s, {
|
|
220
|
+
icon: /* @__PURE__ */ y(ae, { className: "h-5 w-5" }),
|
|
221
|
+
value: (k.totalOrders ?? 0).toLocaleString("en-IN"),
|
|
162
222
|
label: "Total Orders"
|
|
163
223
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
icon: /* @__PURE__ */
|
|
166
|
-
value: (
|
|
224
|
+
/* @__PURE__ */ y(s, {
|
|
225
|
+
icon: /* @__PURE__ */ y(_, { className: "h-5 w-5" }),
|
|
226
|
+
value: (k.activeCustomers ?? 0).toLocaleString("en-IN"),
|
|
167
227
|
label: "Active Customers"
|
|
168
228
|
}),
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
icon: /* @__PURE__ */
|
|
171
|
-
value: (
|
|
229
|
+
/* @__PURE__ */ y(s, {
|
|
230
|
+
icon: /* @__PURE__ */ y(h, { className: "h-5 w-5" }),
|
|
231
|
+
value: (k.activeProviders ?? 0).toLocaleString("en-IN"),
|
|
172
232
|
label: "Active Carts",
|
|
173
|
-
trendValue: `${
|
|
233
|
+
trendValue: `${U} pending`
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ y(s, {
|
|
236
|
+
icon: /* @__PURE__ */ y(g, { className: "h-5 w-5" }),
|
|
237
|
+
value: `${Q.count.toLocaleString("en-IN")}${Q.isFloor ? "+" : ""}`,
|
|
238
|
+
label: "New Carts",
|
|
239
|
+
trendValue: Q.isFloor ? `${z.toLowerCase()} · of carts loaded` : z.toLowerCase()
|
|
174
240
|
})
|
|
175
241
|
]
|
|
176
242
|
})]
|
|
177
243
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ b("div", {
|
|
179
245
|
className: "mb-8 grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
180
246
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ b(x, {
|
|
182
248
|
treatment: "plain",
|
|
183
249
|
className: "p-6",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
185
251
|
className: "mb-4 text-base font-semibold text-text-primary",
|
|
186
252
|
children: "Category Distribution"
|
|
187
|
-
}),
|
|
188
|
-
segments:
|
|
189
|
-
centerLabel:
|
|
253
|
+
}), J.length > 0 ? /* @__PURE__ */ y(te, {
|
|
254
|
+
segments: J,
|
|
255
|
+
centerLabel: Y.toLocaleString("en-IN"),
|
|
190
256
|
centerCaption: "carts",
|
|
191
257
|
valueFormatter: (e) => e.toLocaleString("en-IN")
|
|
192
|
-
}) : /* @__PURE__ */
|
|
258
|
+
}) : /* @__PURE__ */ y("p", {
|
|
193
259
|
className: "text-sm text-text-secondary",
|
|
194
260
|
children: "Category breakdown will appear here as carts are onboarded."
|
|
195
261
|
})]
|
|
196
262
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ b(x, {
|
|
198
264
|
treatment: "plain",
|
|
199
265
|
className: "p-6",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
266
|
+
children: [/* @__PURE__ */ b("div", {
|
|
201
267
|
className: "mb-4 flex items-center justify-between gap-2",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
203
269
|
className: "text-base font-semibold text-text-primary",
|
|
204
270
|
children: "GMV over time"
|
|
205
|
-
}), /* @__PURE__ */
|
|
271
|
+
}), /* @__PURE__ */ y("span", {
|
|
206
272
|
className: "text-xs text-text-muted",
|
|
207
|
-
children:
|
|
273
|
+
children: z
|
|
208
274
|
})]
|
|
209
|
-
}),
|
|
210
|
-
series:
|
|
275
|
+
}), N.length > 0 ? /* @__PURE__ */ y(c, {
|
|
276
|
+
series: pe,
|
|
211
277
|
height: 200,
|
|
212
|
-
valueFormatter: (e) =>
|
|
213
|
-
title:
|
|
214
|
-
}) : /* @__PURE__ */
|
|
278
|
+
valueFormatter: (e) => V(e),
|
|
279
|
+
title: `Gross merchandise value per day, ${z.toLowerCase()}`
|
|
280
|
+
}) : /* @__PURE__ */ y("p", {
|
|
215
281
|
className: "text-sm text-text-secondary",
|
|
216
282
|
children: "GMV will chart here once orders are placed."
|
|
217
283
|
})]
|
|
218
284
|
}),
|
|
219
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ b(x, {
|
|
286
|
+
treatment: "plain",
|
|
287
|
+
className: "p-6",
|
|
288
|
+
children: [/* @__PURE__ */ b("div", {
|
|
289
|
+
className: "mb-4 flex items-center justify-between gap-2",
|
|
290
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
291
|
+
className: "text-base font-semibold text-text-primary",
|
|
292
|
+
children: "Customer Growth"
|
|
293
|
+
}), /* @__PURE__ */ y("span", {
|
|
294
|
+
className: "text-xs text-text-muted",
|
|
295
|
+
children: z
|
|
296
|
+
})]
|
|
297
|
+
}), Z.length > 0 ? /* @__PURE__ */ b(oe, { children: [/* @__PURE__ */ y(c, {
|
|
298
|
+
series: Z,
|
|
299
|
+
height: 200,
|
|
300
|
+
valueFormatter: (e) => e.toLocaleString("en-IN"),
|
|
301
|
+
title: `Cumulative distinct ordering customers, ${z.toLowerCase()}`
|
|
302
|
+
}), /* @__PURE__ */ y("p", {
|
|
303
|
+
className: "mt-3 text-xs text-text-muted",
|
|
304
|
+
children: "Distinct customers seen in the recent order stream, cumulative by day."
|
|
305
|
+
})] }) : /* @__PURE__ */ y("p", {
|
|
306
|
+
className: "text-sm text-text-secondary",
|
|
307
|
+
children: "Customer growth will chart here once orders carry customers."
|
|
308
|
+
})]
|
|
309
|
+
}),
|
|
310
|
+
/* @__PURE__ */ b(x, {
|
|
220
311
|
treatment: "plain",
|
|
221
312
|
className: "p-6",
|
|
222
|
-
children: [/* @__PURE__ */
|
|
313
|
+
children: [/* @__PURE__ */ b("div", {
|
|
223
314
|
className: "mb-4 flex items-center justify-between gap-2",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
225
316
|
className: "text-base font-semibold text-text-primary",
|
|
226
317
|
children: "Order Volume"
|
|
227
|
-
}), /* @__PURE__ */
|
|
318
|
+
}), /* @__PURE__ */ y("span", {
|
|
228
319
|
className: "text-xs text-text-muted",
|
|
229
|
-
children:
|
|
320
|
+
children: z
|
|
230
321
|
})]
|
|
231
|
-
}),
|
|
232
|
-
series:
|
|
322
|
+
}), N.length > 0 ? /* @__PURE__ */ y(c, {
|
|
323
|
+
series: me,
|
|
233
324
|
height: 200,
|
|
234
325
|
valueFormatter: (e) => e.toLocaleString("en-IN"),
|
|
235
|
-
title:
|
|
236
|
-
}) : /* @__PURE__ */
|
|
326
|
+
title: `Order volume per day, ${z.toLowerCase()}`
|
|
327
|
+
}) : /* @__PURE__ */ y("p", {
|
|
237
328
|
className: "text-sm text-text-secondary",
|
|
238
329
|
children: "Order volume will chart here once orders are placed."
|
|
239
330
|
})]
|
|
240
331
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ b(x, {
|
|
242
333
|
treatment: "plain",
|
|
243
334
|
className: "p-6",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
335
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
245
336
|
className: "mb-4 text-base font-semibold text-text-primary",
|
|
246
337
|
children: "Top Categories by Revenue"
|
|
247
|
-
}), $.length > 0 ? /* @__PURE__ */
|
|
338
|
+
}), $.length > 0 ? /* @__PURE__ */ y(l, {
|
|
248
339
|
stages: $,
|
|
249
340
|
showConversion: !1,
|
|
250
|
-
valueFormatter: (e) =>
|
|
251
|
-
}) : /* @__PURE__ */
|
|
341
|
+
valueFormatter: (e) => V(e)
|
|
342
|
+
}) : /* @__PURE__ */ y("p", {
|
|
252
343
|
className: "text-sm text-text-secondary",
|
|
253
344
|
children: "Category revenue will rank here as orders come in."
|
|
254
345
|
})]
|
|
255
346
|
})
|
|
256
347
|
]
|
|
257
348
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ b("div", {
|
|
259
350
|
className: "rounded-lg border border-border-subtle bg-bg-surface mb-8",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ y("div", {
|
|
261
352
|
className: "border-b border-border-subtle",
|
|
262
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ y("nav", {
|
|
263
354
|
className: "flex -mb-px overflow-x-auto",
|
|
264
|
-
children:
|
|
355
|
+
children: ge.map((e) => {
|
|
265
356
|
let n = e.icon;
|
|
266
|
-
return /* @__PURE__ */
|
|
357
|
+
return /* @__PURE__ */ b("button", {
|
|
267
358
|
type: "button",
|
|
268
|
-
onClick: () =>
|
|
269
|
-
className: t("flex items-center gap-2 py-3 px-4 sm:px-6 text-sm font-medium whitespace-nowrap border-b-2 transition-colors",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
359
|
+
onClick: () => F(e.key),
|
|
360
|
+
className: t("flex items-center gap-2 py-3 px-4 sm:px-6 text-sm font-medium whitespace-nowrap border-b-2 transition-colors", P === e.key ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
|
|
361
|
+
children: [/* @__PURE__ */ y(n, { className: "h-4 w-4" }), /* @__PURE__ */ y("span", {
|
|
271
362
|
className: "hidden sm:inline",
|
|
272
363
|
children: e.label
|
|
273
364
|
})]
|
|
274
365
|
}, e.key);
|
|
275
366
|
})
|
|
276
367
|
})
|
|
277
|
-
}), /* @__PURE__ */
|
|
368
|
+
}), /* @__PURE__ */ b("div", {
|
|
278
369
|
className: "p-4 sm:p-6",
|
|
279
370
|
children: [
|
|
280
|
-
|
|
371
|
+
P === "overview" && /* @__PURE__ */ b("div", {
|
|
281
372
|
className: "space-y-8",
|
|
282
|
-
children: [/* @__PURE__ */
|
|
373
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
|
|
283
374
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
284
375
|
children: "Order Status Distribution"
|
|
285
|
-
}),
|
|
376
|
+
}), H.total > 0 ? /* @__PURE__ */ b("div", {
|
|
286
377
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
287
378
|
children: [
|
|
288
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ b("div", {
|
|
289
380
|
className: "rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-4",
|
|
290
381
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ y("p", {
|
|
292
383
|
className: "text-sm text-status-success-text",
|
|
293
384
|
children: "Completed Orders"
|
|
294
385
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ y("p", {
|
|
296
387
|
className: "text-2xl font-bold text-status-success-text",
|
|
297
|
-
children:
|
|
388
|
+
children: H.completed.toLocaleString("en-IN")
|
|
298
389
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ b("p", {
|
|
300
391
|
className: "text-sm text-status-success-text/80",
|
|
301
|
-
children: [
|
|
392
|
+
children: [q(H.completed, H.total).toFixed(1), "% of total"]
|
|
302
393
|
})
|
|
303
394
|
]
|
|
304
395
|
}),
|
|
305
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ b("div", {
|
|
306
397
|
className: "rounded-lg border border-status-warning-text/30 bg-status-warning-bg-subtle p-4",
|
|
307
398
|
children: [
|
|
308
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ y("p", {
|
|
309
400
|
className: "text-sm text-status-warning-text",
|
|
310
401
|
children: "Pending Orders"
|
|
311
402
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ y("p", {
|
|
313
404
|
className: "text-2xl font-bold text-status-warning-text",
|
|
314
|
-
children:
|
|
405
|
+
children: H.pending.toLocaleString("en-IN")
|
|
315
406
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ b("p", {
|
|
317
408
|
className: "text-sm text-status-warning-text/80",
|
|
318
|
-
children: [
|
|
409
|
+
children: [q(H.pending, H.total).toFixed(1), "% of total"]
|
|
319
410
|
})
|
|
320
411
|
]
|
|
321
412
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ b("div", {
|
|
323
414
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle p-4",
|
|
324
415
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ y("p", {
|
|
326
417
|
className: "text-sm text-status-error-text",
|
|
327
418
|
children: "Cancelled Orders"
|
|
328
419
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ y("p", {
|
|
330
421
|
className: "text-2xl font-bold text-status-error-text",
|
|
331
|
-
children:
|
|
422
|
+
children: H.cancelled.toLocaleString("en-IN")
|
|
332
423
|
}),
|
|
333
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ b("p", {
|
|
334
425
|
className: "text-sm text-status-error-text/80",
|
|
335
|
-
children: [
|
|
426
|
+
children: [q(H.cancelled, H.total).toFixed(1), "% of total"]
|
|
336
427
|
})
|
|
337
428
|
]
|
|
338
429
|
})
|
|
339
430
|
]
|
|
340
|
-
}) : /* @__PURE__ */
|
|
431
|
+
}) : /* @__PURE__ */ y("p", {
|
|
341
432
|
className: "text-sm text-text-secondary",
|
|
342
433
|
children: "Order breakdowns will appear here once orders are placed."
|
|
343
|
-
})] }), /* @__PURE__ */
|
|
434
|
+
})] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
|
|
344
435
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
345
436
|
children: "Top Performing Carts"
|
|
346
|
-
}),
|
|
437
|
+
}), W.length > 0 ? /* @__PURE__ */ y("div", {
|
|
347
438
|
className: "rounded-lg border border-border-subtle overflow-hidden",
|
|
348
|
-
children: /* @__PURE__ */
|
|
439
|
+
children: /* @__PURE__ */ b("table", {
|
|
349
440
|
className: "w-full",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ y("thead", { children: /* @__PURE__ */ b("tr", {
|
|
351
442
|
className: "border-b border-border-subtle bg-bg-sunken/50",
|
|
352
443
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ y("th", {
|
|
354
445
|
className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase",
|
|
355
446
|
children: "Cart Name"
|
|
356
447
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ y("th", {
|
|
358
449
|
className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase",
|
|
359
450
|
children: "Category"
|
|
360
451
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ y("th", {
|
|
362
453
|
className: "px-4 py-3 text-right text-xs font-medium text-text-secondary uppercase",
|
|
363
454
|
children: "Rating"
|
|
364
455
|
})
|
|
365
456
|
]
|
|
366
|
-
}) }), /* @__PURE__ */
|
|
457
|
+
}) }), /* @__PURE__ */ y("tbody", {
|
|
367
458
|
className: "divide-y divide-border",
|
|
368
|
-
children:
|
|
459
|
+
children: W.map((e, t) => /* @__PURE__ */ b("tr", {
|
|
369
460
|
className: "hover:bg-accent/50 transition-colors",
|
|
370
461
|
children: [
|
|
371
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ y("td", {
|
|
372
463
|
className: "px-4 py-3",
|
|
373
|
-
children: /* @__PURE__ */
|
|
464
|
+
children: /* @__PURE__ */ b("div", {
|
|
374
465
|
className: "flex items-center gap-2",
|
|
375
|
-
children: [
|
|
466
|
+
children: [he(t), /* @__PURE__ */ y("span", {
|
|
376
467
|
className: "text-sm font-medium text-text-primary",
|
|
377
468
|
children: e.name
|
|
378
469
|
})]
|
|
379
470
|
})
|
|
380
471
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ y("td", {
|
|
382
473
|
className: "px-4 py-3 text-sm text-left text-text-secondary capitalize",
|
|
383
|
-
children:
|
|
474
|
+
children: K(e.category)
|
|
384
475
|
}),
|
|
385
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ y("td", {
|
|
386
477
|
className: "px-4 py-3 text-sm text-right text-text-primary",
|
|
387
|
-
children: /* @__PURE__ */
|
|
478
|
+
children: /* @__PURE__ */ b("span", {
|
|
388
479
|
className: "flex items-center justify-end gap-1",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
480
|
+
children: [/* @__PURE__ */ y(m, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" }), (e.rating ?? 0).toFixed(1)]
|
|
390
481
|
})
|
|
391
482
|
})
|
|
392
483
|
]
|
|
393
484
|
}, e.id))
|
|
394
485
|
})]
|
|
395
486
|
})
|
|
396
|
-
}) : /* @__PURE__ */
|
|
487
|
+
}) : /* @__PURE__ */ y("p", {
|
|
397
488
|
className: "text-sm text-text-secondary",
|
|
398
489
|
children: "Top-performing carts will be ranked here once orders start flowing."
|
|
399
490
|
})] })]
|
|
400
491
|
}),
|
|
401
|
-
|
|
492
|
+
P === "revenue" && /* @__PURE__ */ b("div", {
|
|
402
493
|
className: "space-y-8",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
494
|
+
children: [/* @__PURE__ */ b("div", {
|
|
404
495
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
405
496
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ b("div", {
|
|
407
498
|
className: "rounded-lg border border-border-focus/30 bg-[var(--color-accent-soft)] p-6",
|
|
408
|
-
children: [/* @__PURE__ */
|
|
499
|
+
children: [/* @__PURE__ */ y("h4", {
|
|
409
500
|
className: "text-sm font-medium text-text-primary mb-2",
|
|
410
501
|
children: "Total Revenue"
|
|
411
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ y("p", {
|
|
412
503
|
className: "text-2xl font-bold text-text-primary",
|
|
413
|
-
children:
|
|
504
|
+
children: V(k.totalRevenue)
|
|
414
505
|
})]
|
|
415
506
|
}),
|
|
416
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ b("div", {
|
|
417
508
|
className: "rounded-lg border border-border-subtle bg-bg-sunken/30 p-6",
|
|
418
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ y("h4", {
|
|
419
510
|
className: "text-sm font-medium text-text-secondary mb-2",
|
|
420
511
|
children: "Total Orders"
|
|
421
|
-
}), /* @__PURE__ */
|
|
512
|
+
}), /* @__PURE__ */ y("p", {
|
|
422
513
|
className: "text-2xl font-bold text-text-primary",
|
|
423
|
-
children: (
|
|
514
|
+
children: (k.totalOrders ?? 0).toLocaleString("en-IN")
|
|
424
515
|
})]
|
|
425
516
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ b("div", {
|
|
427
518
|
className: "rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-6",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
519
|
+
children: [/* @__PURE__ */ y("h4", {
|
|
429
520
|
className: "text-sm font-medium text-status-success-text mb-2",
|
|
430
521
|
children: "Average Order Value"
|
|
431
|
-
}), /* @__PURE__ */
|
|
522
|
+
}), /* @__PURE__ */ y("p", {
|
|
432
523
|
className: "text-2xl font-bold text-status-success-text",
|
|
433
|
-
children:
|
|
524
|
+
children: V(H.avgOrderValue)
|
|
434
525
|
})]
|
|
435
526
|
})
|
|
436
527
|
]
|
|
437
|
-
}), $.length > 0 ? /* @__PURE__ */
|
|
438
|
-
/* @__PURE__ */
|
|
528
|
+
}), $.length > 0 ? /* @__PURE__ */ b("div", { children: [
|
|
529
|
+
/* @__PURE__ */ y("h4", {
|
|
439
530
|
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
440
531
|
children: "Revenue by Category"
|
|
441
532
|
}),
|
|
442
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ y(l, {
|
|
443
534
|
stages: $,
|
|
444
535
|
showConversion: !1,
|
|
445
|
-
valueFormatter: (e) =>
|
|
536
|
+
valueFormatter: (e) => V(e)
|
|
446
537
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ y("p", {
|
|
448
539
|
className: "mt-3 text-xs text-text-muted",
|
|
449
540
|
children: "Derived by attributing each order's value to its cart's category."
|
|
450
541
|
})
|
|
451
|
-
] }) : /* @__PURE__ */
|
|
542
|
+
] }) : /* @__PURE__ */ y("p", {
|
|
452
543
|
className: "text-sm text-text-secondary",
|
|
453
544
|
children: "Revenue by category will appear here as orders come in."
|
|
454
545
|
})]
|
|
455
546
|
}),
|
|
456
|
-
|
|
547
|
+
P === "users" && /* @__PURE__ */ b("div", {
|
|
457
548
|
className: "space-y-8",
|
|
458
549
|
children: [
|
|
459
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ b("div", {
|
|
460
551
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
461
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ b("div", {
|
|
462
553
|
className: "rounded-lg border border-border-subtle bg-bg-sunken/30 p-6",
|
|
463
|
-
children: [/* @__PURE__ */
|
|
554
|
+
children: [/* @__PURE__ */ b("div", {
|
|
464
555
|
className: "flex items-center gap-2 mb-2",
|
|
465
|
-
children: [/* @__PURE__ */
|
|
556
|
+
children: [/* @__PURE__ */ y(_, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ y("h4", {
|
|
466
557
|
className: "text-sm font-medium text-text-secondary",
|
|
467
558
|
children: "Active Customers"
|
|
468
559
|
})]
|
|
469
|
-
}), /* @__PURE__ */
|
|
560
|
+
}), /* @__PURE__ */ y("p", {
|
|
470
561
|
className: "text-3xl font-bold text-text-primary",
|
|
471
|
-
children: (
|
|
562
|
+
children: (k.activeCustomers ?? 0).toLocaleString("en-IN")
|
|
472
563
|
})]
|
|
473
|
-
}), /* @__PURE__ */
|
|
564
|
+
}), /* @__PURE__ */ b("div", {
|
|
474
565
|
className: "rounded-lg border border-border-subtle bg-bg-sunken/30 p-6",
|
|
475
|
-
children: [/* @__PURE__ */
|
|
566
|
+
children: [/* @__PURE__ */ b("div", {
|
|
476
567
|
className: "flex items-center gap-2 mb-2",
|
|
477
|
-
children: [/* @__PURE__ */
|
|
568
|
+
children: [/* @__PURE__ */ y(h, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ y("h4", {
|
|
478
569
|
className: "text-sm font-medium text-text-secondary",
|
|
479
570
|
children: "Active Cart Owners"
|
|
480
571
|
})]
|
|
481
|
-
}), /* @__PURE__ */
|
|
572
|
+
}), /* @__PURE__ */ y("p", {
|
|
482
573
|
className: "text-3xl font-bold text-text-primary",
|
|
483
|
-
children: (
|
|
574
|
+
children: (k.activeProviders ?? 0).toLocaleString("en-IN")
|
|
484
575
|
})]
|
|
485
576
|
})]
|
|
486
577
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ b("div", {
|
|
488
579
|
className: "rounded-lg border border-border-subtle bg-bg-sunken/20 p-6",
|
|
489
580
|
children: [
|
|
490
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ b("div", {
|
|
491
582
|
className: "flex items-center gap-2 mb-2",
|
|
492
|
-
children: [/* @__PURE__ */
|
|
583
|
+
children: [/* @__PURE__ */ y(_, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ y("h3", {
|
|
493
584
|
className: "text-sm font-medium text-text-secondary",
|
|
494
585
|
children: "Total Customers"
|
|
495
586
|
})]
|
|
496
587
|
}),
|
|
497
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ y("p", {
|
|
498
589
|
className: "text-3xl font-bold text-text-primary",
|
|
499
|
-
children:
|
|
590
|
+
children: fe.toLocaleString("en-IN")
|
|
500
591
|
}),
|
|
501
|
-
/* @__PURE__ */
|
|
592
|
+
/* @__PURE__ */ y("p", {
|
|
502
593
|
className: "mt-1 text-sm text-text-secondary",
|
|
503
594
|
children: "Customers on the platform to date."
|
|
504
595
|
})
|
|
505
596
|
]
|
|
506
597
|
}),
|
|
507
|
-
|
|
598
|
+
G.length > 0 && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
|
|
508
599
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
509
600
|
children: "Cart Category Distribution"
|
|
510
|
-
}), /* @__PURE__ */
|
|
601
|
+
}), /* @__PURE__ */ y("div", {
|
|
511
602
|
className: "space-y-3",
|
|
512
|
-
children:
|
|
603
|
+
children: G.map((e) => /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("div", {
|
|
513
604
|
className: "flex items-center justify-between mb-1",
|
|
514
|
-
children: [/* @__PURE__ */
|
|
605
|
+
children: [/* @__PURE__ */ y("span", {
|
|
515
606
|
className: "text-sm font-medium text-text-primary capitalize",
|
|
516
|
-
children:
|
|
517
|
-
}), /* @__PURE__ */
|
|
607
|
+
children: K(e.category)
|
|
608
|
+
}), /* @__PURE__ */ b("span", {
|
|
518
609
|
className: "text-sm text-text-secondary",
|
|
519
610
|
children: [
|
|
520
611
|
(e.count ?? 0).toLocaleString("en-IN"),
|
|
@@ -523,9 +614,9 @@ function M() {
|
|
|
523
614
|
"%)"
|
|
524
615
|
]
|
|
525
616
|
})]
|
|
526
|
-
}), /* @__PURE__ */
|
|
617
|
+
}), /* @__PURE__ */ y("div", {
|
|
527
618
|
className: "w-full bg-bg-sunken rounded-full h-2",
|
|
528
|
-
children: /* @__PURE__ */
|
|
619
|
+
children: /* @__PURE__ */ y("div", {
|
|
529
620
|
className: "bg-action-primary-bg h-2 rounded-full transition-all duration-300",
|
|
530
621
|
style: { width: `${e.percentage}%` }
|
|
531
622
|
})
|
|
@@ -533,91 +624,91 @@ function M() {
|
|
|
533
624
|
})] })
|
|
534
625
|
]
|
|
535
626
|
}),
|
|
536
|
-
|
|
627
|
+
P === "performance" && /* @__PURE__ */ b("div", {
|
|
537
628
|
className: "space-y-8",
|
|
538
|
-
children: [/* @__PURE__ */
|
|
629
|
+
children: [/* @__PURE__ */ b("div", {
|
|
539
630
|
className: "grid grid-cols-1 md:grid-cols-3 gap-6",
|
|
540
631
|
children: [
|
|
541
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ b("div", {
|
|
542
633
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
543
634
|
children: [
|
|
544
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ b("div", {
|
|
545
636
|
className: "flex items-center gap-2 mb-2",
|
|
546
|
-
children: [/* @__PURE__ */
|
|
637
|
+
children: [/* @__PURE__ */ y(m, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ y("h4", {
|
|
547
638
|
className: "text-sm font-medium text-text-secondary",
|
|
548
639
|
children: "Customer Satisfaction"
|
|
549
640
|
})]
|
|
550
641
|
}),
|
|
551
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ b("p", {
|
|
552
643
|
className: "text-3xl font-bold text-text-primary flex items-center gap-1",
|
|
553
|
-
children: [/* @__PURE__ */
|
|
644
|
+
children: [/* @__PURE__ */ y(m, { className: "h-6 w-6 fill-status-warning-text text-status-warning-text" }), k.avgRating > 0 ? k.avgRating.toFixed(1) : "—"]
|
|
554
645
|
}),
|
|
555
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ y("p", {
|
|
556
647
|
className: "text-sm text-text-secondary mt-1",
|
|
557
648
|
children: "Average rating across carts"
|
|
558
649
|
})
|
|
559
650
|
]
|
|
560
651
|
}),
|
|
561
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ b("div", {
|
|
562
653
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
563
654
|
children: [
|
|
564
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ b("div", {
|
|
565
656
|
className: "flex items-center gap-2 mb-2",
|
|
566
|
-
children: [/* @__PURE__ */
|
|
657
|
+
children: [/* @__PURE__ */ y(g, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ y("h4", {
|
|
567
658
|
className: "text-sm font-medium text-text-secondary",
|
|
568
659
|
children: "Completion Rate"
|
|
569
660
|
})]
|
|
570
661
|
}),
|
|
571
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ y("p", {
|
|
572
663
|
className: "text-3xl font-bold text-text-primary",
|
|
573
|
-
children:
|
|
664
|
+
children: H.total > 0 ? `${q(H.completed, H.total).toFixed(1)}%` : "—"
|
|
574
665
|
}),
|
|
575
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ y("p", {
|
|
576
667
|
className: "text-sm text-text-secondary mt-1",
|
|
577
668
|
children: "Orders delivered"
|
|
578
669
|
})
|
|
579
670
|
]
|
|
580
671
|
}),
|
|
581
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ b("div", {
|
|
582
673
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
583
674
|
children: [
|
|
584
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ b("div", {
|
|
585
676
|
className: "flex items-center gap-2 mb-2",
|
|
586
|
-
children: [/* @__PURE__ */
|
|
677
|
+
children: [/* @__PURE__ */ y(f, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ y("h4", {
|
|
587
678
|
className: "text-sm font-medium text-text-secondary",
|
|
588
679
|
children: "Cancellation Rate"
|
|
589
680
|
})]
|
|
590
681
|
}),
|
|
591
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ y("p", {
|
|
592
683
|
className: "text-3xl font-bold text-text-primary",
|
|
593
|
-
children:
|
|
684
|
+
children: H.total > 0 ? `${q(H.cancelled, H.total).toFixed(1)}%` : "—"
|
|
594
685
|
}),
|
|
595
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ y("p", {
|
|
596
687
|
className: "text-sm text-text-secondary mt-1",
|
|
597
688
|
children: "Orders cancelled"
|
|
598
689
|
})
|
|
599
690
|
]
|
|
600
691
|
})
|
|
601
692
|
]
|
|
602
|
-
}), /* @__PURE__ */
|
|
693
|
+
}), /* @__PURE__ */ b("div", {
|
|
603
694
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
604
|
-
children: [/* @__PURE__ */
|
|
695
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
605
696
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
606
697
|
children: "Today's Activity"
|
|
607
|
-
}), /* @__PURE__ */
|
|
698
|
+
}), /* @__PURE__ */ b("div", {
|
|
608
699
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
609
|
-
children: [/* @__PURE__ */
|
|
700
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
610
701
|
className: "text-sm text-text-secondary mb-2",
|
|
611
702
|
children: "Orders Today"
|
|
612
|
-
}), /* @__PURE__ */
|
|
703
|
+
}), /* @__PURE__ */ y("p", {
|
|
613
704
|
className: "text-3xl font-bold text-text-primary",
|
|
614
|
-
children:
|
|
615
|
-
})] }), /* @__PURE__ */
|
|
705
|
+
children: H.ordersToday.toLocaleString("en-IN")
|
|
706
|
+
})] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
616
707
|
className: "text-sm text-text-secondary mb-2",
|
|
617
708
|
children: "Pending Orders"
|
|
618
|
-
}), /* @__PURE__ */
|
|
709
|
+
}), /* @__PURE__ */ y("p", {
|
|
619
710
|
className: "text-3xl font-bold text-status-warning-text",
|
|
620
|
-
children: (
|
|
711
|
+
children: (k.pendingOrders ?? 0).toLocaleString("en-IN")
|
|
621
712
|
})] })]
|
|
622
713
|
})]
|
|
623
714
|
})]
|
|
@@ -629,6 +720,6 @@ function M() {
|
|
|
629
720
|
});
|
|
630
721
|
}
|
|
631
722
|
//#endregion
|
|
632
|
-
export {
|
|
723
|
+
export { O as AdminAnalyticsPage };
|
|
633
724
|
|
|
634
725
|
//# sourceMappingURL=AdminAnalyticsPage.js.map
|