@burdenoff/microfe-kadaikodi 2026.1124.1 → 2026.1126.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/components/AppointmentSettingsSection.d.ts +13 -0
- package/dist/kadaikodi/components/AppointmentSettingsSection.js +206 -0
- package/dist/kadaikodi/components/AppointmentSettingsSection.js.map +1 -0
- package/dist/kadaikodi/components/AppointmentSlotPicker.d.ts +19 -0
- package/dist/kadaikodi/components/AppointmentSlotPicker.js +106 -0
- package/dist/kadaikodi/components/AppointmentSlotPicker.js.map +1 -0
- package/dist/kadaikodi/components/ProviderAppointmentQueue.d.ts +15 -0
- package/dist/kadaikodi/components/ProviderAppointmentQueue.js +179 -0
- package/dist/kadaikodi/components/ProviderAppointmentQueue.js.map +1 -0
- package/dist/kadaikodi/hooks/useAppointmentsApi.d.ts +122 -0
- package/dist/kadaikodi/hooks/useAppointmentsApi.js +184 -0
- package/dist/kadaikodi/hooks/useAppointmentsApi.js.map +1 -0
- package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts +3 -0
- package/dist/kadaikodi/hooks/useKadaikodiApi.js +5 -4
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +97 -94
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +172 -170
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +250 -241
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.d.ts +3 -1
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +317 -178
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.d.ts +3 -3
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js +307 -338
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,71 +2,74 @@ import { PageLayout as e } from "../../components/PageLayout.js";
|
|
|
2
2
|
import { EmptyState as t } from "../../components/EmptyState.js";
|
|
3
3
|
import "../../components/viz/index.js";
|
|
4
4
|
import { useKadaikodi as n } from "../../context/KadaikodiContext.js";
|
|
5
|
-
import { useOfferings as r, useOrders as i, useProviderWorkers as a, useProviders as o, useReviews as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { AreaChart as
|
|
8
|
-
import { StatCard as
|
|
9
|
-
import { formatCurrency as
|
|
10
|
-
import { useEffect as
|
|
11
|
-
import { Activity as
|
|
5
|
+
import { useOfferings as r, useOrders as i, useProviderWorkers as a, useProviders as o, useReviews as ee, useUpdateOrderStatus as te, useUpdateProvider as ne } from "../../hooks/useKadaikodiApi.js";
|
|
6
|
+
import { cn as s } from "../../utils/cn.js";
|
|
7
|
+
import { AreaChart as c } from "../../components/viz/AreaChart.js";
|
|
8
|
+
import { StatCard as l } from "../../components/viz/StatCard.js";
|
|
9
|
+
import { formatCurrency as u } from "../../utils/formatters.js";
|
|
10
|
+
import { useEffect as d, useMemo as f, useState as re } from "react";
|
|
11
|
+
import { Activity as ie, ArrowRight as ae, BarChart3 as oe, Bell as p, CheckCircle as m, ChevronRight as h, Clock as g, Edit as se, Eye as _, Flame as v, IndianRupee as y, MapPin as b, Package as ce, Plus as x, Settings as S, ShoppingCart as C, Star as w, TrendingUp as T, UserCheck as E, Users as le } from "lucide-react";
|
|
12
12
|
import { Fragment as ue, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
13
13
|
import { EmphasisPanel as de, NextSteps as fe, PagePurpose as pe } from "@burdenoff/fe-libs/ui";
|
|
14
14
|
// src/kadaikodi/pages/cart-owner/CartOwnerDashboard.tsx
|
|
15
15
|
var k = () => {
|
|
16
16
|
let e = (/* @__PURE__ */ new Date()).getHours();
|
|
17
17
|
return e < 12 ? "Good Morning" : e < 17 ? "Good Afternoon" : "Good Evening";
|
|
18
|
-
},
|
|
18
|
+
}, me = {
|
|
19
19
|
pending: "bg-status-error-bg-subtle text-status-error-text",
|
|
20
20
|
confirmed: "bg-[var(--color-accent-soft)] text-text-primary",
|
|
21
21
|
preparing: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
22
22
|
ready: "bg-[var(--color-accent-soft)] text-text-primary",
|
|
23
23
|
delivered: "bg-status-success-bg-subtle text-status-success-text",
|
|
24
24
|
cancelled: "bg-bg-sunken text-text-secondary"
|
|
25
|
-
},
|
|
25
|
+
}, A = () => {
|
|
26
26
|
let e = /* @__PURE__ */ new Date();
|
|
27
27
|
return e.setHours(0, 0, 0, 0), e;
|
|
28
|
-
},
|
|
28
|
+
}, j = (e) => {
|
|
29
29
|
let t = Math.floor((Date.now() - new Date(e).getTime()) / 6e4);
|
|
30
30
|
return t < 1 ? "Just now" : t < 60 ? `${t} min ago` : t < 1440 ? `${Math.floor(t / 60)} hr ago` : new Date(e).toLocaleDateString("en-IN", {
|
|
31
31
|
day: "2-digit",
|
|
32
32
|
month: "short"
|
|
33
33
|
});
|
|
34
|
-
},
|
|
35
|
-
let { navigateTo:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, [L]);
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
}, M = () => {
|
|
35
|
+
let { navigateTo: M, currentUser: N } = n(), { data: P = [], isLoading: F } = o(), I = f(() => P.find((e) => e.ownerId === N?.id) ?? P[0], [P, N?.id]), L = I?.id, { data: R = [] } = i({ providerId: L }), { data: z = [] } = i({
|
|
36
|
+
providerId: L,
|
|
37
|
+
excludeAppointments: !0
|
|
38
|
+
}), { data: B = [] } = r(L), { data: he = [] } = ee(L ?? ""), { data: V = [] } = a(L), ge = te(), H = ne(), U = N?.firstName ?? N?.name?.split(" ")[0] ?? "", [W, G] = re(!0);
|
|
39
|
+
d(() => {
|
|
40
|
+
I && G(I.isOpen);
|
|
41
|
+
}, [I]);
|
|
42
|
+
let _e = () => {
|
|
43
|
+
if (!I) return;
|
|
41
44
|
let e = !W;
|
|
42
45
|
G(e), H.mutate({
|
|
43
|
-
id:
|
|
46
|
+
id: I.id,
|
|
44
47
|
input: { status: e ? "ACTIVE" : "PAUSED" }
|
|
45
48
|
}, { onError: () => G(!e) });
|
|
46
49
|
}, K = f(() => {
|
|
47
|
-
let e =
|
|
50
|
+
let e = A(), t = R.filter((e) => e.status === "delivered"), n = R.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(I?.averageOrderValue ?? 0);
|
|
48
51
|
return {
|
|
49
52
|
totalRevenue: i,
|
|
50
53
|
dailyRevenue: a,
|
|
51
54
|
ordersToday: n.length,
|
|
52
|
-
totalOrders:
|
|
55
|
+
totalOrders: R.length,
|
|
53
56
|
activeOfferings: B.filter((e) => e.isAvailable).length,
|
|
54
57
|
averageOrderValue: o,
|
|
55
|
-
rating:
|
|
56
|
-
totalRatings:
|
|
58
|
+
rating: I?.rating ?? 0,
|
|
59
|
+
totalRatings: I?.totalRatings ?? 0
|
|
57
60
|
};
|
|
58
61
|
}, [
|
|
59
|
-
|
|
62
|
+
R,
|
|
60
63
|
B,
|
|
61
|
-
|
|
64
|
+
I
|
|
62
65
|
]), q = f(() => [...z].sort((e, t) => new Date(t.orderDate).getTime() - new Date(e.orderDate).getTime()).slice(0, 4), [z]), J = f(() => {
|
|
63
66
|
let e = [];
|
|
64
67
|
for (let t = 6; t >= 0; t--) {
|
|
65
|
-
let n =
|
|
68
|
+
let n = A();
|
|
66
69
|
n.setDate(n.getDate() - t);
|
|
67
70
|
let r = new Date(n);
|
|
68
71
|
r.setDate(n.getDate() + 1);
|
|
69
|
-
let i =
|
|
72
|
+
let i = R.filter((e) => {
|
|
70
73
|
let t = new Date(e.orderDate);
|
|
71
74
|
return t >= n && t < r;
|
|
72
75
|
});
|
|
@@ -77,7 +80,7 @@ var k = () => {
|
|
|
77
80
|
});
|
|
78
81
|
}
|
|
79
82
|
return e;
|
|
80
|
-
}, [
|
|
83
|
+
}, [R]), Y = f(() => {
|
|
81
84
|
let e = J.map((e) => e.revenue), t = J.map((e) => e.orders), n = (e, t) => t > 0 ? Math.round((e - t) / t * 100) : void 0, r = J[J.length - 1]?.revenue ?? 0, i = J[J.length - 2]?.revenue ?? 0, a = J[J.length - 1]?.orders ?? 0, o = J[J.length - 2]?.orders ?? 0;
|
|
82
85
|
return {
|
|
83
86
|
revenueSpark: e,
|
|
@@ -91,7 +94,7 @@ var k = () => {
|
|
|
91
94
|
};
|
|
92
95
|
}, [J]), X = f(() => {
|
|
93
96
|
let e = /* @__PURE__ */ new Map();
|
|
94
|
-
return
|
|
97
|
+
return R.forEach((t) => t.items.forEach((t) => {
|
|
95
98
|
let n = e.get(t.name) ?? {
|
|
96
99
|
quantity: 0,
|
|
97
100
|
revenue: 0
|
|
@@ -101,30 +104,30 @@ var k = () => {
|
|
|
101
104
|
name: e,
|
|
102
105
|
...t
|
|
103
106
|
})).sort((e, t) => t.revenue - e.revenue).slice(0, 5);
|
|
104
|
-
}, [
|
|
105
|
-
|
|
107
|
+
}, [R]), ve = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", { weekday: "long" }).toLowerCase(), Z = I?.businessHours?.[ve], Q = Z && Z.isOpen ? `${Z.open} - ${Z.close}` : null, ye = I?.location?.address?.trim() || null, $ = (e, t) => {
|
|
108
|
+
ge.mutate({
|
|
106
109
|
id: e,
|
|
107
110
|
status: t
|
|
108
111
|
});
|
|
109
112
|
};
|
|
110
|
-
return
|
|
113
|
+
return F ? /* @__PURE__ */ D(e, {
|
|
111
114
|
title: k(),
|
|
112
115
|
description: "Manage your service provider operations",
|
|
113
116
|
children: /* @__PURE__ */ D("div", {
|
|
114
117
|
className: "flex items-center justify-center py-24",
|
|
115
118
|
children: /* @__PURE__ */ D("div", { className: "h-10 w-10 animate-spin rounded-full border-b-2 border-foreground" })
|
|
116
119
|
})
|
|
117
|
-
}) :
|
|
120
|
+
}) : I ? /* @__PURE__ */ D(e, {
|
|
118
121
|
title: /* @__PURE__ */ O("span", { children: [k(), U && /* @__PURE__ */ O(ue, { children: [", ", /* @__PURE__ */ D("span", {
|
|
119
122
|
className: "text-text-secondary font-normal",
|
|
120
123
|
children: U
|
|
121
124
|
})] })] }),
|
|
122
|
-
description:
|
|
125
|
+
description: I.name,
|
|
123
126
|
actions: /* @__PURE__ */ O("button", {
|
|
124
127
|
type: "button",
|
|
125
|
-
onClick: () =>
|
|
128
|
+
onClick: () => M("/cart-owner/orders"),
|
|
126
129
|
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",
|
|
127
|
-
children: ["View All Orders", /* @__PURE__ */ D(
|
|
130
|
+
children: ["View All Orders", /* @__PURE__ */ D(ae, { className: "h-4 w-4" })]
|
|
128
131
|
}),
|
|
129
132
|
children: /* @__PURE__ */ O("div", {
|
|
130
133
|
className: "space-y-6",
|
|
@@ -137,53 +140,53 @@ var k = () => {
|
|
|
137
140
|
id: "offerings",
|
|
138
141
|
label: "Set up your offerings",
|
|
139
142
|
description: "Add the dishes and items customers can order from your cart.",
|
|
140
|
-
onClick: () =>
|
|
143
|
+
onClick: () => M("/cart-owner/inventory")
|
|
141
144
|
},
|
|
142
145
|
{
|
|
143
146
|
id: "service-config",
|
|
144
147
|
label: "Configure service & hours",
|
|
145
148
|
description: "Define your operating hours, location and service area.",
|
|
146
|
-
onClick: () =>
|
|
149
|
+
onClick: () => M("/cart-owner/service-config")
|
|
147
150
|
},
|
|
148
151
|
{
|
|
149
152
|
id: "orders",
|
|
150
153
|
label: "Manage incoming orders",
|
|
151
154
|
description: "Accept, prepare and fulfil customer orders in real time.",
|
|
152
|
-
onClick: () =>
|
|
155
|
+
onClick: () => M("/cart-owner/orders")
|
|
153
156
|
}
|
|
154
157
|
]
|
|
155
158
|
}),
|
|
156
159
|
/* @__PURE__ */ D("div", {
|
|
157
|
-
className:
|
|
160
|
+
className: s("p-4 rounded-lg border-l-4", W ? "border-status-success-text bg-status-success-bg-subtle" : "border-status-error-text bg-status-error-bg-subtle"),
|
|
158
161
|
children: /* @__PURE__ */ O("div", {
|
|
159
162
|
className: "flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",
|
|
160
163
|
children: [/* @__PURE__ */ O("div", {
|
|
161
164
|
className: "flex items-start gap-3",
|
|
162
|
-
children: [/* @__PURE__ */ D("div", { className:
|
|
165
|
+
children: [/* @__PURE__ */ D("div", { className: s("w-3 h-3 rounded-full mt-1 shrink-0", W ? "bg-status-success-text" : "bg-status-error-text") }), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ O("h3", {
|
|
163
166
|
className: "font-semibold text-text-primary text-sm",
|
|
164
167
|
children: ["Service Status: ", W ? "Open" : "Closed"]
|
|
165
168
|
}), /* @__PURE__ */ O("div", {
|
|
166
169
|
className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4 mt-1 text-xs text-text-secondary",
|
|
167
170
|
children: [/* @__PURE__ */ O("span", {
|
|
168
171
|
className: "flex items-center gap-1",
|
|
169
|
-
children: [/* @__PURE__ */ D(b, { className: "h-3 w-3 shrink-0" }),
|
|
172
|
+
children: [/* @__PURE__ */ D(b, { className: "h-3 w-3 shrink-0" }), ye ?? "Location not set"]
|
|
170
173
|
}), Q && /* @__PURE__ */ O("span", {
|
|
171
174
|
className: "flex items-center gap-1",
|
|
172
|
-
children: [/* @__PURE__ */ D(
|
|
175
|
+
children: [/* @__PURE__ */ D(g, { className: "h-3 w-3 shrink-0" }), Q]
|
|
173
176
|
})]
|
|
174
177
|
})] })]
|
|
175
178
|
}), /* @__PURE__ */ O("div", {
|
|
176
179
|
className: "flex gap-2",
|
|
177
180
|
children: [/* @__PURE__ */ O("button", {
|
|
178
181
|
type: "button",
|
|
179
|
-
onClick: () =>
|
|
182
|
+
onClick: () => M("/cart-owner/settings"),
|
|
180
183
|
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",
|
|
181
184
|
children: [/* @__PURE__ */ D(b, { className: "h-3 w-3" }), "Update Location"]
|
|
182
185
|
}), /* @__PURE__ */ D("button", {
|
|
183
186
|
type: "button",
|
|
184
|
-
onClick:
|
|
187
|
+
onClick: _e,
|
|
185
188
|
disabled: H.isPending,
|
|
186
|
-
className:
|
|
189
|
+
className: s("inline-flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors disabled:opacity-60 disabled:cursor-not-allowed", W ? "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"),
|
|
187
190
|
children: W ? "Close Service" : "Open Service"
|
|
188
191
|
})]
|
|
189
192
|
})]
|
|
@@ -195,43 +198,43 @@ var k = () => {
|
|
|
195
198
|
}), /* @__PURE__ */ O("div", {
|
|
196
199
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
197
200
|
children: [
|
|
198
|
-
/* @__PURE__ */ D(
|
|
201
|
+
/* @__PURE__ */ D(l, {
|
|
199
202
|
label: "Daily Revenue",
|
|
200
|
-
value:
|
|
203
|
+
value: u(K.dailyRevenue, { minimumFractionDigits: 0 }),
|
|
201
204
|
delta: Y.revenueDelta,
|
|
202
205
|
deltaLabel: "vs yesterday",
|
|
203
|
-
icon: /* @__PURE__ */ D(
|
|
206
|
+
icon: /* @__PURE__ */ D(y, { className: "h-4 w-4" }),
|
|
204
207
|
sparkline: Y.revenueSpark,
|
|
205
208
|
sparklineVariant: "area"
|
|
206
209
|
}),
|
|
207
|
-
/* @__PURE__ */ D(
|
|
210
|
+
/* @__PURE__ */ D(l, {
|
|
208
211
|
label: "Orders Today",
|
|
209
212
|
value: K.ordersToday,
|
|
210
213
|
delta: Y.ordersDelta,
|
|
211
214
|
deltaLabel: "vs yesterday",
|
|
212
|
-
icon: /* @__PURE__ */ D(
|
|
215
|
+
icon: /* @__PURE__ */ D(C, { className: "h-4 w-4" }),
|
|
213
216
|
sparkline: Y.ordersSpark,
|
|
214
217
|
sparklineVariant: "line"
|
|
215
218
|
}),
|
|
216
|
-
/* @__PURE__ */ D(
|
|
219
|
+
/* @__PURE__ */ D(l, {
|
|
217
220
|
label: "Avg Order Value",
|
|
218
|
-
value:
|
|
219
|
-
icon: /* @__PURE__ */ D(
|
|
221
|
+
value: u(K.averageOrderValue, { minimumFractionDigits: 0 }),
|
|
222
|
+
icon: /* @__PURE__ */ D(T, { className: "h-4 w-4" })
|
|
220
223
|
}),
|
|
221
|
-
/* @__PURE__ */ D(
|
|
224
|
+
/* @__PURE__ */ D(l, {
|
|
222
225
|
label: "Service Rating",
|
|
223
226
|
value: /* @__PURE__ */ O("span", {
|
|
224
227
|
className: "flex items-baseline gap-1.5",
|
|
225
228
|
children: [
|
|
226
229
|
K.rating.toFixed(1),
|
|
227
|
-
/* @__PURE__ */ D(
|
|
230
|
+
/* @__PURE__ */ D(w, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }),
|
|
228
231
|
/* @__PURE__ */ D("span", {
|
|
229
232
|
className: "text-xs font-normal text-text-muted",
|
|
230
233
|
children: K.totalRatings > 0 ? `${K.totalRatings} ${K.totalRatings === 1 ? "rating" : "ratings"}` : "No ratings yet"
|
|
231
234
|
})
|
|
232
235
|
]
|
|
233
236
|
}),
|
|
234
|
-
icon: /* @__PURE__ */ D(
|
|
237
|
+
icon: /* @__PURE__ */ D(w, { className: "h-4 w-4" })
|
|
235
238
|
})
|
|
236
239
|
]
|
|
237
240
|
})] }),
|
|
@@ -248,37 +251,37 @@ var k = () => {
|
|
|
248
251
|
children: [
|
|
249
252
|
{
|
|
250
253
|
label: "Service Config",
|
|
251
|
-
icon:
|
|
254
|
+
icon: S,
|
|
252
255
|
color: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
253
256
|
path: "/cart-owner/service-config"
|
|
254
257
|
},
|
|
255
258
|
{
|
|
256
259
|
label: "Manage Offerings",
|
|
257
|
-
icon:
|
|
260
|
+
icon: ce,
|
|
258
261
|
color: "bg-[var(--color-accent-soft)] text-text-primary",
|
|
259
262
|
path: "/cart-owner/inventory"
|
|
260
263
|
},
|
|
261
264
|
{
|
|
262
265
|
label: "View Orders",
|
|
263
|
-
icon:
|
|
266
|
+
icon: C,
|
|
264
267
|
color: "bg-status-success-bg-subtle text-status-success-text",
|
|
265
268
|
path: "/cart-owner/orders"
|
|
266
269
|
},
|
|
267
270
|
{
|
|
268
271
|
label: "Analytics",
|
|
269
|
-
icon:
|
|
272
|
+
icon: oe,
|
|
270
273
|
color: "bg-accent-purple-subtle text-text-primary",
|
|
271
274
|
path: "/cart-owner/analytics"
|
|
272
275
|
},
|
|
273
276
|
{
|
|
274
277
|
label: "Staff",
|
|
275
|
-
icon:
|
|
278
|
+
icon: E,
|
|
276
279
|
color: "bg-accent-purple-subtle text-text-primary",
|
|
277
280
|
path: "/cart-owner/staff"
|
|
278
281
|
},
|
|
279
282
|
{
|
|
280
283
|
label: "Raise Capital",
|
|
281
|
-
icon:
|
|
284
|
+
icon: T,
|
|
282
285
|
color: "bg-accent-purple-subtle text-text-primary",
|
|
283
286
|
path: "/cart-owner/list-investment"
|
|
284
287
|
}
|
|
@@ -286,8 +289,8 @@ var k = () => {
|
|
|
286
289
|
let t = e.icon;
|
|
287
290
|
return /* @__PURE__ */ O("button", {
|
|
288
291
|
type: "button",
|
|
289
|
-
onClick: () =>
|
|
290
|
-
className:
|
|
292
|
+
onClick: () => M(e.path),
|
|
293
|
+
className: s("flex flex-col items-center gap-2 rounded-lg p-4 transition-colors hover:opacity-80", e.color),
|
|
291
294
|
children: [/* @__PURE__ */ D(t, { className: "h-5 w-5" }), /* @__PURE__ */ D("span", {
|
|
292
295
|
className: "text-xs font-medium text-center",
|
|
293
296
|
children: e.label
|
|
@@ -302,7 +305,7 @@ var k = () => {
|
|
|
302
305
|
children: "Recent Orders"
|
|
303
306
|
}), /* @__PURE__ */ D("button", {
|
|
304
307
|
type: "button",
|
|
305
|
-
onClick: () =>
|
|
308
|
+
onClick: () => M("/cart-owner/orders"),
|
|
306
309
|
className: "text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
307
310
|
children: "View All Orders"
|
|
308
311
|
})]
|
|
@@ -324,7 +327,7 @@ var k = () => {
|
|
|
324
327
|
className: "font-semibold text-text-primary text-sm",
|
|
325
328
|
children: ["#", e.id.slice(0, 8)]
|
|
326
329
|
}), /* @__PURE__ */ D("span", {
|
|
327
|
-
className:
|
|
330
|
+
className: s("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium capitalize", me[e.status] || "bg-bg-sunken text-text-secondary"),
|
|
328
331
|
children: e.status
|
|
329
332
|
})]
|
|
330
333
|
}),
|
|
@@ -336,10 +339,10 @@ var k = () => {
|
|
|
336
339
|
className: "flex flex-wrap items-center gap-3 text-xs text-text-secondary",
|
|
337
340
|
children: [/* @__PURE__ */ D("span", {
|
|
338
341
|
className: "font-semibold text-text-primary",
|
|
339
|
-
children:
|
|
342
|
+
children: u(e.total, { minimumFractionDigits: 0 })
|
|
340
343
|
}), /* @__PURE__ */ O("span", {
|
|
341
344
|
className: "flex items-center gap-1",
|
|
342
|
-
children: [/* @__PURE__ */ D(
|
|
345
|
+
children: [/* @__PURE__ */ D(g, { className: "h-3 w-3" }), j(e.orderDate)]
|
|
343
346
|
})]
|
|
344
347
|
})
|
|
345
348
|
]
|
|
@@ -348,21 +351,21 @@ var k = () => {
|
|
|
348
351
|
children: [
|
|
349
352
|
/* @__PURE__ */ O("button", {
|
|
350
353
|
type: "button",
|
|
351
|
-
onClick: () =>
|
|
354
|
+
onClick: () => M("/cart-owner/orders"),
|
|
352
355
|
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",
|
|
353
|
-
children: [/* @__PURE__ */ D(
|
|
356
|
+
children: [/* @__PURE__ */ D(_, { className: "h-3 w-3" }), "View"]
|
|
354
357
|
}),
|
|
355
358
|
e.status === "pending" && /* @__PURE__ */ O("button", {
|
|
356
359
|
type: "button",
|
|
357
360
|
onClick: () => $(e.id, "CONFIRMED"),
|
|
358
361
|
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",
|
|
359
|
-
children: [/* @__PURE__ */ D(
|
|
362
|
+
children: [/* @__PURE__ */ D(m, { className: "h-3 w-3" }), "Accept"]
|
|
360
363
|
}),
|
|
361
364
|
(e.status === "confirmed" || e.status === "preparing") && /* @__PURE__ */ O("button", {
|
|
362
365
|
type: "button",
|
|
363
366
|
onClick: () => $(e.id, "READY"),
|
|
364
367
|
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",
|
|
365
|
-
children: [/* @__PURE__ */ D(
|
|
368
|
+
children: [/* @__PURE__ */ D(m, { className: "h-3 w-3" }), "Mark Ready"]
|
|
366
369
|
})
|
|
367
370
|
]
|
|
368
371
|
})]
|
|
@@ -379,7 +382,7 @@ var k = () => {
|
|
|
379
382
|
}), /* @__PURE__ */ O("p", {
|
|
380
383
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
381
384
|
children: [
|
|
382
|
-
|
|
385
|
+
u(J.reduce((e, t) => e + t.revenue, 0), { minimumFractionDigits: 0 }),
|
|
383
386
|
" ",
|
|
384
387
|
"delivered · ",
|
|
385
388
|
J.reduce((e, t) => e + t.orders, 0),
|
|
@@ -387,17 +390,17 @@ var k = () => {
|
|
|
387
390
|
]
|
|
388
391
|
})] }), /* @__PURE__ */ D("button", {
|
|
389
392
|
type: "button",
|
|
390
|
-
onClick: () =>
|
|
393
|
+
onClick: () => M("/cart-owner/analytics"),
|
|
391
394
|
className: "text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
392
395
|
children: "View Analytics"
|
|
393
396
|
})]
|
|
394
397
|
}), /* @__PURE__ */ D("div", {
|
|
395
398
|
className: "p-5",
|
|
396
|
-
children: J.some((e) => e.revenue > 0) ? /* @__PURE__ */ D(
|
|
399
|
+
children: J.some((e) => e.revenue > 0) ? /* @__PURE__ */ D(c, {
|
|
397
400
|
series: Y.revenueSeries,
|
|
398
401
|
height: 220,
|
|
399
402
|
title: "Revenue over the last 7 days",
|
|
400
|
-
valueFormatter: (e) =>
|
|
403
|
+
valueFormatter: (e) => u(e, { minimumFractionDigits: 0 })
|
|
401
404
|
}) : /* @__PURE__ */ D("p", {
|
|
402
405
|
className: "py-10 text-center text-sm text-text-secondary",
|
|
403
406
|
children: "No delivered revenue in the last 7 days yet. Completed orders will chart here."
|
|
@@ -416,7 +419,7 @@ var k = () => {
|
|
|
416
419
|
className: "text-center p-3 rounded-lg bg-bg-sunken/50",
|
|
417
420
|
children: [/* @__PURE__ */ D("div", {
|
|
418
421
|
className: "text-xl font-bold text-text-primary",
|
|
419
|
-
children:
|
|
422
|
+
children: u(K.totalRevenue, { minimumFractionDigits: 0 })
|
|
420
423
|
}), /* @__PURE__ */ D("div", {
|
|
421
424
|
className: "text-xs text-text-secondary mt-1",
|
|
422
425
|
children: "Total Revenue"
|
|
@@ -436,7 +439,7 @@ var k = () => {
|
|
|
436
439
|
className: "text-center p-3 rounded-lg bg-bg-sunken/50",
|
|
437
440
|
children: [/* @__PURE__ */ D("div", {
|
|
438
441
|
className: "text-xl font-bold text-text-primary",
|
|
439
|
-
children:
|
|
442
|
+
children: u(K.averageOrderValue, { minimumFractionDigits: 0 })
|
|
440
443
|
}), /* @__PURE__ */ D("div", {
|
|
441
444
|
className: "text-xs text-text-secondary mt-1",
|
|
442
445
|
children: "Avg Order Value"
|
|
@@ -455,7 +458,7 @@ var k = () => {
|
|
|
455
458
|
className: "flex items-center justify-between mb-4",
|
|
456
459
|
children: /* @__PURE__ */ O("h3", {
|
|
457
460
|
className: "text-base font-semibold text-text-primary flex items-center gap-2",
|
|
458
|
-
children: [/* @__PURE__ */ D(
|
|
461
|
+
children: [/* @__PURE__ */ D(p, { className: "h-4 w-4" }), "Notifications"]
|
|
459
462
|
})
|
|
460
463
|
}), /* @__PURE__ */ D("p", {
|
|
461
464
|
className: "text-xs text-text-secondary",
|
|
@@ -466,7 +469,7 @@ var k = () => {
|
|
|
466
469
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
467
470
|
children: [/* @__PURE__ */ O("h3", {
|
|
468
471
|
className: "text-base font-semibold text-text-primary mb-4 flex items-center gap-2",
|
|
469
|
-
children: [/* @__PURE__ */ D(
|
|
472
|
+
children: [/* @__PURE__ */ D(v, { className: "h-4 w-4 text-status-warning-text" }), "Top Selling Items"]
|
|
470
473
|
}), X.length === 0 ? /* @__PURE__ */ D("p", {
|
|
471
474
|
className: "text-xs text-text-secondary",
|
|
472
475
|
children: "No sales yet. Your best sellers will appear here once orders come in."
|
|
@@ -491,7 +494,7 @@ var k = () => {
|
|
|
491
494
|
})]
|
|
492
495
|
}), /* @__PURE__ */ D("span", {
|
|
493
496
|
className: "text-xs font-semibold text-text-primary",
|
|
494
|
-
children:
|
|
497
|
+
children: u(e.revenue, { minimumFractionDigits: 0 })
|
|
495
498
|
})]
|
|
496
499
|
}, e.name))
|
|
497
500
|
})]
|
|
@@ -505,7 +508,7 @@ var k = () => {
|
|
|
505
508
|
children: [/* @__PURE__ */ D(le, { className: "h-4 w-4" }), "Staff Overview"]
|
|
506
509
|
}), /* @__PURE__ */ D("button", {
|
|
507
510
|
type: "button",
|
|
508
|
-
onClick: () =>
|
|
511
|
+
onClick: () => M("/cart-owner/staff"),
|
|
509
512
|
className: "text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
510
513
|
children: "Manage"
|
|
511
514
|
})]
|
|
@@ -518,7 +521,7 @@ var k = () => {
|
|
|
518
521
|
className: "flex items-center justify-between",
|
|
519
522
|
children: [/* @__PURE__ */ O("div", {
|
|
520
523
|
className: "flex items-center gap-2",
|
|
521
|
-
children: [/* @__PURE__ */ D("div", { className:
|
|
524
|
+
children: [/* @__PURE__ */ D("div", { className: s("w-2 h-2 rounded-full", e.status === "ACTIVE" ? "bg-status-success-text" : "bg-muted-foreground") }), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
522
525
|
className: "text-xs font-medium text-text-primary",
|
|
523
526
|
children: e.name
|
|
524
527
|
}), /* @__PURE__ */ D("p", {
|
|
@@ -557,7 +560,7 @@ var k = () => {
|
|
|
557
560
|
children: "Customer Rating"
|
|
558
561
|
}), /* @__PURE__ */ O("span", {
|
|
559
562
|
className: "text-sm font-semibold text-text-primary flex items-center gap-1",
|
|
560
|
-
children: [/* @__PURE__ */ D(
|
|
563
|
+
children: [/* @__PURE__ */ D(w, { className: "h-3 w-3 text-status-warning-text fill-status-warning-text" }), K.rating.toFixed(1)]
|
|
561
564
|
})]
|
|
562
565
|
}),
|
|
563
566
|
/* @__PURE__ */ O("div", {
|
|
@@ -567,7 +570,7 @@ var k = () => {
|
|
|
567
570
|
children: "Reviews"
|
|
568
571
|
}), /* @__PURE__ */ D("span", {
|
|
569
572
|
className: "text-sm font-semibold text-text-primary",
|
|
570
|
-
children:
|
|
573
|
+
children: he.length
|
|
571
574
|
})]
|
|
572
575
|
})
|
|
573
576
|
]
|
|
@@ -583,29 +586,29 @@ var k = () => {
|
|
|
583
586
|
children: [
|
|
584
587
|
{
|
|
585
588
|
label: "Service Settings",
|
|
586
|
-
icon:
|
|
589
|
+
icon: S,
|
|
587
590
|
path: "/cart-owner/settings"
|
|
588
591
|
},
|
|
589
592
|
{
|
|
590
593
|
label: "Business Profile",
|
|
591
|
-
icon:
|
|
594
|
+
icon: se,
|
|
592
595
|
path: "/cart-owner/profile"
|
|
593
596
|
},
|
|
594
597
|
{
|
|
595
598
|
label: "Add Offerings",
|
|
596
|
-
icon:
|
|
599
|
+
icon: x,
|
|
597
600
|
path: "/cart-owner/inventory"
|
|
598
601
|
}
|
|
599
602
|
].map((e) => {
|
|
600
603
|
let t = e.icon;
|
|
601
604
|
return /* @__PURE__ */ O("button", {
|
|
602
605
|
type: "button",
|
|
603
|
-
onClick: () =>
|
|
606
|
+
onClick: () => M(e.path),
|
|
604
607
|
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",
|
|
605
608
|
children: [/* @__PURE__ */ O("span", {
|
|
606
609
|
className: "flex items-center gap-2",
|
|
607
610
|
children: [/* @__PURE__ */ D(t, { className: "h-3.5 w-3.5" }), e.label]
|
|
608
|
-
}), /* @__PURE__ */ D(
|
|
611
|
+
}), /* @__PURE__ */ D(h, { className: "h-3 w-3 text-text-secondary" })]
|
|
609
612
|
}, e.label);
|
|
610
613
|
})
|
|
611
614
|
})]
|
|
@@ -622,7 +625,7 @@ var k = () => {
|
|
|
622
625
|
className: "space-y-2 text-xs",
|
|
623
626
|
children: q.map((e) => /* @__PURE__ */ O("div", {
|
|
624
627
|
className: "flex items-center gap-2",
|
|
625
|
-
children: [/* @__PURE__ */ D(
|
|
628
|
+
children: [/* @__PURE__ */ D(ie, { className: "h-3.5 w-3.5 text-text-secondary shrink-0" }), /* @__PURE__ */ O("span", {
|
|
626
629
|
className: "text-text-secondary truncate",
|
|
627
630
|
children: [
|
|
628
631
|
"Order #",
|
|
@@ -648,13 +651,13 @@ var k = () => {
|
|
|
648
651
|
description: "You don't have a service provider yet. Set up your cart, add your offerings and configure your service to start taking orders.",
|
|
649
652
|
action: /* @__PURE__ */ O("button", {
|
|
650
653
|
type: "button",
|
|
651
|
-
onClick: () =>
|
|
654
|
+
onClick: () => M("/cart-owner/onboarding"),
|
|
652
655
|
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-5 py-2.5 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover",
|
|
653
|
-
children: [/* @__PURE__ */ D(
|
|
656
|
+
children: [/* @__PURE__ */ D(x, { className: "h-4 w-4" }), "Set up your cart"]
|
|
654
657
|
})
|
|
655
658
|
})
|
|
656
659
|
});
|
|
657
660
|
};
|
|
658
|
-
export {
|
|
661
|
+
export { M as CartOwnerDashboard };
|
|
659
662
|
|
|
660
663
|
//# sourceMappingURL=CartOwnerDashboard.js.map
|