@burdenoff/microfe-movethewheels 2026.1031.3 → 2026.1031.5
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/MoveTheWheelsRoot.js +136 -127
- package/dist/MoveTheWheelsRoutes.js +143 -135
- package/dist/components/DocumentsCard.js +11 -11
- package/dist/components/ProofOfDeliveryCard.js +13 -13
- package/dist/components/ShipmentRiskDialog.js +24 -24
- package/dist/components/ShippingQuoteResults.js +46 -46
- package/dist/components/TrackingAlertList.js +17 -17
- package/dist/generated/tracking-quality-operations.d.ts +56 -0
- package/dist/hooks/useOrderDispatch.js +17 -17
- package/dist/movethewheels/pages/SettingsPage.d.ts +1 -0
- package/dist/movethewheels/providers/ModuleSettingsProvider.d.ts +17 -0
- package/dist/movethewheels/utils/formatters.d.ts +23 -3
- package/dist/movethewheels/utils/moduleSettings.d.ts +52 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +13 -0
- package/dist/pages/AnalyticsPage.js +27 -27
- package/dist/pages/CreateOrderPage.js +340 -317
- package/dist/pages/CustomerDetailsPage.js +246 -246
- package/dist/pages/CustomersPage.js +19 -19
- package/dist/pages/DashboardPage.js +24 -24
- package/dist/pages/DeliveryCapturePage.js +74 -74
- package/dist/pages/DriverDetailsPage.js +337 -337
- package/dist/pages/DriversPage.js +26 -26
- package/dist/pages/FinancePage.js +26 -26
- package/dist/pages/InventoryPage.js +28 -28
- package/dist/pages/LiveTrackingPage.js +108 -108
- package/dist/pages/MarketplacePage.js +44 -44
- package/dist/pages/OrderDetailsPage.js +306 -306
- package/dist/pages/OrdersListPage.js +27 -27
- package/dist/pages/ProductDetailsPage.js +89 -89
- package/dist/pages/ProductsPage.js +73 -73
- package/dist/pages/RouteDetailsPage.js +282 -285
- package/dist/pages/RoutesPage.js +78 -78
- package/dist/pages/SettingsPage.js +459 -0
- package/dist/pages/TrackingPage.js +41 -41
- package/dist/pages/VehicleDetailsPage.js +207 -207
- package/dist/pages/VehiclesPage.js +17 -16
- package/dist/pages/WarehouseDetailsPage.js +132 -132
- package/dist/providers/ModuleSettingsProvider.js +74 -0
- package/dist/utils/formatters.js +53 -26
- package/dist/utils/moduleSettings.js +132 -0
- package/package.json +3 -2
- package/src/generated/tracking-quality-operations.ts +62 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +18 -5
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +19 -4
- package/src/movethewheels/pages/CreateOrderPage.tsx +38 -6
- package/src/movethewheels/pages/ProductsPage.tsx +2 -2
- package/src/movethewheels/pages/RouteDetailsPage.tsx +3 -6
- package/src/movethewheels/pages/RoutesPage.tsx +2 -2
- package/src/movethewheels/pages/SettingsPage.tsx +516 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +2 -1
- package/src/movethewheels/providers/ModuleSettingsProvider.tsx +133 -0
- package/src/movethewheels/utils/formatters.ts +69 -10
- package/src/movethewheels/utils/moduleSettings.ts +224 -0
- package/dist/movethewheels/pages/AIAssistantPage.d.ts +0 -22
- package/dist/node_modules/lucide-react/dist/esm/icons/message-circle.js +0 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/wallet.js +0 -11
- package/dist/pages/AIAssistantPage.js +0 -81
- package/src/movethewheels/pages/AIAssistantPage.tsx +0 -123
|
@@ -13,20 +13,20 @@ import { Users as u } from "../node_modules/lucide-react/dist/esm/icons/users.js
|
|
|
13
13
|
import { X as d } from "../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
14
14
|
import { buildOrderCustomerPath as f, getSafeCustomerReturnPath as p, joinPath as m } from "../utils/navigation.js";
|
|
15
15
|
import { useMoveTheWheels as h } from "../providers/MoveTheWheelsProvider.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { useEffect as
|
|
25
|
-
import { useParams as
|
|
26
|
-
import { Fragment as
|
|
27
|
-
import { EmphasisPanel as
|
|
16
|
+
import { formatAddress as g, formatCurrency as _, formatDate as v } from "../utils/formatters.js";
|
|
17
|
+
import { useOrders as y } from "../hooks/useOrders.js";
|
|
18
|
+
import { useCustomer as b, useCustomers as x } from "../hooks/useCustomers.js";
|
|
19
|
+
import { Button as S, Card as C, CardContent as w, CardHeader as T, CardTitle as E, Input as D, Label as O, Select as k, SelectContent as A, SelectItem as j, SelectTrigger as te, SelectValue as ne } from "../components/ui.js";
|
|
20
|
+
import { ErrorState as re, LoadingState as ie, PageLayout as ae } from "../components/PageLayout.js";
|
|
21
|
+
import { StatusBadge as oe, TypeBadge as se } from "../components/StatusBadge.js";
|
|
22
|
+
import { FormError as M } from "../components/FormError.js";
|
|
23
|
+
import { Notice as ce, useNotice as le } from "../components/Notice.js";
|
|
24
|
+
import { useEffect as ue, useState as N } from "react";
|
|
25
|
+
import { useParams as de, useSearchParams as P } from "react-router";
|
|
26
|
+
import { Fragment as fe, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
27
|
+
import { EmphasisPanel as L, NextSteps as pe, PagePurpose as R, ResponsiveDialog as me, ResponsiveDialogContent as he, ResponsiveDialogDescription as ge, ResponsiveDialogFooter as _e, ResponsiveDialogHeader as ve, ResponsiveDialogTitle as ye } from "@burdenoff/fe-libs/ui";
|
|
28
28
|
//#region src/movethewheels/pages/CustomerDetailsPage.tsx
|
|
29
|
-
var
|
|
29
|
+
var z = {
|
|
30
30
|
name: "",
|
|
31
31
|
type: "b2c",
|
|
32
32
|
email: "",
|
|
@@ -41,13 +41,13 @@ var V = {
|
|
|
41
41
|
taxId: "",
|
|
42
42
|
rating: ""
|
|
43
43
|
};
|
|
44
|
-
function
|
|
45
|
-
let { basePath: t, navigate: r } = h(), [i] =
|
|
44
|
+
function be() {
|
|
45
|
+
let { basePath: t, navigate: r } = h(), [i] = P(), a = p(i.get("returnTo")), { createCustomer: s } = x(), [c, l] = N(z), [d, g] = N(!1), [_, v] = N(null), y = () => r?.(m(t, "customers")), b = async (e) => {
|
|
46
46
|
if (e.preventDefault(), !c.name.trim()) {
|
|
47
|
-
|
|
47
|
+
v("Customer name is required.");
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
g(!0),
|
|
50
|
+
g(!0), v(null);
|
|
51
51
|
try {
|
|
52
52
|
let e = await s({
|
|
53
53
|
name: c.name.trim(),
|
|
@@ -68,55 +68,55 @@ function ve() {
|
|
|
68
68
|
}), n = a ? f(a, e.id) : `customers/${e.id}`;
|
|
69
69
|
r?.(m(t, n));
|
|
70
70
|
} catch (e) {
|
|
71
|
-
console.error("Failed to create customer:", e),
|
|
71
|
+
console.error("Failed to create customer:", e), v(e instanceof Error ? e.message : "Failed to create customer. Please try again."), g(!1);
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ I(ae, {
|
|
75
75
|
title: "New Customer",
|
|
76
76
|
subtitle: "Add a new customer to your account",
|
|
77
|
-
icon: /* @__PURE__ */
|
|
78
|
-
headerActions: /* @__PURE__ */
|
|
77
|
+
icon: /* @__PURE__ */ F(u, { size: 24 }),
|
|
78
|
+
headerActions: /* @__PURE__ */ I("div", {
|
|
79
79
|
className: "flex gap-2",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ I(S, {
|
|
81
81
|
variant: "outline",
|
|
82
|
-
onClick:
|
|
82
|
+
onClick: y,
|
|
83
83
|
disabled: d,
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
-
}), /* @__PURE__ */
|
|
86
|
-
onClick:
|
|
84
|
+
children: [/* @__PURE__ */ F(e, { size: 16 }), " Cancel"]
|
|
85
|
+
}), /* @__PURE__ */ I(S, {
|
|
86
|
+
onClick: b,
|
|
87
87
|
disabled: d,
|
|
88
88
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ F(o, { size: 16 }),
|
|
90
90
|
" ",
|
|
91
91
|
d ? "Saving..." : "Create Customer"
|
|
92
92
|
]
|
|
93
93
|
})]
|
|
94
94
|
}),
|
|
95
|
-
children: [/* @__PURE__ */
|
|
96
|
-
icon: /* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ F(R, {
|
|
96
|
+
icon: /* @__PURE__ */ F(u, { size: 18 }),
|
|
97
97
|
children: "Add a customer once and their contact details auto-fill every future order you book for them. Only a name is required — add email, phone and company to make deliveries easier to arrange."
|
|
98
|
-
}), /* @__PURE__ */
|
|
99
|
-
onSubmit:
|
|
98
|
+
}), /* @__PURE__ */ I("form", {
|
|
99
|
+
onSubmit: b,
|
|
100
100
|
className: "max-w-2xl space-y-6",
|
|
101
101
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ F(M, { message: _ }),
|
|
103
|
+
/* @__PURE__ */ I(L, { children: [/* @__PURE__ */ F("h2", {
|
|
104
104
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
105
105
|
children: "Customer Details"
|
|
106
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ I("div", {
|
|
107
107
|
className: "space-y-4",
|
|
108
108
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ I("div", {
|
|
110
110
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
111
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ I("div", {
|
|
112
112
|
className: "space-y-2",
|
|
113
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ I(O, {
|
|
114
114
|
htmlFor: "name",
|
|
115
|
-
children: ["Name ", /* @__PURE__ */
|
|
115
|
+
children: ["Name ", /* @__PURE__ */ F("span", {
|
|
116
116
|
className: "text-status-error-text",
|
|
117
117
|
children: "*"
|
|
118
118
|
})]
|
|
119
|
-
}), /* @__PURE__ */
|
|
119
|
+
}), /* @__PURE__ */ F(D, {
|
|
120
120
|
id: "name",
|
|
121
121
|
value: c.name,
|
|
122
122
|
onChange: (e) => l((t) => ({
|
|
@@ -126,38 +126,38 @@ function ve() {
|
|
|
126
126
|
placeholder: "Acme Corp or Jane Doe",
|
|
127
127
|
required: !0
|
|
128
128
|
})]
|
|
129
|
-
}), /* @__PURE__ */
|
|
129
|
+
}), /* @__PURE__ */ I("div", {
|
|
130
130
|
className: "space-y-2",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
131
|
+
children: [/* @__PURE__ */ F(O, {
|
|
132
132
|
htmlFor: "type",
|
|
133
133
|
children: "Customer Type"
|
|
134
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ I(k, {
|
|
135
135
|
value: c.type,
|
|
136
136
|
onValueChange: (e) => l((t) => ({
|
|
137
137
|
...t,
|
|
138
138
|
type: e
|
|
139
139
|
})),
|
|
140
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ F(te, {
|
|
141
141
|
id: "type",
|
|
142
|
-
children: /* @__PURE__ */
|
|
143
|
-
}), /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ F(ne, {})
|
|
143
|
+
}), /* @__PURE__ */ I(A, { children: [/* @__PURE__ */ F(j, {
|
|
144
144
|
value: "b2c",
|
|
145
145
|
children: "B2C (Individual)"
|
|
146
|
-
}), /* @__PURE__ */
|
|
146
|
+
}), /* @__PURE__ */ F(j, {
|
|
147
147
|
value: "b2b",
|
|
148
148
|
children: "B2B (Business)"
|
|
149
149
|
})] })]
|
|
150
150
|
})]
|
|
151
151
|
})]
|
|
152
152
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ I("div", {
|
|
154
154
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
155
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ I("div", {
|
|
156
156
|
className: "space-y-2",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
157
|
+
children: [/* @__PURE__ */ F(O, {
|
|
158
158
|
htmlFor: "email",
|
|
159
159
|
children: "Email"
|
|
160
|
-
}), /* @__PURE__ */
|
|
160
|
+
}), /* @__PURE__ */ F(D, {
|
|
161
161
|
id: "email",
|
|
162
162
|
type: "email",
|
|
163
163
|
value: c.email,
|
|
@@ -167,12 +167,12 @@ function ve() {
|
|
|
167
167
|
})),
|
|
168
168
|
placeholder: "customer@example.com"
|
|
169
169
|
})]
|
|
170
|
-
}), /* @__PURE__ */
|
|
170
|
+
}), /* @__PURE__ */ I("div", {
|
|
171
171
|
className: "space-y-2",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ F(O, {
|
|
173
173
|
htmlFor: "phone",
|
|
174
174
|
children: "Phone"
|
|
175
|
-
}), /* @__PURE__ */
|
|
175
|
+
}), /* @__PURE__ */ F(D, {
|
|
176
176
|
id: "phone",
|
|
177
177
|
value: c.phone,
|
|
178
178
|
onChange: (e) => l((t) => ({
|
|
@@ -183,12 +183,12 @@ function ve() {
|
|
|
183
183
|
})]
|
|
184
184
|
})]
|
|
185
185
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ I("div", {
|
|
187
187
|
className: "space-y-2",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ F(O, {
|
|
189
189
|
htmlFor: "company",
|
|
190
190
|
children: "Company"
|
|
191
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ F(D, {
|
|
192
192
|
id: "company",
|
|
193
193
|
value: c.company,
|
|
194
194
|
onChange: (e) => l((t) => ({
|
|
@@ -200,17 +200,17 @@ function ve() {
|
|
|
200
200
|
})
|
|
201
201
|
]
|
|
202
202
|
})] }),
|
|
203
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ I(E, {
|
|
204
204
|
className: "flex items-center gap-2",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
206
|
-
}) }), /* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ F(ee, { size: 18 }), " Address"]
|
|
206
|
+
}) }), /* @__PURE__ */ I(w, {
|
|
207
207
|
className: "space-y-4",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ I("div", {
|
|
209
209
|
className: "space-y-2",
|
|
210
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ F(O, {
|
|
211
211
|
htmlFor: "street",
|
|
212
212
|
children: "Street"
|
|
213
|
-
}), /* @__PURE__ */
|
|
213
|
+
}), /* @__PURE__ */ F(D, {
|
|
214
214
|
id: "street",
|
|
215
215
|
value: c.street,
|
|
216
216
|
onChange: (e) => l((t) => ({
|
|
@@ -219,15 +219,15 @@ function ve() {
|
|
|
219
219
|
})),
|
|
220
220
|
placeholder: "123 Main St"
|
|
221
221
|
})]
|
|
222
|
-
}), /* @__PURE__ */
|
|
222
|
+
}), /* @__PURE__ */ I("div", {
|
|
223
223
|
className: "grid grid-cols-1 md:grid-cols-4 gap-4",
|
|
224
224
|
children: [
|
|
225
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ I("div", {
|
|
226
226
|
className: "space-y-2",
|
|
227
|
-
children: [/* @__PURE__ */
|
|
227
|
+
children: [/* @__PURE__ */ F(O, {
|
|
228
228
|
htmlFor: "city",
|
|
229
229
|
children: "City"
|
|
230
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ F(D, {
|
|
231
231
|
id: "city",
|
|
232
232
|
value: c.city,
|
|
233
233
|
onChange: (e) => l((t) => ({
|
|
@@ -236,12 +236,12 @@ function ve() {
|
|
|
236
236
|
}))
|
|
237
237
|
})]
|
|
238
238
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ I("div", {
|
|
240
240
|
className: "space-y-2",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ F(O, {
|
|
242
242
|
htmlFor: "state",
|
|
243
243
|
children: "State"
|
|
244
|
-
}), /* @__PURE__ */
|
|
244
|
+
}), /* @__PURE__ */ F(D, {
|
|
245
245
|
id: "state",
|
|
246
246
|
value: c.state,
|
|
247
247
|
onChange: (e) => l((t) => ({
|
|
@@ -250,12 +250,12 @@ function ve() {
|
|
|
250
250
|
}))
|
|
251
251
|
})]
|
|
252
252
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ I("div", {
|
|
254
254
|
className: "space-y-2",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ F(O, {
|
|
256
256
|
htmlFor: "postalCode",
|
|
257
257
|
children: "Postal Code"
|
|
258
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ F(D, {
|
|
259
259
|
id: "postalCode",
|
|
260
260
|
value: c.postalCode,
|
|
261
261
|
onChange: (e) => l((t) => ({
|
|
@@ -264,12 +264,12 @@ function ve() {
|
|
|
264
264
|
}))
|
|
265
265
|
})]
|
|
266
266
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ I("div", {
|
|
268
268
|
className: "space-y-2",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ F(O, {
|
|
270
270
|
htmlFor: "country",
|
|
271
271
|
children: "Country"
|
|
272
|
-
}), /* @__PURE__ */
|
|
272
|
+
}), /* @__PURE__ */ F(D, {
|
|
273
273
|
id: "country",
|
|
274
274
|
value: c.country,
|
|
275
275
|
onChange: (e) => l((t) => ({
|
|
@@ -281,18 +281,18 @@ function ve() {
|
|
|
281
281
|
]
|
|
282
282
|
})]
|
|
283
283
|
})] }),
|
|
284
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ I(E, {
|
|
285
285
|
className: "flex items-center gap-2",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
287
|
-
}) }), /* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ F(n, { size: 18 }), " Business Details"]
|
|
287
|
+
}) }), /* @__PURE__ */ F(w, { children: /* @__PURE__ */ I("div", {
|
|
288
288
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
289
289
|
children: [
|
|
290
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ I("div", {
|
|
291
291
|
className: "space-y-2",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ F(O, {
|
|
293
293
|
htmlFor: "businessLicense",
|
|
294
294
|
children: "Business License"
|
|
295
|
-
}), /* @__PURE__ */
|
|
295
|
+
}), /* @__PURE__ */ F(D, {
|
|
296
296
|
id: "businessLicense",
|
|
297
297
|
value: c.businessLicense,
|
|
298
298
|
onChange: (e) => l((t) => ({
|
|
@@ -301,12 +301,12 @@ function ve() {
|
|
|
301
301
|
}))
|
|
302
302
|
})]
|
|
303
303
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ I("div", {
|
|
305
305
|
className: "space-y-2",
|
|
306
|
-
children: [/* @__PURE__ */
|
|
306
|
+
children: [/* @__PURE__ */ F(O, {
|
|
307
307
|
htmlFor: "taxId",
|
|
308
308
|
children: "Tax ID"
|
|
309
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ F(D, {
|
|
310
310
|
id: "taxId",
|
|
311
311
|
value: c.taxId,
|
|
312
312
|
onChange: (e) => l((t) => ({
|
|
@@ -315,12 +315,12 @@ function ve() {
|
|
|
315
315
|
}))
|
|
316
316
|
})]
|
|
317
317
|
}),
|
|
318
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ I("div", {
|
|
319
319
|
className: "space-y-2",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ F(O, {
|
|
321
321
|
htmlFor: "rating",
|
|
322
322
|
children: "Rating (0–5)"
|
|
323
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ F(D, {
|
|
324
324
|
id: "rating",
|
|
325
325
|
type: "number",
|
|
326
326
|
min: 0,
|
|
@@ -339,7 +339,7 @@ function ve() {
|
|
|
339
339
|
})]
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function B(e) {
|
|
343
343
|
return {
|
|
344
344
|
name: e.name,
|
|
345
345
|
email: e.email,
|
|
@@ -356,35 +356,35 @@ function H(e) {
|
|
|
356
356
|
rating: e.rating ? String(e.rating) : ""
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
let { customerId: p } =
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}, [
|
|
364
|
-
let Fe = () =>
|
|
359
|
+
function V() {
|
|
360
|
+
let { customerId: p } = de(), { basePath: P, navigate: V } = h(), { customer: H, isLoading: xe, error: Se, refetch: U } = b(p), { updateCustomer: Ce, deleteCustomer: we } = x(), { orders: W, isLoading: Te } = y({ filters: { customerId: p } }), { message: Ee, notify: De } = le(), [Oe, G] = N(!1), [K, ke] = N(!1), [Ae, q] = N(null), [J, Y] = N(z), [je, X] = N(!1), [Z, Me] = N(!1), [Ne, Pe] = N(null);
|
|
361
|
+
ue(() => {
|
|
362
|
+
H && Y(B(H));
|
|
363
|
+
}, [H]);
|
|
364
|
+
let Fe = () => V?.(m(P, "customers")), Q = (e) => V?.(m(P, e)), $ = () => {
|
|
365
365
|
q(null), G(!0);
|
|
366
366
|
};
|
|
367
|
-
return p ?
|
|
367
|
+
return p ? xe ? /* @__PURE__ */ F(ie, { message: "Loading customer details..." }) : Se || !H ? /* @__PURE__ */ F(re, {
|
|
368
368
|
title: "Customer not found",
|
|
369
|
-
onRetry:
|
|
370
|
-
}) : /* @__PURE__ */
|
|
371
|
-
title:
|
|
372
|
-
subtitle:
|
|
373
|
-
icon: /* @__PURE__ */
|
|
374
|
-
headerActions: /* @__PURE__ */
|
|
369
|
+
onRetry: U
|
|
370
|
+
}) : /* @__PURE__ */ I(ae, {
|
|
371
|
+
title: H.name,
|
|
372
|
+
subtitle: H.company || H.email,
|
|
373
|
+
icon: /* @__PURE__ */ F(u, { size: 24 }),
|
|
374
|
+
headerActions: /* @__PURE__ */ I("div", {
|
|
375
375
|
className: "flex gap-2",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ I(S, {
|
|
377
377
|
variant: "outline",
|
|
378
378
|
onClick: Fe,
|
|
379
|
-
children: [/* @__PURE__ */
|
|
380
|
-
}), Oe ? /* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ F(e, { size: 16 }), " Back"]
|
|
380
|
+
}), Oe ? /* @__PURE__ */ I(fe, { children: [/* @__PURE__ */ I(S, {
|
|
381
381
|
variant: "outline",
|
|
382
382
|
onClick: () => {
|
|
383
|
-
q(null), G(!1),
|
|
383
|
+
q(null), G(!1), H && Y(B(H));
|
|
384
384
|
},
|
|
385
385
|
disabled: K,
|
|
386
|
-
children: [/* @__PURE__ */
|
|
387
|
-
}), /* @__PURE__ */
|
|
386
|
+
children: [/* @__PURE__ */ F(d, { size: 16 }), " Cancel"]
|
|
387
|
+
}), /* @__PURE__ */ I(S, {
|
|
388
388
|
onClick: async () => {
|
|
389
389
|
if (p) {
|
|
390
390
|
if (!J.name.trim()) {
|
|
@@ -393,7 +393,7 @@ function U() {
|
|
|
393
393
|
}
|
|
394
394
|
ke(!0), q(null);
|
|
395
395
|
try {
|
|
396
|
-
await
|
|
396
|
+
await Ce(p, {
|
|
397
397
|
name: J.name.trim(),
|
|
398
398
|
email: J.email.trim(),
|
|
399
399
|
phone: J.phone.trim(),
|
|
@@ -409,7 +409,7 @@ function U() {
|
|
|
409
409
|
businessLicense: J.businessLicense.trim() || void 0,
|
|
410
410
|
taxId: J.taxId.trim() || void 0,
|
|
411
411
|
rating: J.rating ? Number(J.rating) : void 0
|
|
412
|
-
}), De("Customer updated."), G(!1),
|
|
412
|
+
}), De("Customer updated."), G(!1), U();
|
|
413
413
|
} catch (e) {
|
|
414
414
|
q(e instanceof Error ? e.message : "Failed to update customer.");
|
|
415
415
|
} finally {
|
|
@@ -419,77 +419,77 @@ function U() {
|
|
|
419
419
|
},
|
|
420
420
|
disabled: K,
|
|
421
421
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ F(o, { size: 16 }),
|
|
423
423
|
" ",
|
|
424
424
|
K ? "Saving…" : "Save"
|
|
425
425
|
]
|
|
426
|
-
})] }) : /* @__PURE__ */
|
|
426
|
+
})] }) : /* @__PURE__ */ I(S, {
|
|
427
427
|
onClick: $,
|
|
428
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ F(s, { size: 16 }), " Edit"]
|
|
429
429
|
})]
|
|
430
430
|
}),
|
|
431
|
-
headerContent: /* @__PURE__ */
|
|
431
|
+
headerContent: /* @__PURE__ */ I("div", {
|
|
432
432
|
className: "flex items-center gap-4",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
433
|
+
children: [/* @__PURE__ */ F(se, { type: H.type }), H.rating !== void 0 && /* @__PURE__ */ I("div", {
|
|
434
434
|
className: "flex items-center gap-1",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ F(c, {
|
|
436
436
|
size: 16,
|
|
437
437
|
className: "text-status-warning-text fill-current"
|
|
438
|
-
}), /* @__PURE__ */
|
|
438
|
+
}), /* @__PURE__ */ F("span", {
|
|
439
439
|
className: "font-medium",
|
|
440
|
-
children:
|
|
440
|
+
children: H.rating.toFixed(1)
|
|
441
441
|
})]
|
|
442
442
|
})]
|
|
443
443
|
}),
|
|
444
444
|
children: [
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
icon: /* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ F(R, {
|
|
446
|
+
icon: /* @__PURE__ */ F(u, { size: 18 }),
|
|
447
447
|
children: "Everything you know about this customer — how to reach them, where they are, and their account standing. Use it to confirm contact details before a delivery, check their rating, or book their next order."
|
|
448
448
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ F(pe, {
|
|
450
450
|
storageKey: "movethewheels-customer-details",
|
|
451
451
|
steps: [{
|
|
452
452
|
id: "new-order",
|
|
453
453
|
label: "Book a delivery for this customer",
|
|
454
454
|
description: "Start a new order pre-filled for this account.",
|
|
455
|
-
icon: /* @__PURE__ */
|
|
456
|
-
onClick: () => Q(f("orders/new",
|
|
455
|
+
icon: /* @__PURE__ */ F(n, { size: 16 }),
|
|
456
|
+
onClick: () => Q(f("orders/new", H.id))
|
|
457
457
|
}, {
|
|
458
458
|
id: "edit",
|
|
459
459
|
label: "Update contact details",
|
|
460
460
|
description: "Keep email, phone and address current.",
|
|
461
|
-
icon: /* @__PURE__ */
|
|
461
|
+
icon: /* @__PURE__ */ F(s, { size: 16 }),
|
|
462
462
|
onClick: $
|
|
463
463
|
}]
|
|
464
464
|
}),
|
|
465
|
-
Ee && /* @__PURE__ */
|
|
465
|
+
Ee && /* @__PURE__ */ F("div", {
|
|
466
466
|
className: "mb-2",
|
|
467
|
-
children: /* @__PURE__ */
|
|
467
|
+
children: /* @__PURE__ */ F(ce, { message: Ee })
|
|
468
468
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ I("div", {
|
|
470
470
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
471
|
-
children: [/* @__PURE__ */
|
|
471
|
+
children: [/* @__PURE__ */ I("div", {
|
|
472
472
|
className: "lg:col-span-2 space-y-6",
|
|
473
473
|
children: [
|
|
474
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ I(L, { children: [/* @__PURE__ */ F("h2", {
|
|
475
475
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
476
476
|
children: "Contact Information"
|
|
477
|
-
}), Oe ? /* @__PURE__ */
|
|
477
|
+
}), Oe ? /* @__PURE__ */ I("div", {
|
|
478
478
|
className: "space-y-4",
|
|
479
479
|
children: [
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ F(M, { message: Ae }),
|
|
481
|
+
/* @__PURE__ */ I("div", {
|
|
482
482
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
483
483
|
children: [
|
|
484
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ I("div", {
|
|
485
485
|
className: "space-y-2",
|
|
486
|
-
children: [/* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ I(O, {
|
|
487
487
|
htmlFor: "edit-name",
|
|
488
|
-
children: ["Name ", /* @__PURE__ */
|
|
488
|
+
children: ["Name ", /* @__PURE__ */ F("span", {
|
|
489
489
|
className: "text-status-error-text",
|
|
490
490
|
children: "*"
|
|
491
491
|
})]
|
|
492
|
-
}), /* @__PURE__ */
|
|
492
|
+
}), /* @__PURE__ */ F(D, {
|
|
493
493
|
id: "edit-name",
|
|
494
494
|
value: J.name,
|
|
495
495
|
onChange: (e) => Y((t) => ({
|
|
@@ -498,12 +498,12 @@ function U() {
|
|
|
498
498
|
}))
|
|
499
499
|
})]
|
|
500
500
|
}),
|
|
501
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ I("div", {
|
|
502
502
|
className: "space-y-2",
|
|
503
|
-
children: [/* @__PURE__ */
|
|
503
|
+
children: [/* @__PURE__ */ F(O, {
|
|
504
504
|
htmlFor: "edit-company",
|
|
505
505
|
children: "Company"
|
|
506
|
-
}), /* @__PURE__ */
|
|
506
|
+
}), /* @__PURE__ */ F(D, {
|
|
507
507
|
id: "edit-company",
|
|
508
508
|
value: J.company,
|
|
509
509
|
onChange: (e) => Y((t) => ({
|
|
@@ -513,12 +513,12 @@ function U() {
|
|
|
513
513
|
placeholder: "Company name (for B2B accounts)"
|
|
514
514
|
})]
|
|
515
515
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ I("div", {
|
|
517
517
|
className: "space-y-2",
|
|
518
|
-
children: [/* @__PURE__ */
|
|
518
|
+
children: [/* @__PURE__ */ F(O, {
|
|
519
519
|
htmlFor: "edit-email",
|
|
520
520
|
children: "Email"
|
|
521
|
-
}), /* @__PURE__ */
|
|
521
|
+
}), /* @__PURE__ */ F(D, {
|
|
522
522
|
id: "edit-email",
|
|
523
523
|
type: "email",
|
|
524
524
|
value: J.email,
|
|
@@ -528,12 +528,12 @@ function U() {
|
|
|
528
528
|
}))
|
|
529
529
|
})]
|
|
530
530
|
}),
|
|
531
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ I("div", {
|
|
532
532
|
className: "space-y-2",
|
|
533
|
-
children: [/* @__PURE__ */
|
|
533
|
+
children: [/* @__PURE__ */ F(O, {
|
|
534
534
|
htmlFor: "edit-phone",
|
|
535
535
|
children: "Phone"
|
|
536
|
-
}), /* @__PURE__ */
|
|
536
|
+
}), /* @__PURE__ */ F(D, {
|
|
537
537
|
id: "edit-phone",
|
|
538
538
|
value: J.phone,
|
|
539
539
|
onChange: (e) => Y((t) => ({
|
|
@@ -542,35 +542,35 @@ function U() {
|
|
|
542
542
|
}))
|
|
543
543
|
})]
|
|
544
544
|
}),
|
|
545
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ I("div", {
|
|
546
546
|
className: "space-y-2",
|
|
547
|
-
children: [/* @__PURE__ */
|
|
547
|
+
children: [/* @__PURE__ */ F(O, {
|
|
548
548
|
htmlFor: "edit-type",
|
|
549
549
|
children: "Customer Type"
|
|
550
|
-
}), /* @__PURE__ */
|
|
550
|
+
}), /* @__PURE__ */ I(k, {
|
|
551
551
|
value: J.type,
|
|
552
552
|
onValueChange: (e) => Y((t) => ({
|
|
553
553
|
...t,
|
|
554
554
|
type: e
|
|
555
555
|
})),
|
|
556
|
-
children: [/* @__PURE__ */
|
|
556
|
+
children: [/* @__PURE__ */ F(te, {
|
|
557
557
|
id: "edit-type",
|
|
558
|
-
children: /* @__PURE__ */
|
|
559
|
-
}), /* @__PURE__ */
|
|
558
|
+
children: /* @__PURE__ */ F(ne, {})
|
|
559
|
+
}), /* @__PURE__ */ I(A, { children: [/* @__PURE__ */ F(j, {
|
|
560
560
|
value: "b2c",
|
|
561
561
|
children: "B2C (Individual)"
|
|
562
|
-
}), /* @__PURE__ */
|
|
562
|
+
}), /* @__PURE__ */ F(j, {
|
|
563
563
|
value: "b2b",
|
|
564
564
|
children: "B2B (Business)"
|
|
565
565
|
})] })]
|
|
566
566
|
})]
|
|
567
567
|
}),
|
|
568
|
-
/* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ I("div", {
|
|
569
569
|
className: "space-y-2",
|
|
570
|
-
children: [/* @__PURE__ */
|
|
570
|
+
children: [/* @__PURE__ */ F(O, {
|
|
571
571
|
htmlFor: "edit-rating",
|
|
572
572
|
children: "Rating (0–5)"
|
|
573
|
-
}), /* @__PURE__ */
|
|
573
|
+
}), /* @__PURE__ */ F(D, {
|
|
574
574
|
id: "edit-rating",
|
|
575
575
|
type: "number",
|
|
576
576
|
min: 0,
|
|
@@ -585,15 +585,15 @@ function U() {
|
|
|
585
585
|
})
|
|
586
586
|
]
|
|
587
587
|
}),
|
|
588
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ I("div", {
|
|
589
589
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
590
590
|
children: [
|
|
591
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ I("div", {
|
|
592
592
|
className: "space-y-2",
|
|
593
|
-
children: [/* @__PURE__ */
|
|
593
|
+
children: [/* @__PURE__ */ F(O, {
|
|
594
594
|
htmlFor: "edit-street",
|
|
595
595
|
children: "Street"
|
|
596
|
-
}), /* @__PURE__ */
|
|
596
|
+
}), /* @__PURE__ */ F(D, {
|
|
597
597
|
id: "edit-street",
|
|
598
598
|
value: J.street,
|
|
599
599
|
onChange: (e) => Y((t) => ({
|
|
@@ -602,12 +602,12 @@ function U() {
|
|
|
602
602
|
}))
|
|
603
603
|
})]
|
|
604
604
|
}),
|
|
605
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ I("div", {
|
|
606
606
|
className: "space-y-2",
|
|
607
|
-
children: [/* @__PURE__ */
|
|
607
|
+
children: [/* @__PURE__ */ F(O, {
|
|
608
608
|
htmlFor: "edit-city",
|
|
609
609
|
children: "City"
|
|
610
|
-
}), /* @__PURE__ */
|
|
610
|
+
}), /* @__PURE__ */ F(D, {
|
|
611
611
|
id: "edit-city",
|
|
612
612
|
value: J.city,
|
|
613
613
|
onChange: (e) => Y((t) => ({
|
|
@@ -616,12 +616,12 @@ function U() {
|
|
|
616
616
|
}))
|
|
617
617
|
})]
|
|
618
618
|
}),
|
|
619
|
-
/* @__PURE__ */
|
|
619
|
+
/* @__PURE__ */ I("div", {
|
|
620
620
|
className: "space-y-2",
|
|
621
|
-
children: [/* @__PURE__ */
|
|
621
|
+
children: [/* @__PURE__ */ F(O, {
|
|
622
622
|
htmlFor: "edit-state",
|
|
623
623
|
children: "State"
|
|
624
|
-
}), /* @__PURE__ */
|
|
624
|
+
}), /* @__PURE__ */ F(D, {
|
|
625
625
|
id: "edit-state",
|
|
626
626
|
value: J.state,
|
|
627
627
|
onChange: (e) => Y((t) => ({
|
|
@@ -630,12 +630,12 @@ function U() {
|
|
|
630
630
|
}))
|
|
631
631
|
})]
|
|
632
632
|
}),
|
|
633
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ I("div", {
|
|
634
634
|
className: "space-y-2",
|
|
635
|
-
children: [/* @__PURE__ */
|
|
635
|
+
children: [/* @__PURE__ */ F(O, {
|
|
636
636
|
htmlFor: "edit-postalCode",
|
|
637
637
|
children: "Postal Code"
|
|
638
|
-
}), /* @__PURE__ */
|
|
638
|
+
}), /* @__PURE__ */ F(D, {
|
|
639
639
|
id: "edit-postalCode",
|
|
640
640
|
value: J.postalCode,
|
|
641
641
|
onChange: (e) => Y((t) => ({
|
|
@@ -644,12 +644,12 @@ function U() {
|
|
|
644
644
|
}))
|
|
645
645
|
})]
|
|
646
646
|
}),
|
|
647
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ I("div", {
|
|
648
648
|
className: "space-y-2",
|
|
649
|
-
children: [/* @__PURE__ */
|
|
649
|
+
children: [/* @__PURE__ */ F(O, {
|
|
650
650
|
htmlFor: "edit-country",
|
|
651
651
|
children: "Country"
|
|
652
|
-
}), /* @__PURE__ */
|
|
652
|
+
}), /* @__PURE__ */ F(D, {
|
|
653
653
|
id: "edit-country",
|
|
654
654
|
value: J.country,
|
|
655
655
|
onChange: (e) => Y((t) => ({
|
|
@@ -658,12 +658,12 @@ function U() {
|
|
|
658
658
|
}))
|
|
659
659
|
})]
|
|
660
660
|
}),
|
|
661
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ I("div", {
|
|
662
662
|
className: "space-y-2",
|
|
663
|
-
children: [/* @__PURE__ */
|
|
663
|
+
children: [/* @__PURE__ */ F(O, {
|
|
664
664
|
htmlFor: "edit-businessLicense",
|
|
665
665
|
children: "Business License"
|
|
666
|
-
}), /* @__PURE__ */
|
|
666
|
+
}), /* @__PURE__ */ F(D, {
|
|
667
667
|
id: "edit-businessLicense",
|
|
668
668
|
value: J.businessLicense,
|
|
669
669
|
onChange: (e) => Y((t) => ({
|
|
@@ -672,12 +672,12 @@ function U() {
|
|
|
672
672
|
}))
|
|
673
673
|
})]
|
|
674
674
|
}),
|
|
675
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ I("div", {
|
|
676
676
|
className: "space-y-2",
|
|
677
|
-
children: [/* @__PURE__ */
|
|
677
|
+
children: [/* @__PURE__ */ F(O, {
|
|
678
678
|
htmlFor: "edit-taxId",
|
|
679
679
|
children: "Tax ID"
|
|
680
|
-
}), /* @__PURE__ */
|
|
680
|
+
}), /* @__PURE__ */ F(D, {
|
|
681
681
|
id: "edit-taxId",
|
|
682
682
|
value: J.taxId,
|
|
683
683
|
onChange: (e) => Y((t) => ({
|
|
@@ -689,189 +689,189 @@ function U() {
|
|
|
689
689
|
]
|
|
690
690
|
})
|
|
691
691
|
]
|
|
692
|
-
}) : /* @__PURE__ */
|
|
692
|
+
}) : /* @__PURE__ */ I("div", {
|
|
693
693
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
694
|
-
children: [/* @__PURE__ */
|
|
694
|
+
children: [/* @__PURE__ */ I("div", {
|
|
695
695
|
className: "space-y-4",
|
|
696
|
-
children: [/* @__PURE__ */
|
|
696
|
+
children: [/* @__PURE__ */ I("div", {
|
|
697
697
|
className: "flex items-center gap-3",
|
|
698
|
-
children: [/* @__PURE__ */
|
|
698
|
+
children: [/* @__PURE__ */ F(r, {
|
|
699
699
|
size: 18,
|
|
700
700
|
className: "text-text-secondary"
|
|
701
|
-
}), /* @__PURE__ */
|
|
701
|
+
}), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
702
702
|
className: "text-sm text-text-secondary",
|
|
703
703
|
children: "Email"
|
|
704
|
-
}), /* @__PURE__ */
|
|
704
|
+
}), /* @__PURE__ */ F("p", {
|
|
705
705
|
className: "font-medium",
|
|
706
|
-
children:
|
|
706
|
+
children: H.email || "—"
|
|
707
707
|
})] })]
|
|
708
|
-
}), /* @__PURE__ */
|
|
708
|
+
}), /* @__PURE__ */ I("div", {
|
|
709
709
|
className: "flex items-center gap-3",
|
|
710
|
-
children: [/* @__PURE__ */
|
|
710
|
+
children: [/* @__PURE__ */ F(a, {
|
|
711
711
|
size: 18,
|
|
712
712
|
className: "text-text-secondary"
|
|
713
|
-
}), /* @__PURE__ */
|
|
713
|
+
}), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
714
714
|
className: "text-sm text-text-secondary",
|
|
715
715
|
children: "Phone"
|
|
716
|
-
}), /* @__PURE__ */
|
|
716
|
+
}), /* @__PURE__ */ F("p", {
|
|
717
717
|
className: "font-medium",
|
|
718
|
-
children:
|
|
718
|
+
children: H.phone || "—"
|
|
719
719
|
})] })]
|
|
720
720
|
})]
|
|
721
|
-
}), /* @__PURE__ */
|
|
721
|
+
}), /* @__PURE__ */ F("div", {
|
|
722
722
|
className: "space-y-4",
|
|
723
|
-
children:
|
|
723
|
+
children: H.company && /* @__PURE__ */ I("div", {
|
|
724
724
|
className: "flex items-center gap-3",
|
|
725
|
-
children: [/* @__PURE__ */
|
|
725
|
+
children: [/* @__PURE__ */ F(t, {
|
|
726
726
|
size: 18,
|
|
727
727
|
className: "text-text-secondary"
|
|
728
|
-
}), /* @__PURE__ */
|
|
728
|
+
}), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
729
729
|
className: "text-sm text-text-secondary",
|
|
730
730
|
children: "Company"
|
|
731
|
-
}), /* @__PURE__ */
|
|
731
|
+
}), /* @__PURE__ */ F("p", {
|
|
732
732
|
className: "font-medium",
|
|
733
|
-
children:
|
|
733
|
+
children: H.company
|
|
734
734
|
})] })]
|
|
735
735
|
})
|
|
736
736
|
})]
|
|
737
737
|
})] }),
|
|
738
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ I(E, {
|
|
739
739
|
className: "flex items-center gap-2",
|
|
740
|
-
children: [/* @__PURE__ */
|
|
741
|
-
}) }), /* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */
|
|
740
|
+
children: [/* @__PURE__ */ F(ee, { size: 18 }), " Address"]
|
|
741
|
+
}) }), /* @__PURE__ */ F(w, { children: /* @__PURE__ */ F("p", { children: g(H.address) || "—" }) })] }),
|
|
742
|
+
/* @__PURE__ */ I(C, { children: [/* @__PURE__ */ I(T, {
|
|
743
743
|
className: "flex flex-row items-center justify-between",
|
|
744
|
-
children: [/* @__PURE__ */
|
|
744
|
+
children: [/* @__PURE__ */ I(E, {
|
|
745
745
|
className: "flex items-center gap-2",
|
|
746
|
-
children: [/* @__PURE__ */
|
|
747
|
-
}), /* @__PURE__ */
|
|
746
|
+
children: [/* @__PURE__ */ F(i, { size: 18 }), " Orders"]
|
|
747
|
+
}), /* @__PURE__ */ I(S, {
|
|
748
748
|
variant: "outline",
|
|
749
749
|
size: "sm",
|
|
750
|
-
onClick: () => Q(f("orders/new",
|
|
751
|
-
children: [/* @__PURE__ */
|
|
750
|
+
onClick: () => Q(f("orders/new", H.id)),
|
|
751
|
+
children: [/* @__PURE__ */ F(n, { size: 14 }), " New order"]
|
|
752
752
|
})]
|
|
753
|
-
}), /* @__PURE__ */
|
|
753
|
+
}), /* @__PURE__ */ F(w, { children: Te ? /* @__PURE__ */ F("p", {
|
|
754
754
|
className: "text-text-secondary text-center py-4",
|
|
755
755
|
children: "Loading orders…"
|
|
756
|
-
}) :
|
|
756
|
+
}) : W.length > 0 ? /* @__PURE__ */ F("div", {
|
|
757
757
|
className: "space-y-2",
|
|
758
|
-
children:
|
|
758
|
+
children: W.map((e) => /* @__PURE__ */ I("button", {
|
|
759
759
|
type: "button",
|
|
760
760
|
onClick: () => Q(`orders/${e.id}`),
|
|
761
761
|
className: "w-full flex items-center justify-between gap-3 p-3 border rounded-lg text-left hover:bg-bg-sunken/50 transition-colors",
|
|
762
|
-
children: [/* @__PURE__ */
|
|
762
|
+
children: [/* @__PURE__ */ I("div", {
|
|
763
763
|
className: "min-w-0",
|
|
764
|
-
children: [/* @__PURE__ */
|
|
764
|
+
children: [/* @__PURE__ */ F("p", {
|
|
765
765
|
className: "font-medium truncate",
|
|
766
766
|
children: e.orderNumber
|
|
767
|
-
}), /* @__PURE__ */
|
|
767
|
+
}), /* @__PURE__ */ I("p", {
|
|
768
768
|
className: "text-sm text-text-secondary",
|
|
769
769
|
children: [
|
|
770
|
-
|
|
770
|
+
v(e.createdAt, "relative"),
|
|
771
771
|
" ·",
|
|
772
772
|
" ",
|
|
773
|
-
|
|
773
|
+
_(e.pricing.total)
|
|
774
774
|
]
|
|
775
775
|
})]
|
|
776
|
-
}), /* @__PURE__ */
|
|
776
|
+
}), /* @__PURE__ */ F(oe, {
|
|
777
777
|
status: e.status,
|
|
778
778
|
type: "order",
|
|
779
779
|
size: "sm"
|
|
780
780
|
})]
|
|
781
781
|
}, e.id))
|
|
782
|
-
}) : /* @__PURE__ */
|
|
782
|
+
}) : /* @__PURE__ */ I("div", {
|
|
783
783
|
className: "text-center py-6",
|
|
784
784
|
children: [
|
|
785
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ F(i, {
|
|
786
786
|
size: 32,
|
|
787
787
|
className: "mx-auto mb-2 text-text-secondary opacity-50"
|
|
788
788
|
}),
|
|
789
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ F("p", {
|
|
790
790
|
className: "text-text-secondary",
|
|
791
791
|
children: "No orders yet for this customer"
|
|
792
792
|
}),
|
|
793
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ F("button", {
|
|
794
794
|
type: "button",
|
|
795
|
-
onClick: () => Q(f("orders/new",
|
|
795
|
+
onClick: () => Q(f("orders/new", H.id)),
|
|
796
796
|
className: "mt-1 text-sm text-primary hover:underline",
|
|
797
797
|
children: "Book their first delivery"
|
|
798
798
|
})
|
|
799
799
|
]
|
|
800
800
|
}) })] })
|
|
801
801
|
]
|
|
802
|
-
}), /* @__PURE__ */
|
|
802
|
+
}), /* @__PURE__ */ I("div", {
|
|
803
803
|
className: "space-y-6",
|
|
804
804
|
children: [
|
|
805
|
-
(
|
|
805
|
+
(H.businessLicense || H.taxId) && /* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ F(E, { children: "Business Details" }) }), /* @__PURE__ */ I(w, {
|
|
806
806
|
className: "space-y-3",
|
|
807
|
-
children: [
|
|
807
|
+
children: [H.businessLicense && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
808
808
|
className: "text-sm text-text-secondary",
|
|
809
809
|
children: "Business License"
|
|
810
|
-
}), /* @__PURE__ */
|
|
810
|
+
}), /* @__PURE__ */ F("p", {
|
|
811
811
|
className: "font-mono",
|
|
812
|
-
children:
|
|
813
|
-
})] }),
|
|
812
|
+
children: H.businessLicense
|
|
813
|
+
})] }), H.taxId && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
814
814
|
className: "text-sm text-text-secondary",
|
|
815
815
|
children: "Tax ID"
|
|
816
|
-
}), /* @__PURE__ */
|
|
816
|
+
}), /* @__PURE__ */ F("p", {
|
|
817
817
|
className: "font-mono",
|
|
818
|
-
children:
|
|
818
|
+
children: H.taxId
|
|
819
819
|
})] })]
|
|
820
820
|
})] }),
|
|
821
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ F(E, { children: "Account Info" }) }), /* @__PURE__ */ I(w, {
|
|
822
822
|
className: "space-y-3",
|
|
823
|
-
children: [/* @__PURE__ */
|
|
823
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
824
824
|
className: "text-sm text-text-secondary",
|
|
825
825
|
children: "Created"
|
|
826
|
-
}), /* @__PURE__ */
|
|
826
|
+
}), /* @__PURE__ */ F("p", { children: v(H.createdAt, "full") })] }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
827
827
|
className: "text-sm text-text-secondary",
|
|
828
828
|
children: "Last Updated"
|
|
829
|
-
}), /* @__PURE__ */
|
|
829
|
+
}), /* @__PURE__ */ F("p", { children: v(H.updatedAt, "relative") })] })]
|
|
830
830
|
})] }),
|
|
831
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ I(C, {
|
|
832
832
|
className: "border-status-error-border",
|
|
833
|
-
children: [/* @__PURE__ */
|
|
833
|
+
children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ I(E, {
|
|
834
834
|
className: "flex items-center gap-2 text-status-error-text",
|
|
835
|
-
children: [/* @__PURE__ */
|
|
836
|
-
}) }), /* @__PURE__ */
|
|
835
|
+
children: [/* @__PURE__ */ F(l, { size: 18 }), " Delete Customer"]
|
|
836
|
+
}) }), /* @__PURE__ */ I(w, { children: [/* @__PURE__ */ F("p", {
|
|
837
837
|
className: "mb-3 text-sm text-text-secondary",
|
|
838
838
|
children: "Removes this customer from your account. Their past orders stay on record. This cannot be undone from here."
|
|
839
|
-
}), /* @__PURE__ */
|
|
839
|
+
}), /* @__PURE__ */ I(S, {
|
|
840
840
|
type: "button",
|
|
841
841
|
variant: "outline",
|
|
842
842
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
843
843
|
onClick: () => X(!0),
|
|
844
|
-
children: [/* @__PURE__ */
|
|
844
|
+
children: [/* @__PURE__ */ F(l, { size: 16 }), " Delete this customer"]
|
|
845
845
|
})] })]
|
|
846
846
|
})
|
|
847
847
|
]
|
|
848
848
|
})]
|
|
849
849
|
}),
|
|
850
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ F(me, {
|
|
851
851
|
open: je,
|
|
852
852
|
onOpenChange: X,
|
|
853
|
-
children: /* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */
|
|
853
|
+
children: /* @__PURE__ */ I(he, { children: [
|
|
854
|
+
/* @__PURE__ */ I(ve, { children: [/* @__PURE__ */ F(ye, { children: "Delete this customer?" }), /* @__PURE__ */ I(ge, { children: [
|
|
855
855
|
"This removes ",
|
|
856
|
-
|
|
856
|
+
H.name,
|
|
857
857
|
" from your account. It cannot be undone from here."
|
|
858
858
|
] })] }),
|
|
859
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ F("div", {
|
|
860
860
|
className: "px-1",
|
|
861
|
-
children: /* @__PURE__ */
|
|
861
|
+
children: /* @__PURE__ */ F(M, { message: Ne })
|
|
862
862
|
}),
|
|
863
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ I(_e, { children: [/* @__PURE__ */ F(S, {
|
|
864
864
|
variant: "outline",
|
|
865
865
|
onClick: () => X(!1),
|
|
866
866
|
disabled: Z,
|
|
867
867
|
children: "Cancel"
|
|
868
|
-
}), /* @__PURE__ */
|
|
868
|
+
}), /* @__PURE__ */ F(S, {
|
|
869
869
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
870
870
|
onClick: async () => {
|
|
871
871
|
if (p) {
|
|
872
872
|
Me(!0), Pe(null);
|
|
873
873
|
try {
|
|
874
|
-
await
|
|
874
|
+
await we(p), X(!1), Fe();
|
|
875
875
|
} catch (e) {
|
|
876
876
|
Pe(e instanceof Error ? e.message : "Failed to delete customer."), Me(!1);
|
|
877
877
|
}
|
|
@@ -883,7 +883,7 @@ function U() {
|
|
|
883
883
|
] })
|
|
884
884
|
})
|
|
885
885
|
]
|
|
886
|
-
}) : /* @__PURE__ */
|
|
886
|
+
}) : /* @__PURE__ */ F(be, {});
|
|
887
887
|
}
|
|
888
888
|
//#endregion
|
|
889
|
-
export {
|
|
889
|
+
export { V as default };
|