@burdenoff/microfe-kadaikodi 2026.626.2 → 2026.704.2
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 +260 -105
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/HomePage.js +4 -4
- package/dist/kadaikodi/pages/HomePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +341 -461
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminDashboard.js +115 -399
- package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +140 -283
- 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 +279 -333
- package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/UserManagementPage.js +299 -372
- 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 +329 -432
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +374 -384
- 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 +276 -279
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +229 -447
- 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 +34 -46
- package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +193 -447
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDetailPage.js +6 -6
- package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +2 -2
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.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 +255 -215
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/FavoritesPage.js +141 -178
- package/dist/kadaikodi/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +155 -161
- 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 +14 -140
- 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 +258 -523
- 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 +128 -295
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +205 -291
- 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 +426 -514
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +231 -225
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js +197 -301
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +247 -399
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +294 -327
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +179 -397
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +1 -1
- package/dist/kadaikodi/mocks/data.js +0 -1517
- package/dist/kadaikodi/mocks/data.js.map +0 -1
- package/dist/kadaikodi/mocks/users.js +0 -34
- package/dist/kadaikodi/mocks/users.js.map +0 -1
|
@@ -1,316 +1,221 @@
|
|
|
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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { EmptyState as r } from "../../components/EmptyState.js";
|
|
5
|
+
import { useOfferings as i, useOrders as a, useProviderWorkers as o, useProviders as ee, useReviews as s, useUpdateOrderStatus as c } from "../../hooks/useKadaikodiApi.js";
|
|
6
|
+
import { formatCurrency as l } from "../../utils/formatters.js";
|
|
7
|
+
import { useEffect as te, useMemo as u, useState as ne } from "react";
|
|
8
|
+
import { Activity as re, ArrowRight as d, BarChart3 as f, Bell as p, CheckCircle as m, ChevronRight as h, Clock as g, Edit as _, Eye as v, Flame as ie, IndianRupee as y, MapPin as b, Package as x, Plus as S, Settings as C, ShoppingCart as w, Star as T, TrendingUp as E, UserCheck as ae, Users as oe } from "lucide-react";
|
|
9
|
+
import { Fragment as se, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
10
|
+
import { EmphasisPanel as ce, NextSteps as k, PagePurpose as le } from "@burdenoff/fe-libs/ui";
|
|
10
11
|
//#region src/kadaikodi/pages/cart-owner/CartOwnerDashboard.tsx
|
|
11
|
-
var
|
|
12
|
-
totalRevenue: 45230,
|
|
13
|
-
dailyRevenue: 1850,
|
|
14
|
-
ordersToday: 23,
|
|
15
|
-
totalOrders: 1247,
|
|
16
|
-
activeOfferings: 68,
|
|
17
|
-
averageOrderValue: 80,
|
|
18
|
-
customerCount: 342,
|
|
19
|
-
rating: 4.2
|
|
20
|
-
}, P = [
|
|
21
|
-
{
|
|
22
|
-
id: "ORD-001",
|
|
23
|
-
customerName: "Rahul Sharma",
|
|
24
|
-
items: [
|
|
25
|
-
"Masala Dosa",
|
|
26
|
-
"Filter Coffee",
|
|
27
|
-
"Vada"
|
|
28
|
-
],
|
|
29
|
-
total: 180,
|
|
30
|
-
status: "preparing",
|
|
31
|
-
timestamp: "10 mins ago",
|
|
32
|
-
priority: "urgent"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: "ORD-002",
|
|
36
|
-
customerName: "Priya Patel",
|
|
37
|
-
items: ["Idli Sambar (2)", "Coconut Chutney"],
|
|
38
|
-
total: 80,
|
|
39
|
-
status: "ready",
|
|
40
|
-
timestamp: "15 mins ago",
|
|
41
|
-
priority: "normal"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "ORD-003",
|
|
45
|
-
customerName: "Amit Kumar",
|
|
46
|
-
items: [
|
|
47
|
-
"Rava Dosa",
|
|
48
|
-
"Sambar",
|
|
49
|
-
"Coffee"
|
|
50
|
-
],
|
|
51
|
-
total: 160,
|
|
52
|
-
status: "delivered",
|
|
53
|
-
timestamp: "25 mins ago",
|
|
54
|
-
priority: "normal"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: "ORD-004",
|
|
58
|
-
customerName: "Sneha Singh",
|
|
59
|
-
items: ["Upma", "Coffee"],
|
|
60
|
-
total: 60,
|
|
61
|
-
status: "pending",
|
|
62
|
-
timestamp: "2 mins ago",
|
|
63
|
-
priority: "urgent"
|
|
64
|
-
}
|
|
65
|
-
], F = [
|
|
66
|
-
{
|
|
67
|
-
name: "Masala Dosa",
|
|
68
|
-
quantity: 245,
|
|
69
|
-
revenue: 19600
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: "Filter Coffee",
|
|
73
|
-
quantity: 312,
|
|
74
|
-
revenue: 9360
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "Idli Sambar",
|
|
78
|
-
quantity: 189,
|
|
79
|
-
revenue: 7560
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: "Vada",
|
|
83
|
-
quantity: 156,
|
|
84
|
-
revenue: 4680
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: "Rava Dosa",
|
|
88
|
-
quantity: 98,
|
|
89
|
-
revenue: 8820
|
|
90
|
-
}
|
|
91
|
-
], I = [
|
|
92
|
-
{
|
|
93
|
-
name: "Ramesh Kumar",
|
|
94
|
-
role: "Chef",
|
|
95
|
-
status: "active"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: "Priya Sharma",
|
|
99
|
-
role: "Server",
|
|
100
|
-
status: "active"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: "Amit Patel",
|
|
104
|
-
role: "Delivery",
|
|
105
|
-
status: "on-break"
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "Sneha Reddy",
|
|
109
|
-
role: "Manager",
|
|
110
|
-
status: "active"
|
|
111
|
-
}
|
|
112
|
-
], L = [
|
|
113
|
-
{
|
|
114
|
-
id: "1",
|
|
115
|
-
message: "New order #ORD-004 received",
|
|
116
|
-
type: "info",
|
|
117
|
-
time: "2 min ago"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: "2",
|
|
121
|
-
message: "Low stock alert: Vada batter running low",
|
|
122
|
-
type: "warning",
|
|
123
|
-
time: "15 min ago"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
id: "3",
|
|
127
|
-
message: "Order #ORD-003 delivered successfully",
|
|
128
|
-
type: "success",
|
|
129
|
-
time: "25 min ago"
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
id: "4",
|
|
133
|
-
message: "New 5-star review from Priya Patel",
|
|
134
|
-
type: "success",
|
|
135
|
-
time: "1 hr ago"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
id: "5",
|
|
139
|
-
message: "Peak hours approaching (12-2 PM)",
|
|
140
|
-
type: "warning",
|
|
141
|
-
time: "1 hr ago"
|
|
142
|
-
}
|
|
143
|
-
], R = i.orderTrends.slice(0, 7), z = () => {
|
|
12
|
+
var A = () => {
|
|
144
13
|
let e = (/* @__PURE__ */ new Date()).getHours();
|
|
145
14
|
return e < 12 ? "Good Morning" : e < 17 ? "Good Afternoon" : "Good Evening";
|
|
146
|
-
},
|
|
15
|
+
}, j = {
|
|
147
16
|
pending: "bg-status-error-bg-subtle text-status-error-text",
|
|
17
|
+
confirmed: "bg-[var(--color-accent-soft)] text-text-primary",
|
|
148
18
|
preparing: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
149
19
|
ready: "bg-[var(--color-accent-soft)] text-text-primary",
|
|
150
20
|
delivered: "bg-status-success-bg-subtle text-status-success-text",
|
|
151
21
|
cancelled: "bg-bg-sunken text-text-secondary"
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
22
|
+
}, M = () => {
|
|
23
|
+
let e = /* @__PURE__ */ new Date();
|
|
24
|
+
return e.setHours(0, 0, 0, 0), e;
|
|
25
|
+
}, N = (e) => {
|
|
26
|
+
let t = Math.floor((Date.now() - new Date(e).getTime()) / 6e4);
|
|
27
|
+
return t < 1 ? "Just now" : t < 60 ? `${t} min ago` : t < 1440 ? `${Math.floor(t / 60)} hr ago` : new Date(e).toLocaleDateString("en-IN", {
|
|
28
|
+
day: "2-digit",
|
|
29
|
+
month: "short"
|
|
30
|
+
});
|
|
31
|
+
}, P = () => {
|
|
32
|
+
let { navigateTo: P, currentUser: F } = e(), { data: I = [], isLoading: L } = ee(), R = u(() => I.find((e) => e.ownerId === F?.id) ?? I[0], [I, F?.id]), z = R?.id, { data: B = [] } = a({ providerId: z }), { data: V = [] } = i(z), { data: H = [] } = s(z ?? ""), { data: U = [] } = o(z), ue = c(), W = F?.firstName ?? F?.name?.split(" ")[0] ?? "", [G, K] = ne(!0);
|
|
33
|
+
te(() => {
|
|
34
|
+
R && K(R.isOpen);
|
|
35
|
+
}, [R]);
|
|
36
|
+
let q = u(() => {
|
|
37
|
+
let e = M(), t = B.filter((e) => e.status === "delivered"), n = B.filter((t) => new Date(t.orderDate) >= e), r = t.filter((t) => new Date(t.orderDate) >= e), i = t.reduce((e, t) => e + t.total, 0), a = r.reduce((e, t) => e + t.total, 0), o = t.length > 0 ? Math.round(i / t.length) : Math.round(R?.averageOrderValue ?? 0);
|
|
38
|
+
return {
|
|
39
|
+
totalRevenue: i,
|
|
40
|
+
dailyRevenue: a,
|
|
41
|
+
ordersToday: n.length,
|
|
42
|
+
totalOrders: B.length,
|
|
43
|
+
activeOfferings: V.filter((e) => e.isAvailable).length,
|
|
44
|
+
averageOrderValue: o,
|
|
45
|
+
rating: R?.rating ?? 0,
|
|
46
|
+
totalRatings: R?.totalRatings ?? 0
|
|
47
|
+
};
|
|
48
|
+
}, [
|
|
49
|
+
B,
|
|
50
|
+
V,
|
|
51
|
+
R
|
|
52
|
+
]), J = u(() => [...B].sort((e, t) => new Date(t.orderDate).getTime() - new Date(e.orderDate).getTime()).slice(0, 4), [B]), Y = u(() => {
|
|
53
|
+
let e = [];
|
|
54
|
+
for (let t = 6; t >= 0; t--) {
|
|
55
|
+
let n = M();
|
|
56
|
+
n.setDate(n.getDate() - t);
|
|
57
|
+
let r = new Date(n);
|
|
58
|
+
r.setDate(n.getDate() + 1);
|
|
59
|
+
let i = B.filter((e) => {
|
|
60
|
+
let t = new Date(e.orderDate);
|
|
61
|
+
return t >= n && t < r;
|
|
62
|
+
});
|
|
63
|
+
e.push({
|
|
64
|
+
date: n.toISOString(),
|
|
65
|
+
orders: i.length,
|
|
66
|
+
revenue: i.filter((e) => e.status === "delivered").reduce((e, t) => e + t.total, 0)
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return e;
|
|
70
|
+
}, [B]), X = u(() => {
|
|
71
|
+
let e = /* @__PURE__ */ new Map();
|
|
72
|
+
return B.forEach((t) => t.items.forEach((t) => {
|
|
73
|
+
let n = e.get(t.name) ?? {
|
|
74
|
+
quantity: 0,
|
|
75
|
+
revenue: 0
|
|
76
|
+
};
|
|
77
|
+
n.quantity += t.quantity, n.revenue += t.price * t.quantity, e.set(t.name, n);
|
|
78
|
+
})), [...e.entries()].map(([e, t]) => ({
|
|
79
|
+
name: e,
|
|
80
|
+
...t
|
|
81
|
+
})).sort((e, t) => t.revenue - e.revenue).slice(0, 5);
|
|
82
|
+
}, [B]), de = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", { weekday: "long" }).toLowerCase(), Z = R?.businessHours?.[de], Q = Z && Z.isOpen ? `${Z.open} - ${Z.close}` : null, fe = R?.location?.address?.trim() || null, $ = (e, t) => {
|
|
83
|
+
ue.mutate({
|
|
84
|
+
id: e,
|
|
85
|
+
status: t
|
|
86
|
+
});
|
|
176
87
|
};
|
|
177
|
-
return /* @__PURE__ */
|
|
178
|
-
title:
|
|
179
|
-
z(),
|
|
180
|
-
", ",
|
|
181
|
-
/* @__PURE__ */ O("span", {
|
|
182
|
-
className: "text-text-secondary font-normal",
|
|
183
|
-
children: "Rajesh"
|
|
184
|
-
})
|
|
185
|
-
] }),
|
|
88
|
+
return L ? /* @__PURE__ */ D(n, {
|
|
89
|
+
title: A(),
|
|
186
90
|
description: "Manage your service provider operations",
|
|
187
|
-
|
|
91
|
+
children: /* @__PURE__ */ D("div", {
|
|
92
|
+
className: "flex items-center justify-center py-24",
|
|
93
|
+
children: /* @__PURE__ */ D("div", { className: "h-10 w-10 animate-spin rounded-full border-b-2 border-foreground" })
|
|
94
|
+
})
|
|
95
|
+
}) : R ? /* @__PURE__ */ D(n, {
|
|
96
|
+
title: /* @__PURE__ */ O("span", { children: [A(), W && /* @__PURE__ */ O(se, { children: [", ", /* @__PURE__ */ D("span", {
|
|
97
|
+
className: "text-text-secondary font-normal",
|
|
98
|
+
children: W
|
|
99
|
+
})] })] }),
|
|
100
|
+
description: R.name,
|
|
101
|
+
actions: /* @__PURE__ */ O("button", {
|
|
188
102
|
type: "button",
|
|
189
|
-
onClick: () =>
|
|
103
|
+
onClick: () => P("/cart-owner/orders"),
|
|
190
104
|
className: "inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent/80 transition-colors",
|
|
191
|
-
children: ["View All Orders", /* @__PURE__ */
|
|
105
|
+
children: ["View All Orders", /* @__PURE__ */ D(d, { className: "h-4 w-4" })]
|
|
192
106
|
}),
|
|
193
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ O("div", {
|
|
194
108
|
className: "space-y-6",
|
|
195
109
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ D(le, { children: "Run your mobile cart business from one screen — flip your service open or closed, watch today's revenue and orders roll in, and jump to your menu, staff, or order queue. Open your service and set up your offerings to start taking orders." }),
|
|
111
|
+
/* @__PURE__ */ D(k, {
|
|
198
112
|
storageKey: "kadaikodi-cartowner-dashboard",
|
|
199
113
|
steps: [
|
|
200
114
|
{
|
|
201
115
|
id: "offerings",
|
|
202
116
|
label: "Set up your offerings",
|
|
203
117
|
description: "Add the dishes and items customers can order from your cart.",
|
|
204
|
-
onClick: () =>
|
|
118
|
+
onClick: () => P("/cart-owner/inventory")
|
|
205
119
|
},
|
|
206
120
|
{
|
|
207
121
|
id: "service-config",
|
|
208
122
|
label: "Configure service & hours",
|
|
209
123
|
description: "Define your operating hours, location and service area.",
|
|
210
|
-
onClick: () =>
|
|
124
|
+
onClick: () => P("/cart-owner/service-config")
|
|
211
125
|
},
|
|
212
126
|
{
|
|
213
127
|
id: "orders",
|
|
214
128
|
label: "Manage incoming orders",
|
|
215
129
|
description: "Accept, prepare and fulfil customer orders in real time.",
|
|
216
|
-
onClick: () =>
|
|
130
|
+
onClick: () => P("/cart-owner/orders")
|
|
217
131
|
}
|
|
218
132
|
]
|
|
219
133
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
className: t("p-4 rounded-lg border-l-4", G
|
|
222
|
-
children: /* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ D("div", {
|
|
135
|
+
className: t("p-4 rounded-lg border-l-4", G ? "border-status-success-text bg-status-success-bg-subtle" : "border-status-error-text bg-status-error-bg-subtle"),
|
|
136
|
+
children: /* @__PURE__ */ O("div", {
|
|
223
137
|
className: "flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
138
|
+
children: [/* @__PURE__ */ O("div", {
|
|
225
139
|
className: "flex items-start gap-3",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ D("div", { className: t("w-3 h-3 rounded-full mt-1 shrink-0", G ? "bg-status-success-text" : "bg-status-error-text") }), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ O("h3", {
|
|
227
141
|
className: "font-semibold text-text-primary text-sm",
|
|
228
|
-
children: ["Service Status: ", G
|
|
229
|
-
}), /* @__PURE__ */
|
|
142
|
+
children: ["Service Status: ", G ? "Open" : "Closed"]
|
|
143
|
+
}), /* @__PURE__ */ O("div", {
|
|
230
144
|
className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4 mt-1 text-xs text-text-secondary",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ O("span", {
|
|
232
146
|
className: "flex items-center gap-1",
|
|
233
|
-
children: [/* @__PURE__ */
|
|
234
|
-
}), /* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ D(b, { className: "h-3 w-3 shrink-0" }), fe ?? "Location not set"]
|
|
148
|
+
}), Q && /* @__PURE__ */ O("span", {
|
|
235
149
|
className: "flex items-center gap-1",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ D(g, { className: "h-3 w-3 shrink-0" }), Q]
|
|
237
151
|
})]
|
|
238
152
|
})] })]
|
|
239
|
-
}), /* @__PURE__ */
|
|
153
|
+
}), /* @__PURE__ */ O("div", {
|
|
240
154
|
className: "flex gap-2",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ O("button", {
|
|
242
156
|
type: "button",
|
|
243
|
-
onClick: () =>
|
|
157
|
+
onClick: () => P("/cart-owner/settings"),
|
|
244
158
|
className: "inline-flex items-center gap-1 rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
245
|
-
children: [/* @__PURE__ */
|
|
246
|
-
}), /* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ D(b, { className: "h-3 w-3" }), "Update Location"]
|
|
160
|
+
}), /* @__PURE__ */ D("button", {
|
|
247
161
|
type: "button",
|
|
248
|
-
onClick: () =>
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
isOpen: !e.isOpen
|
|
252
|
-
});
|
|
253
|
-
},
|
|
254
|
-
className: t("inline-flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", G.isOpen ? "bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle" : "bg-status-success-bg-subtle text-status-success-text hover:bg-status-success-bg-subtle"),
|
|
255
|
-
children: G.isOpen ? "Close Service" : "Open Service"
|
|
162
|
+
onClick: () => K((e) => !e),
|
|
163
|
+
className: t("inline-flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", G ? "bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle" : "bg-status-success-bg-subtle text-status-success-text hover:bg-status-success-bg-subtle"),
|
|
164
|
+
children: G ? "Close Service" : "Open Service"
|
|
256
165
|
})]
|
|
257
166
|
})]
|
|
258
167
|
})
|
|
259
168
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ O(ce, { children: [/* @__PURE__ */ D("h2", {
|
|
261
170
|
className: "text-base font-semibold text-text-primary mb-3",
|
|
262
171
|
children: "Today's Performance"
|
|
263
|
-
}), /* @__PURE__ */
|
|
172
|
+
}), /* @__PURE__ */ D("div", {
|
|
264
173
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
265
174
|
children: [
|
|
266
175
|
{
|
|
267
176
|
label: "Daily Revenue",
|
|
268
|
-
value:
|
|
269
|
-
icon:
|
|
270
|
-
|
|
271
|
-
trendUp: !0
|
|
177
|
+
value: l(q.dailyRevenue, { minimumFractionDigits: 0 }),
|
|
178
|
+
icon: y,
|
|
179
|
+
sublabel: null
|
|
272
180
|
},
|
|
273
181
|
{
|
|
274
182
|
label: "Orders Today",
|
|
275
|
-
value: String(
|
|
276
|
-
icon:
|
|
277
|
-
|
|
278
|
-
trendUp: !0
|
|
183
|
+
value: String(q.ordersToday),
|
|
184
|
+
icon: w,
|
|
185
|
+
sublabel: null
|
|
279
186
|
},
|
|
280
187
|
{
|
|
281
188
|
label: "Avg Order Value",
|
|
282
|
-
value:
|
|
283
|
-
icon:
|
|
284
|
-
|
|
285
|
-
trendUp: !0
|
|
189
|
+
value: l(q.averageOrderValue, { minimumFractionDigits: 0 }),
|
|
190
|
+
icon: E,
|
|
191
|
+
sublabel: null
|
|
286
192
|
},
|
|
287
193
|
{
|
|
288
194
|
label: "Service Rating",
|
|
289
|
-
value:
|
|
290
|
-
icon:
|
|
291
|
-
|
|
292
|
-
trendUp: !0
|
|
195
|
+
value: q.rating.toFixed(1),
|
|
196
|
+
icon: T,
|
|
197
|
+
sublabel: q.totalRatings > 0 ? `Based on ${q.totalRatings} ${q.totalRatings === 1 ? "rating" : "ratings"}` : "No ratings yet"
|
|
293
198
|
}
|
|
294
199
|
].map((e) => {
|
|
295
200
|
let t = e.icon;
|
|
296
|
-
return /* @__PURE__ */
|
|
201
|
+
return /* @__PURE__ */ O("div", {
|
|
297
202
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
298
203
|
children: [
|
|
299
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ O("div", {
|
|
300
205
|
className: "flex items-center justify-between",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ D("div", {
|
|
302
207
|
className: "rounded-md bg-accent p-2",
|
|
303
|
-
children: /* @__PURE__ */
|
|
304
|
-
}), /* @__PURE__ */
|
|
305
|
-
className: "
|
|
306
|
-
children:
|
|
208
|
+
children: /* @__PURE__ */ D(t, { className: "h-5 w-5 text-text-secondary" })
|
|
209
|
+
}), e.sublabel && /* @__PURE__ */ D("span", {
|
|
210
|
+
className: "text-xs text-text-secondary",
|
|
211
|
+
children: e.sublabel
|
|
307
212
|
})]
|
|
308
213
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ D("p", {
|
|
310
215
|
className: "mt-3 text-2xl font-bold text-text-primary",
|
|
311
216
|
children: e.value
|
|
312
217
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ D("p", {
|
|
314
219
|
className: "mt-1 text-sm text-text-secondary",
|
|
315
220
|
children: e.label
|
|
316
221
|
})
|
|
@@ -318,182 +223,177 @@ var N = {
|
|
|
318
223
|
}, e.label);
|
|
319
224
|
})
|
|
320
225
|
})] }),
|
|
321
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ O("div", {
|
|
322
227
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ O("div", {
|
|
324
229
|
className: "lg:col-span-2 space-y-6",
|
|
325
230
|
children: [
|
|
326
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("h3", {
|
|
327
232
|
className: "text-base font-semibold mb-3 text-text-primary",
|
|
328
233
|
children: "Quick Actions"
|
|
329
|
-
}), /* @__PURE__ */
|
|
234
|
+
}), /* @__PURE__ */ D("div", {
|
|
330
235
|
className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3",
|
|
331
236
|
children: [
|
|
332
237
|
{
|
|
333
238
|
label: "Service Config",
|
|
334
|
-
icon:
|
|
239
|
+
icon: C,
|
|
335
240
|
color: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
336
241
|
path: "/cart-owner/service-config"
|
|
337
242
|
},
|
|
338
243
|
{
|
|
339
244
|
label: "Manage Offerings",
|
|
340
|
-
icon:
|
|
245
|
+
icon: x,
|
|
341
246
|
color: "bg-[var(--color-accent-soft)] text-text-primary",
|
|
342
247
|
path: "/cart-owner/inventory"
|
|
343
248
|
},
|
|
344
249
|
{
|
|
345
250
|
label: "View Orders",
|
|
346
|
-
icon:
|
|
251
|
+
icon: w,
|
|
347
252
|
color: "bg-status-success-bg-subtle text-status-success-text",
|
|
348
253
|
path: "/cart-owner/orders"
|
|
349
254
|
},
|
|
350
255
|
{
|
|
351
256
|
label: "Analytics",
|
|
352
|
-
icon:
|
|
257
|
+
icon: f,
|
|
353
258
|
color: "bg-accent-purple-subtle text-text-primary",
|
|
354
259
|
path: "/cart-owner/analytics"
|
|
355
260
|
},
|
|
356
261
|
{
|
|
357
262
|
label: "Staff",
|
|
358
|
-
icon:
|
|
263
|
+
icon: ae,
|
|
359
264
|
color: "bg-accent-purple-subtle text-text-primary",
|
|
360
265
|
path: "/cart-owner/staff"
|
|
361
266
|
}
|
|
362
267
|
].map((e) => {
|
|
363
268
|
let n = e.icon;
|
|
364
|
-
return /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ O("button", {
|
|
365
270
|
type: "button",
|
|
366
|
-
onClick: () =>
|
|
271
|
+
onClick: () => P(e.path),
|
|
367
272
|
className: t("flex flex-col items-center gap-2 rounded-lg p-4 transition-colors hover:opacity-80", e.color),
|
|
368
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ D(n, { className: "h-5 w-5" }), /* @__PURE__ */ D("span", {
|
|
369
274
|
className: "text-xs font-medium text-center",
|
|
370
275
|
children: e.label
|
|
371
276
|
})]
|
|
372
277
|
}, e.label);
|
|
373
278
|
})
|
|
374
279
|
})] }),
|
|
375
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ O("div", {
|
|
376
281
|
className: "flex items-center justify-between mb-3",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
378
283
|
className: "text-base font-semibold text-text-primary",
|
|
379
284
|
children: "Recent Orders"
|
|
380
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ D("button", {
|
|
381
286
|
type: "button",
|
|
382
|
-
onClick: () =>
|
|
287
|
+
onClick: () => P("/cart-owner/orders"),
|
|
383
288
|
className: "text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
384
289
|
children: "View All Orders"
|
|
385
290
|
})]
|
|
386
|
-
}), /* @__PURE__ */
|
|
291
|
+
}), J.length === 0 ? /* @__PURE__ */ D("div", {
|
|
292
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-8 text-center text-sm text-text-secondary shadow-sm",
|
|
293
|
+
children: "No orders yet. New orders from customers will appear here."
|
|
294
|
+
}) : /* @__PURE__ */ D("div", {
|
|
387
295
|
className: "space-y-3",
|
|
388
|
-
children:
|
|
296
|
+
children: J.map((e) => /* @__PURE__ */ D("div", {
|
|
389
297
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
390
|
-
children: /* @__PURE__ */
|
|
298
|
+
children: /* @__PURE__ */ O("div", {
|
|
391
299
|
className: "flex flex-col lg:flex-row lg:items-start lg:justify-between gap-3",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ O("div", {
|
|
393
301
|
className: "flex-1 min-w-0",
|
|
394
302
|
children: [
|
|
395
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ O("div", {
|
|
396
304
|
className: "flex flex-wrap items-center gap-2 mb-1",
|
|
397
|
-
children: [
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
children: e.status
|
|
405
|
-
}),
|
|
406
|
-
e.priority === "urgent" && /* @__PURE__ */ O(s, { className: "h-4 w-4 text-status-error-text" })
|
|
407
|
-
]
|
|
408
|
-
}),
|
|
409
|
-
/* @__PURE__ */ k("p", {
|
|
410
|
-
className: "text-xs text-text-secondary mb-1",
|
|
411
|
-
children: ["Customer: ", e.customerName]
|
|
305
|
+
children: [/* @__PURE__ */ O("h4", {
|
|
306
|
+
className: "font-semibold text-text-primary text-sm",
|
|
307
|
+
children: ["#", e.id.slice(0, 8)]
|
|
308
|
+
}), /* @__PURE__ */ D("span", {
|
|
309
|
+
className: t("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium capitalize", j[e.status] || "bg-bg-sunken text-text-secondary"),
|
|
310
|
+
children: e.status
|
|
311
|
+
})]
|
|
412
312
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
313
|
+
e.items.length > 0 && /* @__PURE__ */ O("p", {
|
|
414
314
|
className: "text-xs text-text-secondary mb-1 truncate",
|
|
415
|
-
children: ["Items: ", e.items.join(", ")]
|
|
315
|
+
children: ["Items: ", e.items.map((e) => e.name).join(", ")]
|
|
416
316
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ O("div", {
|
|
418
318
|
className: "flex flex-wrap items-center gap-3 text-xs text-text-secondary",
|
|
419
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ D("span", {
|
|
420
320
|
className: "font-semibold text-text-primary",
|
|
421
|
-
children:
|
|
422
|
-
}), /* @__PURE__ */
|
|
321
|
+
children: l(e.total, { minimumFractionDigits: 0 })
|
|
322
|
+
}), /* @__PURE__ */ O("span", {
|
|
423
323
|
className: "flex items-center gap-1",
|
|
424
|
-
children: [/* @__PURE__ */
|
|
324
|
+
children: [/* @__PURE__ */ D(g, { className: "h-3 w-3" }), N(e.orderDate)]
|
|
425
325
|
})]
|
|
426
326
|
})
|
|
427
327
|
]
|
|
428
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ O("div", {
|
|
429
329
|
className: "flex gap-2",
|
|
430
330
|
children: [
|
|
431
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ O("button", {
|
|
432
332
|
type: "button",
|
|
433
|
-
onClick: () =>
|
|
333
|
+
onClick: () => P("/cart-owner/orders"),
|
|
434
334
|
className: "inline-flex items-center gap-1 rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
335
|
+
children: [/* @__PURE__ */ D(v, { className: "h-3 w-3" }), "View"]
|
|
436
336
|
}),
|
|
437
|
-
e.status === "pending" && /* @__PURE__ */
|
|
337
|
+
e.status === "pending" && /* @__PURE__ */ O("button", {
|
|
438
338
|
type: "button",
|
|
439
|
-
onClick: () =>
|
|
339
|
+
onClick: () => $(e.id, "CONFIRMED"),
|
|
440
340
|
className: "inline-flex items-center gap-1 rounded-md bg-status-success-bg-subtle px-3 py-1.5 text-xs font-medium text-status-success-text hover:bg-status-success-bg-subtle transition-colors",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ D(m, { className: "h-3 w-3" }), "Accept"]
|
|
442
342
|
}),
|
|
443
|
-
e.status === "preparing" && /* @__PURE__ */
|
|
343
|
+
(e.status === "confirmed" || e.status === "preparing") && /* @__PURE__ */ O("button", {
|
|
444
344
|
type: "button",
|
|
445
|
-
onClick: () =>
|
|
345
|
+
onClick: () => $(e.id, "READY"),
|
|
446
346
|
className: "inline-flex items-center gap-1 rounded-md bg-[var(--color-accent-soft)] px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-[var(--color-accent-soft)] transition-colors",
|
|
447
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ D(m, { className: "h-3 w-3" }), "Mark Ready"]
|
|
448
348
|
})
|
|
449
349
|
]
|
|
450
350
|
})]
|
|
451
351
|
})
|
|
452
352
|
}, e.id))
|
|
453
353
|
})] }),
|
|
454
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ O("div", {
|
|
455
355
|
className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
|
|
456
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ O("div", {
|
|
457
357
|
className: "flex items-center justify-between border-b border-border-subtle px-5 py-4",
|
|
458
|
-
children: [/* @__PURE__ */
|
|
358
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
459
359
|
className: "text-base font-semibold text-text-primary",
|
|
460
360
|
children: "Revenue (Last 7 Days)"
|
|
461
|
-
}), /* @__PURE__ */
|
|
361
|
+
}), /* @__PURE__ */ D("button", {
|
|
462
362
|
type: "button",
|
|
463
|
-
onClick: () =>
|
|
363
|
+
onClick: () => P("/cart-owner/analytics"),
|
|
464
364
|
className: "text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
465
365
|
children: "View Analytics"
|
|
466
366
|
})]
|
|
467
|
-
}), /* @__PURE__ */
|
|
367
|
+
}), /* @__PURE__ */ D("div", {
|
|
468
368
|
className: "overflow-x-auto",
|
|
469
|
-
children: /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ O("table", {
|
|
470
370
|
className: "w-full text-sm",
|
|
471
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ D("thead", { children: /* @__PURE__ */ O("tr", {
|
|
472
372
|
className: "border-b border-border-subtle",
|
|
473
373
|
children: [
|
|
474
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ D("th", {
|
|
475
375
|
className: "px-5 py-3 text-left font-medium text-text-secondary",
|
|
476
376
|
children: "Date"
|
|
477
377
|
}),
|
|
478
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ D("th", {
|
|
479
379
|
className: "px-5 py-3 text-right font-medium text-text-secondary",
|
|
480
380
|
children: "Orders"
|
|
481
381
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ D("th", {
|
|
483
383
|
className: "px-5 py-3 text-right font-medium text-text-secondary",
|
|
484
384
|
children: "Revenue"
|
|
485
385
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ D("th", {
|
|
487
387
|
className: "px-5 py-3 text-left font-medium text-text-secondary",
|
|
488
388
|
children: "Trend"
|
|
489
389
|
})
|
|
490
390
|
]
|
|
491
|
-
}) }), /* @__PURE__ */
|
|
492
|
-
let
|
|
493
|
-
return /* @__PURE__ */
|
|
391
|
+
}) }), /* @__PURE__ */ D("tbody", { children: Y.map((e) => {
|
|
392
|
+
let t = Math.max(...Y.map((e) => e.revenue), 1), n = e.revenue / t * 100;
|
|
393
|
+
return /* @__PURE__ */ O("tr", {
|
|
494
394
|
className: "border-b border-border-subtle last:border-0",
|
|
495
395
|
children: [
|
|
496
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ D("td", {
|
|
497
397
|
className: "px-5 py-3 text-text-primary text-xs",
|
|
498
398
|
children: new Date(e.date).toLocaleDateString("en-IN", {
|
|
499
399
|
day: "2-digit",
|
|
@@ -501,21 +401,21 @@ var N = {
|
|
|
501
401
|
weekday: "short"
|
|
502
402
|
})
|
|
503
403
|
}),
|
|
504
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ D("td", {
|
|
505
405
|
className: "px-5 py-3 text-right text-text-primary",
|
|
506
406
|
children: e.orders
|
|
507
407
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ D("td", {
|
|
509
409
|
className: "px-5 py-3 text-right font-medium text-text-primary",
|
|
510
|
-
children:
|
|
410
|
+
children: l(e.revenue, { minimumFractionDigits: 0 })
|
|
511
411
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ D("td", {
|
|
513
413
|
className: "px-5 py-3 w-40",
|
|
514
|
-
children: /* @__PURE__ */
|
|
414
|
+
children: /* @__PURE__ */ D("div", {
|
|
515
415
|
className: "h-4 rounded bg-bg-sunken overflow-hidden",
|
|
516
|
-
children: /* @__PURE__ */
|
|
416
|
+
children: /* @__PURE__ */ D("div", {
|
|
517
417
|
className: "h-full rounded bg-[var(--color-accent-soft)]",
|
|
518
|
-
style: { width: `${
|
|
418
|
+
style: { width: `${n}%` }
|
|
519
419
|
})
|
|
520
420
|
})
|
|
521
421
|
})
|
|
@@ -525,251 +425,234 @@ var N = {
|
|
|
525
425
|
})
|
|
526
426
|
})]
|
|
527
427
|
}),
|
|
528
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ O("div", {
|
|
529
429
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
530
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
531
431
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
532
|
-
children: "
|
|
533
|
-
}), /* @__PURE__ */
|
|
432
|
+
children: "Business Summary"
|
|
433
|
+
}), /* @__PURE__ */ O("div", {
|
|
534
434
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
535
435
|
children: [
|
|
536
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ O("div", {
|
|
537
437
|
className: "text-center p-3 rounded-lg bg-bg-sunken/50",
|
|
538
|
-
children: [/* @__PURE__ */
|
|
438
|
+
children: [/* @__PURE__ */ D("div", {
|
|
539
439
|
className: "text-xl font-bold text-text-primary",
|
|
540
|
-
children:
|
|
541
|
-
}), /* @__PURE__ */
|
|
440
|
+
children: l(q.totalRevenue, { minimumFractionDigits: 0 })
|
|
441
|
+
}), /* @__PURE__ */ D("div", {
|
|
542
442
|
className: "text-xs text-text-secondary mt-1",
|
|
543
443
|
children: "Total Revenue"
|
|
544
444
|
})]
|
|
545
445
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ O("div", {
|
|
547
447
|
className: "text-center p-3 rounded-lg bg-bg-sunken/50",
|
|
548
|
-
children: [/* @__PURE__ */
|
|
448
|
+
children: [/* @__PURE__ */ D("div", {
|
|
549
449
|
className: "text-xl font-bold text-text-primary",
|
|
550
|
-
children:
|
|
551
|
-
}), /* @__PURE__ */
|
|
450
|
+
children: q.totalOrders
|
|
451
|
+
}), /* @__PURE__ */ D("div", {
|
|
552
452
|
className: "text-xs text-text-secondary mt-1",
|
|
553
453
|
children: "Total Orders"
|
|
554
454
|
})]
|
|
555
455
|
}),
|
|
556
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ O("div", {
|
|
557
457
|
className: "text-center p-3 rounded-lg bg-bg-sunken/50",
|
|
558
|
-
children: [/* @__PURE__ */
|
|
458
|
+
children: [/* @__PURE__ */ D("div", {
|
|
559
459
|
className: "text-xl font-bold text-text-primary",
|
|
560
|
-
children:
|
|
561
|
-
}), /* @__PURE__ */
|
|
460
|
+
children: l(q.averageOrderValue, { minimumFractionDigits: 0 })
|
|
461
|
+
}), /* @__PURE__ */ D("div", {
|
|
562
462
|
className: "text-xs text-text-secondary mt-1",
|
|
563
|
-
children: "
|
|
463
|
+
children: "Avg Order Value"
|
|
564
464
|
})]
|
|
565
465
|
})
|
|
566
466
|
]
|
|
567
467
|
})]
|
|
568
468
|
})
|
|
569
469
|
]
|
|
570
|
-
}), /* @__PURE__ */
|
|
470
|
+
}), /* @__PURE__ */ O("div", {
|
|
571
471
|
className: "space-y-6",
|
|
572
472
|
children: [
|
|
573
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ O("div", {
|
|
574
474
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
575
|
-
children: [/* @__PURE__ */
|
|
475
|
+
children: [/* @__PURE__ */ D("div", {
|
|
576
476
|
className: "flex items-center justify-between mb-4",
|
|
577
|
-
children:
|
|
477
|
+
children: /* @__PURE__ */ O("h3", {
|
|
578
478
|
className: "text-base font-semibold text-text-primary flex items-center gap-2",
|
|
579
|
-
children: [/* @__PURE__ */
|
|
580
|
-
})
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
}), /* @__PURE__ */ O("div", {
|
|
585
|
-
className: "space-y-3",
|
|
586
|
-
children: L.map((e) => /* @__PURE__ */ k("div", {
|
|
587
|
-
className: "flex items-start gap-2",
|
|
588
|
-
children: [/* @__PURE__ */ O(o, { className: t("h-4 w-4 mt-0.5 shrink-0", H[e.type]) }), /* @__PURE__ */ k("div", {
|
|
589
|
-
className: "min-w-0",
|
|
590
|
-
children: [/* @__PURE__ */ O("p", {
|
|
591
|
-
className: "text-xs text-text-primary leading-tight",
|
|
592
|
-
children: e.message
|
|
593
|
-
}), /* @__PURE__ */ O("p", {
|
|
594
|
-
className: "text-[10px] text-text-secondary mt-0.5",
|
|
595
|
-
children: e.time
|
|
596
|
-
})]
|
|
597
|
-
})]
|
|
598
|
-
}, e.id))
|
|
479
|
+
children: [/* @__PURE__ */ D(p, { className: "h-4 w-4" }), "Notifications"]
|
|
480
|
+
})
|
|
481
|
+
}), /* @__PURE__ */ D("p", {
|
|
482
|
+
className: "text-xs text-text-secondary",
|
|
483
|
+
children: "You have no notifications yet. Order and review alerts will appear here."
|
|
599
484
|
})]
|
|
600
485
|
}),
|
|
601
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ O("div", {
|
|
602
487
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
603
|
-
children: [/* @__PURE__ */
|
|
488
|
+
children: [/* @__PURE__ */ O("h3", {
|
|
604
489
|
className: "text-base font-semibold text-text-primary mb-4 flex items-center gap-2",
|
|
605
|
-
children: [/* @__PURE__ */
|
|
606
|
-
}), /* @__PURE__ */
|
|
490
|
+
children: [/* @__PURE__ */ D(ie, { className: "h-4 w-4 text-status-warning-text" }), "Top Selling Items"]
|
|
491
|
+
}), X.length === 0 ? /* @__PURE__ */ D("p", {
|
|
492
|
+
className: "text-xs text-text-secondary",
|
|
493
|
+
children: "No sales yet. Your best sellers will appear here once orders come in."
|
|
494
|
+
}) : /* @__PURE__ */ D("div", {
|
|
607
495
|
className: "space-y-3",
|
|
608
|
-
children:
|
|
496
|
+
children: X.map((e, t) => /* @__PURE__ */ O("div", {
|
|
609
497
|
className: "flex items-center justify-between",
|
|
610
|
-
children: [/* @__PURE__ */
|
|
498
|
+
children: [/* @__PURE__ */ O("div", {
|
|
611
499
|
className: "flex items-center gap-2 min-w-0",
|
|
612
|
-
children: [/* @__PURE__ */
|
|
500
|
+
children: [/* @__PURE__ */ D("span", {
|
|
613
501
|
className: "text-sm font-bold text-text-secondary w-5",
|
|
614
502
|
children: t + 1
|
|
615
|
-
}), /* @__PURE__ */
|
|
503
|
+
}), /* @__PURE__ */ O("div", {
|
|
616
504
|
className: "min-w-0",
|
|
617
|
-
children: [/* @__PURE__ */
|
|
505
|
+
children: [/* @__PURE__ */ D("p", {
|
|
618
506
|
className: "text-xs font-medium text-text-primary truncate",
|
|
619
507
|
children: e.name
|
|
620
|
-
}), /* @__PURE__ */
|
|
508
|
+
}), /* @__PURE__ */ O("p", {
|
|
621
509
|
className: "text-[10px] text-text-secondary",
|
|
622
510
|
children: [e.quantity, " sold"]
|
|
623
511
|
})]
|
|
624
512
|
})]
|
|
625
|
-
}), /* @__PURE__ */
|
|
513
|
+
}), /* @__PURE__ */ D("span", {
|
|
626
514
|
className: "text-xs font-semibold text-text-primary",
|
|
627
|
-
children:
|
|
515
|
+
children: l(e.revenue, { minimumFractionDigits: 0 })
|
|
628
516
|
})]
|
|
629
517
|
}, e.name))
|
|
630
518
|
})]
|
|
631
519
|
}),
|
|
632
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ O("div", {
|
|
633
521
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
634
|
-
children: [/* @__PURE__ */
|
|
522
|
+
children: [/* @__PURE__ */ O("div", {
|
|
635
523
|
className: "flex items-center justify-between mb-4",
|
|
636
|
-
children: [/* @__PURE__ */
|
|
524
|
+
children: [/* @__PURE__ */ O("h3", {
|
|
637
525
|
className: "text-base font-semibold text-text-primary flex items-center gap-2",
|
|
638
|
-
children: [/* @__PURE__ */
|
|
639
|
-
}), /* @__PURE__ */
|
|
526
|
+
children: [/* @__PURE__ */ D(oe, { className: "h-4 w-4" }), "Staff Overview"]
|
|
527
|
+
}), /* @__PURE__ */ D("button", {
|
|
640
528
|
type: "button",
|
|
641
|
-
onClick: () =>
|
|
529
|
+
onClick: () => P("/cart-owner/staff"),
|
|
642
530
|
className: "text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
643
531
|
children: "Manage"
|
|
644
532
|
})]
|
|
645
|
-
}), /* @__PURE__ */
|
|
533
|
+
}), U.length === 0 ? /* @__PURE__ */ D("p", {
|
|
534
|
+
className: "text-xs text-text-secondary",
|
|
535
|
+
children: "No staff added yet. Invite workers and delivery partners from Staff."
|
|
536
|
+
}) : /* @__PURE__ */ D("div", {
|
|
646
537
|
className: "space-y-3",
|
|
647
|
-
children:
|
|
538
|
+
children: U.map((e) => /* @__PURE__ */ O("div", {
|
|
648
539
|
className: "flex items-center justify-between",
|
|
649
|
-
children: [/* @__PURE__ */
|
|
540
|
+
children: [/* @__PURE__ */ O("div", {
|
|
650
541
|
className: "flex items-center gap-2",
|
|
651
|
-
children: [/* @__PURE__ */
|
|
542
|
+
children: [/* @__PURE__ */ D("div", { className: t("w-2 h-2 rounded-full", e.status === "ACTIVE" ? "bg-status-success-text" : "bg-muted-foreground") }), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
652
543
|
className: "text-xs font-medium text-text-primary",
|
|
653
544
|
children: e.name
|
|
654
|
-
}), /* @__PURE__ */
|
|
655
|
-
className: "text-[10px] text-text-secondary",
|
|
656
|
-
children: e.role
|
|
545
|
+
}), /* @__PURE__ */ D("p", {
|
|
546
|
+
className: "text-[10px] text-text-secondary capitalize",
|
|
547
|
+
children: e.role.toLowerCase()
|
|
657
548
|
})] })]
|
|
658
|
-
}), /* @__PURE__ */
|
|
549
|
+
}), /* @__PURE__ */ D("span", {
|
|
659
550
|
className: "text-[10px] capitalize text-text-secondary",
|
|
660
|
-
children: e.status.
|
|
551
|
+
children: e.status.toLowerCase()
|
|
661
552
|
})]
|
|
662
|
-
}, e.
|
|
553
|
+
}, e.id))
|
|
663
554
|
})]
|
|
664
555
|
}),
|
|
665
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ O("div", {
|
|
666
557
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
667
|
-
children: [/* @__PURE__ */
|
|
558
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
668
559
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
669
560
|
children: "Quick Stats"
|
|
670
|
-
}), /* @__PURE__ */
|
|
561
|
+
}), /* @__PURE__ */ O("div", {
|
|
671
562
|
className: "space-y-3",
|
|
672
563
|
children: [
|
|
673
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ O("div", {
|
|
674
565
|
className: "flex items-center justify-between",
|
|
675
|
-
children: [/* @__PURE__ */
|
|
566
|
+
children: [/* @__PURE__ */ D("span", {
|
|
676
567
|
className: "text-xs text-text-secondary",
|
|
677
568
|
children: "Active Offerings"
|
|
678
|
-
}), /* @__PURE__ */
|
|
569
|
+
}), /* @__PURE__ */ D("span", {
|
|
679
570
|
className: "text-sm font-semibold text-text-primary",
|
|
680
|
-
children:
|
|
571
|
+
children: q.activeOfferings
|
|
681
572
|
})]
|
|
682
573
|
}),
|
|
683
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ O("div", {
|
|
684
575
|
className: "flex items-center justify-between",
|
|
685
|
-
children: [/* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ D("span", {
|
|
686
577
|
className: "text-xs text-text-secondary",
|
|
687
578
|
children: "Customer Rating"
|
|
688
|
-
}), /* @__PURE__ */
|
|
579
|
+
}), /* @__PURE__ */ O("span", {
|
|
689
580
|
className: "text-sm font-semibold text-text-primary flex items-center gap-1",
|
|
690
|
-
children: [/* @__PURE__ */
|
|
581
|
+
children: [/* @__PURE__ */ D(T, { className: "h-3 w-3 text-status-warning-text fill-status-warning-text" }), q.rating.toFixed(1)]
|
|
691
582
|
})]
|
|
692
583
|
}),
|
|
693
|
-
/* @__PURE__ */
|
|
584
|
+
/* @__PURE__ */ O("div", {
|
|
694
585
|
className: "flex items-center justify-between",
|
|
695
|
-
children: [/* @__PURE__ */
|
|
586
|
+
children: [/* @__PURE__ */ D("span", {
|
|
696
587
|
className: "text-xs text-text-secondary",
|
|
697
|
-
children: "
|
|
698
|
-
}), /* @__PURE__ */
|
|
588
|
+
children: "Reviews"
|
|
589
|
+
}), /* @__PURE__ */ D("span", {
|
|
699
590
|
className: "text-sm font-semibold text-text-primary",
|
|
700
|
-
children:
|
|
591
|
+
children: H.length
|
|
701
592
|
})]
|
|
702
593
|
})
|
|
703
594
|
]
|
|
704
595
|
})]
|
|
705
596
|
}),
|
|
706
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ O("div", {
|
|
707
598
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
708
|
-
children: [/* @__PURE__ */
|
|
599
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
709
600
|
className: "text-base font-semibold text-text-primary mb-3",
|
|
710
601
|
children: "Business Settings"
|
|
711
|
-
}), /* @__PURE__ */
|
|
602
|
+
}), /* @__PURE__ */ D("div", {
|
|
712
603
|
className: "space-y-2",
|
|
713
604
|
children: [
|
|
714
605
|
{
|
|
715
606
|
label: "Service Settings",
|
|
716
|
-
icon:
|
|
607
|
+
icon: C,
|
|
717
608
|
path: "/cart-owner/settings"
|
|
718
609
|
},
|
|
719
610
|
{
|
|
720
611
|
label: "Business Profile",
|
|
721
|
-
icon:
|
|
612
|
+
icon: _,
|
|
722
613
|
path: "/cart-owner/profile"
|
|
723
614
|
},
|
|
724
615
|
{
|
|
725
616
|
label: "Add Offerings",
|
|
726
|
-
icon:
|
|
617
|
+
icon: S,
|
|
727
618
|
path: "/cart-owner/inventory"
|
|
728
619
|
}
|
|
729
620
|
].map((e) => {
|
|
730
621
|
let t = e.icon;
|
|
731
|
-
return /* @__PURE__ */
|
|
622
|
+
return /* @__PURE__ */ O("button", {
|
|
732
623
|
type: "button",
|
|
733
|
-
onClick: () =>
|
|
624
|
+
onClick: () => P(e.path),
|
|
734
625
|
className: "w-full flex items-center justify-between rounded-md border border-border-subtle px-3 py-2 text-xs font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
735
|
-
children: [/* @__PURE__ */
|
|
626
|
+
children: [/* @__PURE__ */ O("span", {
|
|
736
627
|
className: "flex items-center gap-2",
|
|
737
|
-
children: [/* @__PURE__ */
|
|
738
|
-
}), /* @__PURE__ */
|
|
628
|
+
children: [/* @__PURE__ */ D(t, { className: "h-3.5 w-3.5" }), e.label]
|
|
629
|
+
}), /* @__PURE__ */ D(h, { className: "h-3 w-3 text-text-secondary" })]
|
|
739
630
|
}, e.label);
|
|
740
631
|
})
|
|
741
632
|
})]
|
|
742
633
|
}),
|
|
743
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ O("div", {
|
|
744
635
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
745
|
-
children: [/* @__PURE__ */
|
|
636
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
746
637
|
className: "text-base font-semibold text-text-primary mb-3",
|
|
747
638
|
children: "Recent Activity"
|
|
748
|
-
}), /* @__PURE__ */
|
|
639
|
+
}), J.length === 0 ? /* @__PURE__ */ D("p", {
|
|
640
|
+
className: "text-xs text-text-secondary",
|
|
641
|
+
children: "No recent activity yet."
|
|
642
|
+
}) : /* @__PURE__ */ D("div", {
|
|
749
643
|
className: "space-y-2 text-xs",
|
|
750
|
-
children:
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
children: "Inventory updated"
|
|
763
|
-
})]
|
|
764
|
-
}),
|
|
765
|
-
/* @__PURE__ */ k("div", {
|
|
766
|
-
className: "flex items-center gap-2",
|
|
767
|
-
children: [/* @__PURE__ */ O(o, { className: "h-3.5 w-3.5 text-status-warning-text" }), /* @__PURE__ */ O("span", {
|
|
768
|
-
className: "text-text-secondary",
|
|
769
|
-
children: "New customer review"
|
|
770
|
-
})]
|
|
771
|
-
})
|
|
772
|
-
]
|
|
644
|
+
children: J.map((e) => /* @__PURE__ */ O("div", {
|
|
645
|
+
className: "flex items-center gap-2",
|
|
646
|
+
children: [/* @__PURE__ */ D(re, { className: "h-3.5 w-3.5 text-text-secondary shrink-0" }), /* @__PURE__ */ O("span", {
|
|
647
|
+
className: "text-text-secondary truncate",
|
|
648
|
+
children: [
|
|
649
|
+
"Order #",
|
|
650
|
+
e.id.slice(0, 8),
|
|
651
|
+
" ",
|
|
652
|
+
e.status
|
|
653
|
+
]
|
|
654
|
+
})]
|
|
655
|
+
}, e.id))
|
|
773
656
|
})]
|
|
774
657
|
})
|
|
775
658
|
]
|
|
@@ -777,9 +660,23 @@ var N = {
|
|
|
777
660
|
})
|
|
778
661
|
]
|
|
779
662
|
})
|
|
663
|
+
}) : /* @__PURE__ */ D(n, {
|
|
664
|
+
title: A(),
|
|
665
|
+
description: "Manage your service provider operations",
|
|
666
|
+
children: /* @__PURE__ */ D(r, {
|
|
667
|
+
illustration: "empty-generic",
|
|
668
|
+
title: "Create your cart to get started",
|
|
669
|
+
description: "You don't have a service provider yet. Set up your cart, add your offerings and configure your service to start taking orders.",
|
|
670
|
+
action: /* @__PURE__ */ O("button", {
|
|
671
|
+
type: "button",
|
|
672
|
+
onClick: () => P("/cart-owner/service-config"),
|
|
673
|
+
className: "inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent/80",
|
|
674
|
+
children: [/* @__PURE__ */ D(S, { className: "h-4 w-4" }), "Set up your cart"]
|
|
675
|
+
})
|
|
676
|
+
})
|
|
780
677
|
});
|
|
781
678
|
};
|
|
782
679
|
//#endregion
|
|
783
|
-
export {
|
|
680
|
+
export { P as CartOwnerDashboard };
|
|
784
681
|
|
|
785
682
|
//# sourceMappingURL=CartOwnerDashboard.js.map
|