@burdenoff/microfe-kadaikodi 2026.1124.1 → 2026.1126.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/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 +186 -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
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { PageLayout as e } from "../../components/PageLayout.js";
|
|
2
2
|
import { EmptyState as t } from "../../components/EmptyState.js";
|
|
3
|
+
import { ProviderAppointmentQueue as n } from "../../components/ProviderAppointmentQueue.js";
|
|
3
4
|
import "../../components/viz/index.js";
|
|
4
|
-
import { useKadaikodi as
|
|
5
|
-
import { useOrders as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { cn as
|
|
12
|
-
import { useEffect as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
5
|
+
import { useKadaikodi as r } from "../../context/KadaikodiContext.js";
|
|
6
|
+
import { useOrders as i, useProviders as a, useUpdateOrderStatus as o } from "../../hooks/useKadaikodiApi.js";
|
|
7
|
+
import { STATUS as s } from "../../components/viz/lib/palette.js";
|
|
8
|
+
import { StatCard as c } from "../../components/viz/StatCard.js";
|
|
9
|
+
import { KanbanBoard as l } from "../../components/viz/KanbanBoard.js";
|
|
10
|
+
import { SegmentedTabs as u } from "../../components/viz/SegmentedTabs.js";
|
|
11
|
+
import { formatCurrency as d } from "../../utils/formatters.js";
|
|
12
|
+
import { cn as f } from "../../utils/cn.js";
|
|
13
|
+
import { useEffect as p, useMemo as m, useState as h } from "react";
|
|
14
|
+
import { useQueryClient as ee } from "@tanstack/react-query";
|
|
15
|
+
import { AlertCircle as te, CheckCircle2 as g, ChefHat as _, Clock as ne, MapPin as v, PackageCheck as y, Phone as b, RefreshCw as re, Search as ie, ShoppingBag as x, Truck as S, X as ae, XCircle as C } from "lucide-react";
|
|
16
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
15
17
|
import { EmphasisPanel as oe, PagePurpose as se } from "@burdenoff/fe-libs/ui";
|
|
16
18
|
// src/kadaikodi/pages/cart-owner/OrderManagementPage.tsx
|
|
17
|
-
var
|
|
19
|
+
var D = {
|
|
18
20
|
pending: {
|
|
19
21
|
color: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
20
22
|
label: "New Order"
|
|
@@ -43,58 +45,61 @@ var T = {
|
|
|
43
45
|
color: "bg-status-error-bg-subtle text-status-error-text",
|
|
44
46
|
label: "Cancelled"
|
|
45
47
|
}
|
|
46
|
-
},
|
|
48
|
+
}, O = {
|
|
47
49
|
delivery: {
|
|
48
|
-
icon:
|
|
50
|
+
icon: S,
|
|
49
51
|
label: "Delivery",
|
|
50
52
|
color: "bg-accent-purple-subtle text-text-primary"
|
|
51
53
|
},
|
|
52
54
|
pickup: {
|
|
53
|
-
icon:
|
|
55
|
+
icon: x,
|
|
54
56
|
label: "Pickup",
|
|
55
57
|
color: "bg-[var(--color-accent-soft)] text-text-primary"
|
|
56
58
|
},
|
|
57
59
|
cart_dispatch: {
|
|
58
|
-
icon:
|
|
60
|
+
icon: v,
|
|
59
61
|
label: "Cart Dispatch",
|
|
60
62
|
color: "bg-bg-sunken text-text-secondary"
|
|
61
63
|
}
|
|
62
|
-
},
|
|
64
|
+
}, k = (e) => {
|
|
63
65
|
let t = new Date(e), n = Math.floor(((/* @__PURE__ */ new Date()).getTime() - t.getTime()) / 6e4);
|
|
64
66
|
return n < 1 ? "Just now" : n < 60 ? `${n} min ago` : n < 1440 ? `${Math.floor(n / 60)} hours ago` : t.toLocaleDateString("en-IN", {
|
|
65
67
|
day: "2-digit",
|
|
66
68
|
month: "short"
|
|
67
69
|
});
|
|
68
|
-
},
|
|
70
|
+
}, ce = (e) => new Date(e).toLocaleTimeString("en-IN", {
|
|
69
71
|
hour: "numeric",
|
|
70
72
|
minute: "2-digit",
|
|
71
73
|
hour12: !0
|
|
72
|
-
}),
|
|
74
|
+
}), le = (e) => {
|
|
73
75
|
let t = ((/* @__PURE__ */ new Date()).getTime() - new Date(e.orderDate).getTime()) / 6e4;
|
|
74
76
|
return e.status === "pending" && t > 10 ? "border-status-error-text/50 bg-status-error-bg-subtle" : e.status === "preparing" && t > 30 ? "border-status-warning-text/50 bg-status-warning-bg-subtle" : "border-border-subtle";
|
|
75
|
-
},
|
|
76
|
-
let { navigateTo:
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
}, ue = () => {
|
|
78
|
+
let { navigateTo: ue, currentUser: A } = r(), de = ee(), { data: j = [] } = a(), M = m(() => j.find((e) => e.ownerId === A?.id) ?? j[0], [j, A?.id]), { data: N = [], isLoading: fe, refetch: P, isFetching: F } = i({
|
|
79
|
+
providerId: M?.id,
|
|
80
|
+
excludeAppointments: !0
|
|
81
|
+
}), I = o(), [L, R] = h([]);
|
|
82
|
+
p(() => {
|
|
83
|
+
R(N);
|
|
79
84
|
}, [N]);
|
|
80
|
-
let [
|
|
85
|
+
let [z, B] = h({
|
|
81
86
|
status: "",
|
|
82
87
|
dateRange: "all",
|
|
83
88
|
searchQuery: "",
|
|
84
89
|
sortBy: "recent",
|
|
85
90
|
fulfillmentType: ""
|
|
86
|
-
}), [
|
|
91
|
+
}), [V, pe] = h("board"), [H, U] = h(null), [W, G] = h(!1), [K, q] = h(null), J = (e, t) => {
|
|
87
92
|
q({
|
|
88
93
|
text: e,
|
|
89
94
|
type: t
|
|
90
95
|
}), setTimeout(() => q(null), 3e3);
|
|
91
|
-
}, Y =
|
|
92
|
-
let e =
|
|
96
|
+
}, Y = m(() => {
|
|
97
|
+
let e = L.length, t = L.filter((e) => e.status === "pending").length, n = L.filter((e) => [
|
|
93
98
|
"confirmed",
|
|
94
99
|
"preparing",
|
|
95
100
|
"ready",
|
|
96
101
|
"out_for_delivery"
|
|
97
|
-
].includes(e.status)).length, r =
|
|
102
|
+
].includes(e.status)).length, r = L.filter((e) => e.status === "delivered").length, i = L.filter((e) => e.status === "delivered").reduce((e, t) => e + t.total, 0);
|
|
98
103
|
return {
|
|
99
104
|
total: e,
|
|
100
105
|
pending: t,
|
|
@@ -103,17 +108,17 @@ var T = {
|
|
|
103
108
|
totalRevenue: i,
|
|
104
109
|
avgOrder: r > 0 ? Math.round(i / r) : 0
|
|
105
110
|
};
|
|
106
|
-
}, [
|
|
107
|
-
let e = [...
|
|
108
|
-
if (
|
|
109
|
-
let t =
|
|
111
|
+
}, [L]), X = m(() => {
|
|
112
|
+
let e = [...L];
|
|
113
|
+
if (z.status && (e = e.filter((e) => e.status === z.status)), z.fulfillmentType && (e = e.filter((e) => e.fulfillmentType === z.fulfillmentType)), z.searchQuery) {
|
|
114
|
+
let t = z.searchQuery.toLowerCase();
|
|
110
115
|
e = e.filter((e) => e.id.toLowerCase().includes(t) || (e.customerName || "").toLowerCase().includes(t) || e.items.some((e) => e.name.toLowerCase().includes(t)));
|
|
111
116
|
}
|
|
112
|
-
if (
|
|
117
|
+
if (z.dateRange !== "all") {
|
|
113
118
|
let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
|
|
114
|
-
|
|
119
|
+
z.dateRange === "today" ? n.setHours(0, 0, 0, 0) : z.dateRange === "7days" ? n.setDate(t.getDate() - 7) : z.dateRange === "30days" && n.setDate(t.getDate() - 30), e = e.filter((e) => new Date(e.orderDate) >= n);
|
|
115
120
|
}
|
|
116
|
-
switch (
|
|
121
|
+
switch (z.sortBy) {
|
|
117
122
|
case "recent":
|
|
118
123
|
e.sort((e, t) => new Date(t.orderDate).getTime() - new Date(e.orderDate).getTime());
|
|
119
124
|
break;
|
|
@@ -126,24 +131,24 @@ var T = {
|
|
|
126
131
|
case "amount_low": e.sort((e, t) => e.total - t.total);
|
|
127
132
|
}
|
|
128
133
|
return e;
|
|
129
|
-
}, [
|
|
130
|
-
let e = [...
|
|
131
|
-
if (
|
|
132
|
-
let t =
|
|
134
|
+
}, [L, z]), Z = m(() => {
|
|
135
|
+
let e = [...L];
|
|
136
|
+
if (z.fulfillmentType && (e = e.filter((e) => e.fulfillmentType === z.fulfillmentType)), z.searchQuery) {
|
|
137
|
+
let t = z.searchQuery.toLowerCase();
|
|
133
138
|
e = e.filter((e) => e.id.toLowerCase().includes(t) || (e.customerName || "").toLowerCase().includes(t) || e.items.some((e) => e.name.toLowerCase().includes(t)));
|
|
134
139
|
}
|
|
135
|
-
if (
|
|
140
|
+
if (z.dateRange !== "all") {
|
|
136
141
|
let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
|
|
137
|
-
|
|
142
|
+
z.dateRange === "today" ? n.setHours(0, 0, 0, 0) : z.dateRange === "7days" ? n.setDate(t.getDate() - 7) : z.dateRange === "30days" && n.setDate(t.getDate() - 30), e = e.filter((e) => new Date(e.orderDate) >= n);
|
|
138
143
|
}
|
|
139
144
|
return e.sort((e, t) => new Date(t.orderDate).getTime() - new Date(e.orderDate).getTime());
|
|
140
145
|
}, [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
]),
|
|
146
|
-
await
|
|
146
|
+
L,
|
|
147
|
+
z.fulfillmentType,
|
|
148
|
+
z.searchQuery,
|
|
149
|
+
z.dateRange
|
|
150
|
+
]), me = async () => {
|
|
151
|
+
await Promise.all([P(), de.invalidateQueries({ queryKey: ["kadaikodi", "provider-appointments"] })]), J("Orders refreshed", "success");
|
|
147
152
|
}, Q = (e, t) => {
|
|
148
153
|
let n = {
|
|
149
154
|
accept: "confirmed",
|
|
@@ -152,10 +157,10 @@ var T = {
|
|
|
152
157
|
ready: "ready",
|
|
153
158
|
complete: "delivered"
|
|
154
159
|
};
|
|
155
|
-
|
|
160
|
+
R((r) => r.map((r) => r.id === e ? {
|
|
156
161
|
...r,
|
|
157
162
|
status: n[t]
|
|
158
|
-
} : r)),
|
|
163
|
+
} : r)), I.mutate({
|
|
159
164
|
id: e,
|
|
160
165
|
status: {
|
|
161
166
|
accept: "CONFIRMED",
|
|
@@ -172,7 +177,7 @@ var T = {
|
|
|
172
177
|
complete: "Order completed"
|
|
173
178
|
}[t], "success"), W && H?.id === e && G(!1);
|
|
174
179
|
}, $ = (e) => {
|
|
175
|
-
let t =
|
|
180
|
+
let t = O[e.fulfillmentType || "delivery"] || O.delivery, n = t.icon, r = e.status === "pending" ? {
|
|
176
181
|
label: "Accept",
|
|
177
182
|
action: "accept"
|
|
178
183
|
} : e.status === "confirmed" ? {
|
|
@@ -185,50 +190,50 @@ var T = {
|
|
|
185
190
|
label: "Complete",
|
|
186
191
|
action: "complete"
|
|
187
192
|
} : null;
|
|
188
|
-
return /* @__PURE__ */
|
|
193
|
+
return /* @__PURE__ */ E("div", {
|
|
189
194
|
className: "rounded-[var(--radius-input)] border border-border-subtle bg-bg-surface p-3 shadow-sm",
|
|
190
195
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ E("div", {
|
|
192
197
|
className: "mb-1.5 flex items-center justify-between gap-2",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ E("span", {
|
|
194
199
|
className: "truncate text-xs font-medium text-text-secondary",
|
|
195
200
|
children: ["Order #", e.id.slice(0, 8)]
|
|
196
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ T("span", {
|
|
197
202
|
className: "shrink-0 text-[11px] text-text-muted",
|
|
198
|
-
children:
|
|
203
|
+
children: k(e.orderDate)
|
|
199
204
|
})]
|
|
200
205
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ E("div", {
|
|
202
207
|
className: "mb-1.5 flex items-center justify-between gap-2",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ T("span", {
|
|
204
209
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
205
210
|
children: e.customerName || "Customer"
|
|
206
|
-
}), /* @__PURE__ */
|
|
211
|
+
}), /* @__PURE__ */ T("span", {
|
|
207
212
|
className: "shrink-0 text-sm font-bold text-text-primary",
|
|
208
|
-
children:
|
|
213
|
+
children: d(e.total, { minimumFractionDigits: 0 })
|
|
209
214
|
})]
|
|
210
215
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ T("p", {
|
|
212
217
|
className: "mb-2 line-clamp-2 text-xs text-text-secondary",
|
|
213
218
|
children: e.items.map((e) => `${e.name} ×${e.quantity}`).join(", ")
|
|
214
219
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ T("div", {
|
|
216
221
|
className: "mb-2 flex items-center gap-1.5",
|
|
217
|
-
children: /* @__PURE__ */
|
|
218
|
-
className:
|
|
219
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: /* @__PURE__ */ E("span", {
|
|
223
|
+
className: f("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium", t.color),
|
|
224
|
+
children: [/* @__PURE__ */ T(n, { className: "h-3 w-3" }), t.label]
|
|
220
225
|
})
|
|
221
226
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ E("div", {
|
|
223
228
|
className: "flex gap-1.5",
|
|
224
229
|
children: [
|
|
225
|
-
r && /* @__PURE__ */
|
|
230
|
+
r && /* @__PURE__ */ T("button", {
|
|
226
231
|
type: "button",
|
|
227
232
|
onClick: () => Q(e.id, r.action),
|
|
228
233
|
className: "flex-1 rounded-md bg-action-primary-bg px-2.5 py-1.5 text-xs font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
229
234
|
children: r.label
|
|
230
235
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ T("button", {
|
|
232
237
|
type: "button",
|
|
233
238
|
onClick: () => {
|
|
234
239
|
U(e), G(!0);
|
|
@@ -236,34 +241,34 @@ var T = {
|
|
|
236
241
|
className: "rounded-md border border-border-subtle px-2.5 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
237
242
|
children: "Details"
|
|
238
243
|
}),
|
|
239
|
-
e.status === "pending" && /* @__PURE__ */
|
|
244
|
+
e.status === "pending" && /* @__PURE__ */ T("button", {
|
|
240
245
|
type: "button",
|
|
241
246
|
onClick: () => Q(e.id, "reject"),
|
|
242
247
|
"aria-label": "Reject order",
|
|
243
248
|
className: "rounded-md border border-border-subtle px-2 py-1.5 text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
|
|
244
|
-
children: /* @__PURE__ */ C
|
|
249
|
+
children: /* @__PURE__ */ T(C, { className: "h-3.5 w-3.5" })
|
|
245
250
|
})
|
|
246
251
|
]
|
|
247
252
|
})
|
|
248
253
|
]
|
|
249
254
|
});
|
|
250
|
-
},
|
|
255
|
+
}, he = [
|
|
251
256
|
{
|
|
252
257
|
id: "new",
|
|
253
258
|
title: "New",
|
|
254
|
-
accent:
|
|
259
|
+
accent: s.warning,
|
|
255
260
|
items: Z.filter((e) => e.status === "pending").map($)
|
|
256
261
|
},
|
|
257
262
|
{
|
|
258
263
|
id: "preparing",
|
|
259
264
|
title: "Preparing",
|
|
260
|
-
accent:
|
|
265
|
+
accent: s.info,
|
|
261
266
|
items: Z.filter((e) => e.status === "confirmed" || e.status === "preparing").map($)
|
|
262
267
|
},
|
|
263
268
|
{
|
|
264
269
|
id: "ready",
|
|
265
270
|
title: "Ready",
|
|
266
|
-
accent:
|
|
271
|
+
accent: s.success,
|
|
267
272
|
items: Z.filter((e) => e.status === "ready" || e.status === "out_for_delivery").map($)
|
|
268
273
|
},
|
|
269
274
|
{
|
|
@@ -272,81 +277,85 @@ var T = {
|
|
|
272
277
|
items: Z.filter((e) => e.status === "delivered").map($)
|
|
273
278
|
}
|
|
274
279
|
];
|
|
275
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ E(e, {
|
|
276
281
|
title: "Order Management",
|
|
277
282
|
description: "Manage incoming and active orders",
|
|
278
|
-
actions: /* @__PURE__ */
|
|
283
|
+
actions: /* @__PURE__ */ E("button", {
|
|
279
284
|
type: "button",
|
|
280
|
-
onClick:
|
|
281
|
-
disabled:
|
|
285
|
+
onClick: me,
|
|
286
|
+
disabled: F,
|
|
282
287
|
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors disabled:opacity-60 disabled:cursor-not-allowed",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ T(re, { className: f("h-4 w-4", F && "animate-spin") }), "Refresh"]
|
|
284
289
|
}),
|
|
285
290
|
children: [
|
|
286
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ T(se, {
|
|
287
292
|
className: "mb-6",
|
|
288
293
|
children: "Your live order queue. Use this page to run service as it happens — accept new orders, move them through preparing and ready, hand off for pickup, delivery or cart dispatch, and keep customers updated. Filter by status or type to focus on what needs doing right now, and watch today's totals so you know how the day is going."
|
|
289
294
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ E("div", {
|
|
291
296
|
className: "space-y-4",
|
|
292
297
|
children: [
|
|
293
|
-
K && /* @__PURE__ */
|
|
294
|
-
className:
|
|
295
|
-
children: [K.type === "success" ? /* @__PURE__ */
|
|
296
|
-
className:
|
|
298
|
+
K && /* @__PURE__ */ E("div", {
|
|
299
|
+
className: f("flex items-center gap-2 rounded-lg border p-3", K.type === "success" ? "border-status-success-text/30 bg-status-success-bg-subtle" : "border-status-error-text/30 bg-status-error-bg-subtle"),
|
|
300
|
+
children: [K.type === "success" ? /* @__PURE__ */ T(g, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ T(te, { className: "h-4 w-4 text-status-error-text" }), /* @__PURE__ */ T("span", {
|
|
301
|
+
className: f("text-sm font-medium", K.type === "success" ? "text-status-success-text" : "text-status-error-text"),
|
|
297
302
|
children: K.text
|
|
298
303
|
})]
|
|
299
304
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ E(oe, { children: [/* @__PURE__ */ T("h2", {
|
|
301
306
|
className: "mb-4 text-base font-semibold text-text-primary",
|
|
302
307
|
children: "Orders Overview"
|
|
303
|
-
}), /* @__PURE__ */
|
|
308
|
+
}), /* @__PURE__ */ E("div", {
|
|
304
309
|
className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",
|
|
305
310
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ T(c, {
|
|
307
312
|
label: "Total Orders",
|
|
308
313
|
value: Y.total,
|
|
309
|
-
icon: /* @__PURE__ */
|
|
314
|
+
icon: /* @__PURE__ */ T(x, { className: "h-4 w-4" })
|
|
310
315
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ T(c, {
|
|
312
317
|
label: "Pending",
|
|
313
|
-
value: /* @__PURE__ */
|
|
318
|
+
value: /* @__PURE__ */ T("span", {
|
|
314
319
|
className: "text-status-warning-text",
|
|
315
320
|
children: Y.pending
|
|
316
321
|
}),
|
|
317
|
-
icon: /* @__PURE__ */
|
|
322
|
+
icon: /* @__PURE__ */ T(ne, { className: "h-4 w-4" })
|
|
318
323
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ T(c, {
|
|
320
325
|
label: "Active",
|
|
321
326
|
value: Y.active,
|
|
322
|
-
icon: /* @__PURE__ */
|
|
327
|
+
icon: /* @__PURE__ */ T(_, { className: "h-4 w-4" })
|
|
323
328
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ T(c, {
|
|
325
330
|
label: "Completed",
|
|
326
|
-
value: /* @__PURE__ */
|
|
331
|
+
value: /* @__PURE__ */ T("span", {
|
|
327
332
|
className: "text-status-success-text",
|
|
328
333
|
children: Y.completed
|
|
329
334
|
}),
|
|
330
|
-
icon: /* @__PURE__ */
|
|
335
|
+
icon: /* @__PURE__ */ T(g, { className: "h-4 w-4" })
|
|
331
336
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ T(c, {
|
|
333
338
|
label: "Total Revenue",
|
|
334
|
-
value:
|
|
335
|
-
icon: /* @__PURE__ */
|
|
339
|
+
value: d(Y.totalRevenue, { minimumFractionDigits: 0 }),
|
|
340
|
+
icon: /* @__PURE__ */ T(y, { className: "h-4 w-4" })
|
|
336
341
|
}),
|
|
337
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ T(c, {
|
|
338
343
|
label: "Avg Order",
|
|
339
|
-
value:
|
|
340
|
-
icon: /* @__PURE__ */
|
|
344
|
+
value: d(Y.avgOrder, { minimumFractionDigits: 0 }),
|
|
345
|
+
icon: /* @__PURE__ */ T(S, { className: "h-4 w-4" })
|
|
341
346
|
})
|
|
342
347
|
]
|
|
343
348
|
})] }),
|
|
344
|
-
/* @__PURE__ */
|
|
349
|
+
M && /* @__PURE__ */ T(n, {
|
|
350
|
+
providerId: M.id,
|
|
351
|
+
onMessage: J
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ E("div", {
|
|
345
354
|
className: "flex items-center justify-between gap-3",
|
|
346
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ T(u, {
|
|
347
356
|
"aria-label": "Order view",
|
|
348
|
-
value:
|
|
349
|
-
onChange: (e) =>
|
|
357
|
+
value: V,
|
|
358
|
+
onChange: (e) => pe(e),
|
|
350
359
|
tabs: [{
|
|
351
360
|
id: "board",
|
|
352
361
|
label: "Board"
|
|
@@ -354,7 +363,7 @@ var T = {
|
|
|
354
363
|
id: "list",
|
|
355
364
|
label: "List"
|
|
356
365
|
}]
|
|
357
|
-
}), /* @__PURE__ */
|
|
366
|
+
}), /* @__PURE__ */ E("p", {
|
|
358
367
|
className: "text-xs text-text-secondary",
|
|
359
368
|
children: [
|
|
360
369
|
Z.length,
|
|
@@ -364,135 +373,135 @@ var T = {
|
|
|
364
373
|
]
|
|
365
374
|
})]
|
|
366
375
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ T("div", {
|
|
368
377
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
369
|
-
children: /* @__PURE__ */
|
|
378
|
+
children: /* @__PURE__ */ E("div", {
|
|
370
379
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-3",
|
|
371
380
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ E("div", {
|
|
373
382
|
className: "relative sm:col-span-2 lg:col-span-1",
|
|
374
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ T(ie, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ T("input", {
|
|
375
384
|
type: "text",
|
|
376
385
|
placeholder: "Search orders...",
|
|
377
|
-
value:
|
|
378
|
-
onChange: (e) =>
|
|
386
|
+
value: z.searchQuery,
|
|
387
|
+
onChange: (e) => B((t) => ({
|
|
379
388
|
...t,
|
|
380
389
|
searchQuery: e.target.value
|
|
381
390
|
})),
|
|
382
391
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface pl-10 pr-4 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
383
392
|
})]
|
|
384
393
|
}),
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
value:
|
|
387
|
-
onChange: (e) =>
|
|
394
|
+
/* @__PURE__ */ E("select", {
|
|
395
|
+
value: z.status,
|
|
396
|
+
onChange: (e) => B((t) => ({
|
|
388
397
|
...t,
|
|
389
398
|
status: e.target.value
|
|
390
399
|
})),
|
|
391
400
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
392
401
|
children: [
|
|
393
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ T("option", {
|
|
394
403
|
value: "",
|
|
395
404
|
children: "All Orders"
|
|
396
405
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ T("option", {
|
|
398
407
|
value: "pending",
|
|
399
408
|
children: "New Orders"
|
|
400
409
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ T("option", {
|
|
402
411
|
value: "confirmed",
|
|
403
412
|
children: "Confirmed"
|
|
404
413
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ T("option", {
|
|
406
415
|
value: "preparing",
|
|
407
416
|
children: "Preparing"
|
|
408
417
|
}),
|
|
409
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ T("option", {
|
|
410
419
|
value: "ready",
|
|
411
420
|
children: "Ready"
|
|
412
421
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ T("option", {
|
|
414
423
|
value: "delivered",
|
|
415
424
|
children: "Completed"
|
|
416
425
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ T("option", {
|
|
418
427
|
value: "cancelled",
|
|
419
428
|
children: "Cancelled"
|
|
420
429
|
})
|
|
421
430
|
]
|
|
422
431
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
value:
|
|
425
|
-
onChange: (e) =>
|
|
432
|
+
/* @__PURE__ */ E("select", {
|
|
433
|
+
value: z.fulfillmentType,
|
|
434
|
+
onChange: (e) => B((t) => ({
|
|
426
435
|
...t,
|
|
427
436
|
fulfillmentType: e.target.value
|
|
428
437
|
})),
|
|
429
438
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
430
439
|
children: [
|
|
431
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ T("option", {
|
|
432
441
|
value: "",
|
|
433
442
|
children: "All Types"
|
|
434
443
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ T("option", {
|
|
436
445
|
value: "pickup",
|
|
437
446
|
children: "Pickup"
|
|
438
447
|
}),
|
|
439
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ T("option", {
|
|
440
449
|
value: "delivery",
|
|
441
450
|
children: "Delivery"
|
|
442
451
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ T("option", {
|
|
444
453
|
value: "cart_dispatch",
|
|
445
454
|
children: "Cart Dispatch"
|
|
446
455
|
})
|
|
447
456
|
]
|
|
448
457
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
value:
|
|
451
|
-
onChange: (e) =>
|
|
458
|
+
/* @__PURE__ */ E("select", {
|
|
459
|
+
value: z.dateRange,
|
|
460
|
+
onChange: (e) => B((t) => ({
|
|
452
461
|
...t,
|
|
453
462
|
dateRange: e.target.value
|
|
454
463
|
})),
|
|
455
464
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
456
465
|
children: [
|
|
457
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ T("option", {
|
|
458
467
|
value: "today",
|
|
459
468
|
children: "Today"
|
|
460
469
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ T("option", {
|
|
462
471
|
value: "7days",
|
|
463
472
|
children: "Last 7 Days"
|
|
464
473
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ T("option", {
|
|
466
475
|
value: "30days",
|
|
467
476
|
children: "Last 30 Days"
|
|
468
477
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ T("option", {
|
|
470
479
|
value: "all",
|
|
471
480
|
children: "All Time"
|
|
472
481
|
})
|
|
473
482
|
]
|
|
474
483
|
}),
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
value:
|
|
477
|
-
onChange: (e) =>
|
|
484
|
+
/* @__PURE__ */ E("select", {
|
|
485
|
+
value: z.sortBy,
|
|
486
|
+
onChange: (e) => B((t) => ({
|
|
478
487
|
...t,
|
|
479
488
|
sortBy: e.target.value
|
|
480
489
|
})),
|
|
481
490
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
482
491
|
children: [
|
|
483
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ T("option", {
|
|
484
493
|
value: "recent",
|
|
485
494
|
children: "Most Recent"
|
|
486
495
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ T("option", {
|
|
488
497
|
value: "oldest",
|
|
489
498
|
children: "Oldest First"
|
|
490
499
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ T("option", {
|
|
492
501
|
value: "amount_high",
|
|
493
502
|
children: "Amount: High to Low"
|
|
494
503
|
}),
|
|
495
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ T("option", {
|
|
496
505
|
value: "amount_low",
|
|
497
506
|
children: "Amount: Low to High"
|
|
498
507
|
})
|
|
@@ -501,66 +510,66 @@ var T = {
|
|
|
501
510
|
]
|
|
502
511
|
})
|
|
503
512
|
}),
|
|
504
|
-
|
|
513
|
+
fe ? /* @__PURE__ */ T("div", {
|
|
505
514
|
className: "flex items-center justify-center py-16",
|
|
506
|
-
children: /* @__PURE__ */
|
|
507
|
-
}) :
|
|
508
|
-
illustration:
|
|
515
|
+
children: /* @__PURE__ */ T("div", { className: "h-10 w-10 animate-spin rounded-full border-b-2 border-foreground" })
|
|
516
|
+
}) : V === "board" ? Z.length === 0 ? /* @__PURE__ */ T(t, {
|
|
517
|
+
illustration: z.searchQuery ? "empty-search" : "empty-data",
|
|
509
518
|
title: "No orders found",
|
|
510
519
|
description: "New orders from customers appear on the board in real time. Make sure your cart is open and accepting orders."
|
|
511
|
-
}) : /* @__PURE__ */
|
|
512
|
-
columns:
|
|
520
|
+
}) : /* @__PURE__ */ T(l, {
|
|
521
|
+
columns: he,
|
|
513
522
|
emptyColumnHint: "No orders"
|
|
514
|
-
}) : X.length === 0 ? /* @__PURE__ */
|
|
515
|
-
illustration:
|
|
523
|
+
}) : X.length === 0 ? /* @__PURE__ */ T(t, {
|
|
524
|
+
illustration: z.searchQuery || z.status ? "empty-search" : "empty-data",
|
|
516
525
|
title: "No orders found",
|
|
517
|
-
description:
|
|
518
|
-
}) : /* @__PURE__ */
|
|
526
|
+
description: z.searchQuery || z.status ? "No orders match your current filters. Try adjusting the status, type or date range." : "New orders from customers will appear here in real time. Make sure your cart is open and accepting orders."
|
|
527
|
+
}) : /* @__PURE__ */ T("div", {
|
|
519
528
|
className: "space-y-4",
|
|
520
529
|
children: X.map((e) => {
|
|
521
|
-
let t =
|
|
530
|
+
let t = D[e.status] || {
|
|
522
531
|
color: "bg-bg-sunken text-text-secondary",
|
|
523
532
|
label: e.status
|
|
524
|
-
}, n =
|
|
525
|
-
return /* @__PURE__ */
|
|
526
|
-
className:
|
|
527
|
-
children: /* @__PURE__ */
|
|
533
|
+
}, n = O[e.fulfillmentType || "delivery"] || O.delivery, r = n.icon;
|
|
534
|
+
return /* @__PURE__ */ T("div", {
|
|
535
|
+
className: f("rounded-lg border bg-bg-surface shadow-sm transition-shadow hover:shadow-md", le(e)),
|
|
536
|
+
children: /* @__PURE__ */ E("div", {
|
|
528
537
|
className: "p-4 sm:p-5",
|
|
529
538
|
children: [
|
|
530
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ E("div", {
|
|
531
540
|
className: "flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3 mb-3",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
541
|
+
children: [/* @__PURE__ */ E("div", {
|
|
533
542
|
className: "min-w-0 flex-1",
|
|
534
|
-
children: [/* @__PURE__ */
|
|
543
|
+
children: [/* @__PURE__ */ E("div", {
|
|
535
544
|
className: "flex flex-wrap items-center gap-2 mb-1",
|
|
536
545
|
children: [
|
|
537
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ E("h3", {
|
|
538
547
|
className: "text-sm sm:text-base font-semibold text-text-primary",
|
|
539
548
|
children: ["Order #", e.id]
|
|
540
549
|
}),
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
className:
|
|
550
|
+
/* @__PURE__ */ T("span", {
|
|
551
|
+
className: f("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", t.color),
|
|
543
552
|
children: t.label
|
|
544
553
|
}),
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
className:
|
|
547
|
-
children: [/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ E("span", {
|
|
555
|
+
className: f("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium", n.color),
|
|
556
|
+
children: [/* @__PURE__ */ T(r, { className: "h-3 w-3" }), n.label]
|
|
548
557
|
})
|
|
549
558
|
]
|
|
550
|
-
}), /* @__PURE__ */
|
|
559
|
+
}), /* @__PURE__ */ E("p", {
|
|
551
560
|
className: "text-xs text-text-secondary",
|
|
552
561
|
children: [
|
|
553
562
|
e.customerName || "Customer",
|
|
554
563
|
" | ",
|
|
555
|
-
|
|
564
|
+
k(e.orderDate)
|
|
556
565
|
]
|
|
557
566
|
})]
|
|
558
|
-
}), /* @__PURE__ */
|
|
567
|
+
}), /* @__PURE__ */ E("div", {
|
|
559
568
|
className: "flex items-center gap-3",
|
|
560
|
-
children: [/* @__PURE__ */
|
|
569
|
+
children: [/* @__PURE__ */ T("p", {
|
|
561
570
|
className: "text-lg font-bold text-text-primary",
|
|
562
|
-
children:
|
|
563
|
-
}), /* @__PURE__ */
|
|
571
|
+
children: d(e.total, { minimumFractionDigits: 0 })
|
|
572
|
+
}), /* @__PURE__ */ T("button", {
|
|
564
573
|
type: "button",
|
|
565
574
|
onClick: () => {
|
|
566
575
|
U(e), G(!0);
|
|
@@ -570,11 +579,11 @@ var T = {
|
|
|
570
579
|
})]
|
|
571
580
|
})]
|
|
572
581
|
}),
|
|
573
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ T("div", {
|
|
574
583
|
className: "border-t border-border-subtle pt-3 mb-3",
|
|
575
|
-
children: /* @__PURE__ */
|
|
584
|
+
children: /* @__PURE__ */ T("div", {
|
|
576
585
|
className: "flex flex-wrap gap-2",
|
|
577
|
-
children: e.items.map((e, t) => /* @__PURE__ */
|
|
586
|
+
children: e.items.map((e, t) => /* @__PURE__ */ E("span", {
|
|
578
587
|
className: "inline-flex items-center rounded bg-bg-sunken px-2 py-1 text-xs text-text-primary",
|
|
579
588
|
children: [
|
|
580
589
|
e.quantity,
|
|
@@ -584,55 +593,55 @@ var T = {
|
|
|
584
593
|
}, t))
|
|
585
594
|
})
|
|
586
595
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ E("div", {
|
|
588
597
|
className: "flex flex-wrap gap-2",
|
|
589
598
|
children: [
|
|
590
|
-
e.status === "pending" && /* @__PURE__ */ w
|
|
599
|
+
e.status === "pending" && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ E("button", {
|
|
591
600
|
type: "button",
|
|
592
601
|
onClick: () => Q(e.id, "accept"),
|
|
593
602
|
className: "inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-3 py-2 text-xs font-medium text-status-success-text hover:bg-status-success-bg-subtle transition-colors",
|
|
594
|
-
children: [/* @__PURE__ */
|
|
595
|
-
}), /* @__PURE__ */
|
|
603
|
+
children: [/* @__PURE__ */ T(g, { className: "h-3.5 w-3.5" }), "Accept Order"]
|
|
604
|
+
}), /* @__PURE__ */ E("button", {
|
|
596
605
|
type: "button",
|
|
597
606
|
onClick: () => Q(e.id, "reject"),
|
|
598
607
|
className: "inline-flex items-center gap-1.5 rounded-md bg-status-error-bg-subtle px-3 py-2 text-xs font-medium text-status-error-text hover:bg-status-error-bg-subtle transition-colors",
|
|
599
|
-
children: [/* @__PURE__ */ C
|
|
608
|
+
children: [/* @__PURE__ */ T(C, { className: "h-3.5 w-3.5" }), "Reject"]
|
|
600
609
|
})] }),
|
|
601
|
-
e.status === "confirmed" && /* @__PURE__ */
|
|
610
|
+
e.status === "confirmed" && /* @__PURE__ */ E("button", {
|
|
602
611
|
type: "button",
|
|
603
612
|
onClick: () => Q(e.id, "prepare"),
|
|
604
613
|
className: "inline-flex items-center gap-1.5 rounded-md bg-status-warning-bg-subtle px-3 py-2 text-xs font-medium text-status-warning-text hover:bg-status-warning-bg-subtle transition-colors",
|
|
605
|
-
children: [/* @__PURE__ */
|
|
614
|
+
children: [/* @__PURE__ */ T(_, { className: "h-3.5 w-3.5" }), "Start Preparing"]
|
|
606
615
|
}),
|
|
607
|
-
e.status === "preparing" && /* @__PURE__ */
|
|
616
|
+
e.status === "preparing" && /* @__PURE__ */ E("button", {
|
|
608
617
|
type: "button",
|
|
609
618
|
onClick: () => Q(e.id, "ready"),
|
|
610
619
|
className: "inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-3 py-2 text-xs font-medium text-status-success-text hover:bg-status-success-bg-subtle transition-colors",
|
|
611
|
-
children: [/* @__PURE__ */
|
|
620
|
+
children: [/* @__PURE__ */ T(y, { className: "h-3.5 w-3.5" }), "Mark as Ready"]
|
|
612
621
|
}),
|
|
613
|
-
e.status === "ready" && e.fulfillmentType === "pickup" && /* @__PURE__ */
|
|
622
|
+
e.status === "ready" && e.fulfillmentType === "pickup" && /* @__PURE__ */ E("button", {
|
|
614
623
|
type: "button",
|
|
615
624
|
onClick: () => Q(e.id, "complete"),
|
|
616
625
|
className: "inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-3 py-2 text-xs font-medium text-status-success-text hover:bg-status-success-bg-subtle transition-colors",
|
|
617
|
-
children: [/* @__PURE__ */
|
|
626
|
+
children: [/* @__PURE__ */ T(g, { className: "h-3.5 w-3.5" }), "Complete Order"]
|
|
618
627
|
}),
|
|
619
628
|
[
|
|
620
629
|
"confirmed",
|
|
621
630
|
"preparing",
|
|
622
631
|
"ready"
|
|
623
|
-
].includes(e.status) && e.customerPhone && /* @__PURE__ */
|
|
632
|
+
].includes(e.status) && e.customerPhone && /* @__PURE__ */ E("a", {
|
|
624
633
|
href: `tel:${e.customerPhone}`,
|
|
625
634
|
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-xs font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
626
|
-
children: [/* @__PURE__ */
|
|
635
|
+
children: [/* @__PURE__ */ T(b, { className: "h-3.5 w-3.5" }), "Contact Customer"]
|
|
627
636
|
})
|
|
628
637
|
]
|
|
629
638
|
}),
|
|
630
|
-
e.specialInstructions && /* @__PURE__ */
|
|
639
|
+
e.specialInstructions && /* @__PURE__ */ E("div", {
|
|
631
640
|
className: "mt-3 rounded-md border border-status-warning-text/30 bg-status-warning-bg-subtle p-3",
|
|
632
|
-
children: [/* @__PURE__ */
|
|
641
|
+
children: [/* @__PURE__ */ T("p", {
|
|
633
642
|
className: "text-xs font-medium text-status-warning-text",
|
|
634
643
|
children: "Special Instructions:"
|
|
635
|
-
}), /* @__PURE__ */
|
|
644
|
+
}), /* @__PURE__ */ T("p", {
|
|
636
645
|
className: "text-xs text-status-warning-text mt-0.5",
|
|
637
646
|
children: e.specialInstructions
|
|
638
647
|
})]
|
|
@@ -644,138 +653,138 @@ var T = {
|
|
|
644
653
|
})
|
|
645
654
|
]
|
|
646
655
|
}),
|
|
647
|
-
W && H && /* @__PURE__ */
|
|
656
|
+
W && H && /* @__PURE__ */ T("div", {
|
|
648
657
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
649
|
-
children: /* @__PURE__ */
|
|
658
|
+
children: /* @__PURE__ */ T("div", {
|
|
650
659
|
className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-xl",
|
|
651
|
-
children: /* @__PURE__ */
|
|
660
|
+
children: /* @__PURE__ */ E("div", {
|
|
652
661
|
className: "p-6",
|
|
653
|
-
children: [/* @__PURE__ */
|
|
662
|
+
children: [/* @__PURE__ */ E("div", {
|
|
654
663
|
className: "flex items-center justify-between mb-4",
|
|
655
|
-
children: [/* @__PURE__ */
|
|
664
|
+
children: [/* @__PURE__ */ T("h3", {
|
|
656
665
|
className: "text-lg font-semibold text-text-primary",
|
|
657
666
|
children: "Order Details"
|
|
658
|
-
}), /* @__PURE__ */
|
|
667
|
+
}), /* @__PURE__ */ T("button", {
|
|
659
668
|
type: "button",
|
|
660
669
|
onClick: () => G(!1),
|
|
661
670
|
className: "rounded p-1.5 text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors",
|
|
662
|
-
children: /* @__PURE__ */
|
|
671
|
+
children: /* @__PURE__ */ T(ae, { className: "h-5 w-5" })
|
|
663
672
|
})]
|
|
664
|
-
}), /* @__PURE__ */
|
|
673
|
+
}), /* @__PURE__ */ E("div", {
|
|
665
674
|
className: "space-y-4",
|
|
666
675
|
children: [
|
|
667
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ E("div", {
|
|
668
677
|
className: "grid grid-cols-2 gap-4",
|
|
669
678
|
children: [
|
|
670
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
671
680
|
className: "text-xs text-text-secondary",
|
|
672
681
|
children: "Order ID"
|
|
673
|
-
}), /* @__PURE__ */
|
|
682
|
+
}), /* @__PURE__ */ E("p", {
|
|
674
683
|
className: "text-sm font-medium text-text-primary",
|
|
675
684
|
children: ["#", H.id]
|
|
676
685
|
})] }),
|
|
677
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
678
687
|
className: "text-xs text-text-secondary",
|
|
679
688
|
children: "Status"
|
|
680
|
-
}), /* @__PURE__ */
|
|
681
|
-
className:
|
|
682
|
-
children: (
|
|
689
|
+
}), /* @__PURE__ */ T("span", {
|
|
690
|
+
className: f("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium mt-0.5", (D[H.status] || D.pending).color),
|
|
691
|
+
children: (D[H.status] || D.pending).label
|
|
683
692
|
})] }),
|
|
684
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
685
694
|
className: "text-xs text-text-secondary",
|
|
686
695
|
children: "Customer"
|
|
687
|
-
}), /* @__PURE__ */
|
|
696
|
+
}), /* @__PURE__ */ T("p", {
|
|
688
697
|
className: "text-sm font-medium text-text-primary",
|
|
689
698
|
children: H.customerName || "N/A"
|
|
690
699
|
})] }),
|
|
691
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
692
701
|
className: "text-xs text-text-secondary",
|
|
693
702
|
children: "Order Time"
|
|
694
|
-
}), /* @__PURE__ */
|
|
703
|
+
}), /* @__PURE__ */ T("p", {
|
|
695
704
|
className: "text-sm font-medium text-text-primary",
|
|
696
|
-
children:
|
|
705
|
+
children: ce(H.orderDate)
|
|
697
706
|
})] })
|
|
698
707
|
]
|
|
699
708
|
}),
|
|
700
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ E("div", {
|
|
701
710
|
className: "border-t border-border-subtle pt-4",
|
|
702
|
-
children: [/* @__PURE__ */
|
|
711
|
+
children: [/* @__PURE__ */ T("h4", {
|
|
703
712
|
className: "text-sm font-medium text-text-primary mb-3",
|
|
704
713
|
children: "Order Items"
|
|
705
|
-
}), /* @__PURE__ */
|
|
714
|
+
}), /* @__PURE__ */ T("div", {
|
|
706
715
|
className: "space-y-2",
|
|
707
|
-
children: H.items.map((e, t) => /* @__PURE__ */
|
|
716
|
+
children: H.items.map((e, t) => /* @__PURE__ */ E("div", {
|
|
708
717
|
className: "flex justify-between items-start",
|
|
709
|
-
children: [/* @__PURE__ */
|
|
718
|
+
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
710
719
|
className: "text-sm font-medium text-text-primary",
|
|
711
720
|
children: e.name
|
|
712
|
-
}), /* @__PURE__ */
|
|
721
|
+
}), /* @__PURE__ */ E("p", {
|
|
713
722
|
className: "text-xs text-text-secondary",
|
|
714
723
|
children: [
|
|
715
|
-
|
|
724
|
+
d(e.price, { minimumFractionDigits: 0 }),
|
|
716
725
|
" x",
|
|
717
726
|
" ",
|
|
718
727
|
e.quantity
|
|
719
728
|
]
|
|
720
|
-
})] }), /* @__PURE__ */
|
|
729
|
+
})] }), /* @__PURE__ */ T("p", {
|
|
721
730
|
className: "text-sm font-medium text-text-primary",
|
|
722
|
-
children:
|
|
731
|
+
children: d(e.price * e.quantity, { minimumFractionDigits: 0 })
|
|
723
732
|
})]
|
|
724
733
|
}, t))
|
|
725
734
|
})]
|
|
726
735
|
}),
|
|
727
|
-
/* @__PURE__ */
|
|
736
|
+
/* @__PURE__ */ E("div", {
|
|
728
737
|
className: "border-t border-border-subtle pt-4 space-y-2",
|
|
729
738
|
children: [
|
|
730
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ E("div", {
|
|
731
740
|
className: "flex justify-between text-sm text-text-secondary",
|
|
732
|
-
children: [/* @__PURE__ */
|
|
741
|
+
children: [/* @__PURE__ */ T("span", { children: "Subtotal" }), /* @__PURE__ */ T("span", { children: d(H.subtotal, { minimumFractionDigits: 0 }) })]
|
|
733
742
|
}),
|
|
734
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ E("div", {
|
|
735
744
|
className: "flex justify-between text-sm text-text-secondary",
|
|
736
|
-
children: [/* @__PURE__ */
|
|
745
|
+
children: [/* @__PURE__ */ T("span", { children: "Delivery Fee" }), /* @__PURE__ */ T("span", { children: d(H.deliveryFee, { minimumFractionDigits: 0 }) })]
|
|
737
746
|
}),
|
|
738
|
-
/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */ E("div", {
|
|
739
748
|
className: "flex justify-between text-sm text-text-secondary",
|
|
740
|
-
children: [/* @__PURE__ */
|
|
749
|
+
children: [/* @__PURE__ */ T("span", { children: "Tax" }), /* @__PURE__ */ T("span", { children: d(H.taxes, { minimumFractionDigits: 0 }) })]
|
|
741
750
|
}),
|
|
742
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ E("div", {
|
|
743
752
|
className: "flex justify-between font-semibold text-text-primary pt-2 border-t border-border-subtle",
|
|
744
|
-
children: [/* @__PURE__ */
|
|
753
|
+
children: [/* @__PURE__ */ T("span", { children: "Total" }), /* @__PURE__ */ T("span", { children: d(H.total, { minimumFractionDigits: 0 }) })]
|
|
745
754
|
})
|
|
746
755
|
]
|
|
747
756
|
}),
|
|
748
|
-
H.fulfillmentType === "delivery" && H.deliveryAddress && /* @__PURE__ */
|
|
757
|
+
H.fulfillmentType === "delivery" && H.deliveryAddress && /* @__PURE__ */ E("div", {
|
|
749
758
|
className: "border-t border-border-subtle pt-4",
|
|
750
|
-
children: [/* @__PURE__ */
|
|
759
|
+
children: [/* @__PURE__ */ E("h4", {
|
|
751
760
|
className: "text-sm font-medium text-text-primary mb-2 flex items-center gap-1.5",
|
|
752
|
-
children: [/* @__PURE__ */
|
|
753
|
-
}), /* @__PURE__ */
|
|
761
|
+
children: [/* @__PURE__ */ T(v, { className: "h-4 w-4 text-text-secondary" }), "Delivery Address"]
|
|
762
|
+
}), /* @__PURE__ */ E("p", {
|
|
754
763
|
className: "text-sm text-text-secondary",
|
|
755
764
|
children: [
|
|
756
765
|
H.deliveryAddress.street,
|
|
757
766
|
", ",
|
|
758
767
|
H.deliveryAddress.area,
|
|
759
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ T("br", {}),
|
|
760
769
|
H.deliveryAddress.city,
|
|
761
770
|
" - ",
|
|
762
771
|
H.deliveryAddress.pincode
|
|
763
772
|
]
|
|
764
773
|
})]
|
|
765
774
|
}),
|
|
766
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ E("div", {
|
|
767
776
|
className: "flex gap-3 mt-6",
|
|
768
|
-
children: [/* @__PURE__ */
|
|
777
|
+
children: [/* @__PURE__ */ T("button", {
|
|
769
778
|
type: "button",
|
|
770
779
|
onClick: () => G(!1),
|
|
771
780
|
className: "flex-1 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
772
781
|
children: "Close"
|
|
773
|
-
}), H.status === "pending" && /* @__PURE__ */ w
|
|
782
|
+
}), H.status === "pending" && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("button", {
|
|
774
783
|
type: "button",
|
|
775
784
|
onClick: () => Q(H.id, "accept"),
|
|
776
785
|
className: "flex-1 rounded-md bg-status-success-bg-subtle px-4 py-2 text-sm font-medium text-status-success-text hover:bg-status-success-bg-subtle transition-colors",
|
|
777
786
|
children: "Accept Order"
|
|
778
|
-
}), /* @__PURE__ */
|
|
787
|
+
}), /* @__PURE__ */ T("button", {
|
|
779
788
|
type: "button",
|
|
780
789
|
onClick: () => Q(H.id, "reject"),
|
|
781
790
|
className: "flex-1 rounded-md bg-status-error-bg-subtle px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle transition-colors",
|
|
@@ -790,6 +799,6 @@ var T = {
|
|
|
790
799
|
]
|
|
791
800
|
});
|
|
792
801
|
};
|
|
793
|
-
export {
|
|
802
|
+
export { ue as OrderManagementPage };
|
|
794
803
|
|
|
795
804
|
//# sourceMappingURL=OrderManagementPage.js.map
|