@burdenoff/microfe-movethewheels 2026.920.1 → 2026.920.3
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/components/CustomerPicker.js +260 -0
- package/dist/components/ShippingQuoteResults.js +159 -106
- package/dist/hooks/useShippingCarriers.js +1 -1
- package/dist/movethewheels/components/CustomerPicker.d.ts +17 -0
- package/dist/movethewheels/hooks/useShippingCarriers.d.ts +17 -0
- package/dist/movethewheels/utils/navigation.d.ts +14 -0
- package/dist/pages/CreateOrderPage.js +221 -216
- package/dist/pages/CustomerDetailsPage.js +220 -220
- package/dist/pages/ShippingRatesPage.js +84 -16
- package/dist/utils/navigation.js +22 -1
- package/package.json +1 -1
- package/src/movethewheels/components/CustomerPicker.tsx +307 -0
- package/src/movethewheels/components/ShippingQuoteResults.tsx +62 -2
- package/src/movethewheels/components/maps/leaflet-setup.ts +8 -1
- package/src/movethewheels/hooks/useMultiModalShipments.ts +6 -1
- package/src/movethewheels/hooks/useShippingCarriers.ts +28 -0
- package/src/movethewheels/pages/CreateOrderPage.tsx +84 -31
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +15 -6
- package/src/movethewheels/pages/ShippingRatesPage.tsx +85 -0
- package/src/movethewheels/utils/navigation.ts +32 -0
|
@@ -10,22 +10,22 @@ import { SquarePen as c } from "../node_modules/lucide-react/dist/esm/icons/squa
|
|
|
10
10
|
import { Star as l } from "../node_modules/lucide-react/dist/esm/icons/star.js";
|
|
11
11
|
import { Users as u } from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
12
12
|
import { X as d } from "../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
13
|
-
import {
|
|
14
|
-
import { useMoveTheWheels as
|
|
15
|
-
import { useOrders as
|
|
16
|
-
import { useCustomer as
|
|
17
|
-
import { Badge as
|
|
18
|
-
import { ErrorState as ee, LoadingState as te, PageLayout as
|
|
13
|
+
import { buildOrderCustomerPath as f, getSafeCustomerReturnPath as p, joinPath as m } from "../utils/navigation.js";
|
|
14
|
+
import { useMoveTheWheels as h } from "../providers/MoveTheWheelsProvider.js";
|
|
15
|
+
import { useOrders as g } from "../hooks/useOrders.js";
|
|
16
|
+
import { useCustomer as _, useCustomers as v } from "../hooks/useCustomers.js";
|
|
17
|
+
import { Badge as y, Button as b, Card as x, CardContent as S, CardHeader as C, CardTitle as w, Input as T, Label as E, Select as D, SelectContent as O, SelectItem as k, SelectTrigger as A, SelectValue as j } from "../components/ui.js";
|
|
18
|
+
import { ErrorState as ee, LoadingState as te, PageLayout as M } from "../components/PageLayout.js";
|
|
19
19
|
import { StatusBadge as ne, TypeBadge as re } from "../components/StatusBadge.js";
|
|
20
|
-
import { FormError as
|
|
20
|
+
import { FormError as N } from "../components/FormError.js";
|
|
21
21
|
import { Notice as ie, useNotice as ae } from "../components/Notice.js";
|
|
22
|
-
import { formatAddress as
|
|
23
|
-
import { useEffect as
|
|
24
|
-
import { useParams as
|
|
25
|
-
import { Fragment as
|
|
26
|
-
import { EmphasisPanel as
|
|
22
|
+
import { formatAddress as oe, formatCurrency as se, formatDate as P } from "../utils/formatters.js";
|
|
23
|
+
import { useEffect as ce, useState as F } from "react";
|
|
24
|
+
import { useParams as le, useSearchParams as I } from "react-router";
|
|
25
|
+
import { Fragment as ue, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
26
|
+
import { EmphasisPanel as z, NextSteps as de, PagePurpose as B } from "@burdenoff/fe-libs/ui";
|
|
27
27
|
//#region src/movethewheels/pages/CustomerDetailsPage.tsx
|
|
28
|
-
function
|
|
28
|
+
function fe(e) {
|
|
29
29
|
if (!e) return null;
|
|
30
30
|
let t = e.trim(), n = /^https?:\/\//i.test(t) ? t : `https://${t}`;
|
|
31
31
|
try {
|
|
@@ -35,135 +35,135 @@ function ue(e) {
|
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
let { basePath: t, navigate: n } = p(), { createCustomer:
|
|
38
|
+
function V() {
|
|
39
|
+
let { basePath: t, navigate: n } = h(), [r] = I(), i = p(r.get("returnTo")), { createCustomer: a } = v(), [o, c] = F({
|
|
40
40
|
name: "",
|
|
41
41
|
type: "b2c",
|
|
42
42
|
email: "",
|
|
43
43
|
phone: "",
|
|
44
44
|
company: ""
|
|
45
|
-
}), [
|
|
46
|
-
if (e.preventDefault(), !
|
|
47
|
-
|
|
45
|
+
}), [l, d] = F(!1), [g, _] = F(null), y = () => n?.(m(t, "customers")), x = async (e) => {
|
|
46
|
+
if (e.preventDefault(), !o.name.trim()) {
|
|
47
|
+
_("Customer name is required.");
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
d(!0), _(null);
|
|
51
51
|
try {
|
|
52
|
-
let e = await
|
|
53
|
-
name:
|
|
54
|
-
type:
|
|
55
|
-
email:
|
|
56
|
-
phone:
|
|
57
|
-
company:
|
|
58
|
-
})
|
|
59
|
-
n?.(
|
|
52
|
+
let e = await a({
|
|
53
|
+
name: o.name.trim(),
|
|
54
|
+
type: o.type,
|
|
55
|
+
email: o.email.trim() || void 0,
|
|
56
|
+
phone: o.phone.trim() || void 0,
|
|
57
|
+
company: o.company.trim() || void 0
|
|
58
|
+
}), r = i ? f(i, e.id) : `customers/${e.id}`;
|
|
59
|
+
n?.(m(t, r));
|
|
60
60
|
} catch (e) {
|
|
61
|
-
console.error("Failed to create customer:", e),
|
|
61
|
+
console.error("Failed to create customer:", e), _(e instanceof Error ? e.message : "Failed to create customer. Please try again."), d(!1);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ R(M, {
|
|
65
65
|
title: "New Customer",
|
|
66
66
|
subtitle: "Add a new customer to your account",
|
|
67
|
-
icon: /* @__PURE__ */
|
|
68
|
-
headerActions: /* @__PURE__ */
|
|
67
|
+
icon: /* @__PURE__ */ L(u, { size: 24 }),
|
|
68
|
+
headerActions: /* @__PURE__ */ R("div", {
|
|
69
69
|
className: "flex gap-2",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ R(b, {
|
|
71
71
|
variant: "outline",
|
|
72
|
-
onClick:
|
|
73
|
-
disabled:
|
|
74
|
-
children: [/* @__PURE__ */
|
|
75
|
-
}), /* @__PURE__ */
|
|
76
|
-
onClick:
|
|
77
|
-
disabled:
|
|
72
|
+
onClick: y,
|
|
73
|
+
disabled: l,
|
|
74
|
+
children: [/* @__PURE__ */ L(e, { size: 16 }), " Cancel"]
|
|
75
|
+
}), /* @__PURE__ */ R(b, {
|
|
76
|
+
onClick: x,
|
|
77
|
+
disabled: l,
|
|
78
78
|
children: [
|
|
79
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ L(s, { size: 16 }),
|
|
80
80
|
" ",
|
|
81
|
-
|
|
81
|
+
l ? "Saving..." : "Create Customer"
|
|
82
82
|
]
|
|
83
83
|
})]
|
|
84
84
|
}),
|
|
85
|
-
children: [/* @__PURE__ */
|
|
86
|
-
icon: /* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ L(B, {
|
|
86
|
+
icon: /* @__PURE__ */ L(u, { size: 18 }),
|
|
87
87
|
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."
|
|
88
|
-
}), /* @__PURE__ */
|
|
89
|
-
onSubmit:
|
|
88
|
+
}), /* @__PURE__ */ R("form", {
|
|
89
|
+
onSubmit: x,
|
|
90
90
|
className: "max-w-2xl space-y-6",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ L(N, { message: g }), /* @__PURE__ */ R(z, { children: [/* @__PURE__ */ L("h2", {
|
|
92
92
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
93
93
|
children: "Customer Details"
|
|
94
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ R("div", {
|
|
95
95
|
className: "space-y-4",
|
|
96
96
|
children: [
|
|
97
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ R("div", {
|
|
98
98
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ R("div", {
|
|
100
100
|
className: "space-y-2",
|
|
101
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ R(E, {
|
|
102
102
|
htmlFor: "name",
|
|
103
|
-
children: ["Name ", /* @__PURE__ */
|
|
103
|
+
children: ["Name ", /* @__PURE__ */ L("span", {
|
|
104
104
|
className: "text-status-error-text",
|
|
105
105
|
children: "*"
|
|
106
106
|
})]
|
|
107
|
-
}), /* @__PURE__ */
|
|
107
|
+
}), /* @__PURE__ */ L(T, {
|
|
108
108
|
id: "name",
|
|
109
|
-
value:
|
|
110
|
-
onChange: (e) =>
|
|
109
|
+
value: o.name,
|
|
110
|
+
onChange: (e) => c((t) => ({
|
|
111
111
|
...t,
|
|
112
112
|
name: e.target.value
|
|
113
113
|
})),
|
|
114
114
|
placeholder: "Acme Corp or Jane Doe",
|
|
115
115
|
required: !0
|
|
116
116
|
})]
|
|
117
|
-
}), /* @__PURE__ */
|
|
117
|
+
}), /* @__PURE__ */ R("div", {
|
|
118
118
|
className: "space-y-2",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ L(E, {
|
|
120
120
|
htmlFor: "type",
|
|
121
121
|
children: "Customer Type"
|
|
122
|
-
}), /* @__PURE__ */
|
|
123
|
-
value:
|
|
124
|
-
onValueChange: (e) =>
|
|
122
|
+
}), /* @__PURE__ */ R(D, {
|
|
123
|
+
value: o.type,
|
|
124
|
+
onValueChange: (e) => c((t) => ({
|
|
125
125
|
...t,
|
|
126
126
|
type: e
|
|
127
127
|
})),
|
|
128
|
-
children: [/* @__PURE__ */
|
|
128
|
+
children: [/* @__PURE__ */ L(A, {
|
|
129
129
|
id: "type",
|
|
130
|
-
children: /* @__PURE__ */
|
|
131
|
-
}), /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ L(j, {})
|
|
131
|
+
}), /* @__PURE__ */ R(O, { children: [/* @__PURE__ */ L(k, {
|
|
132
132
|
value: "b2c",
|
|
133
133
|
children: "B2C (Individual)"
|
|
134
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ L(k, {
|
|
135
135
|
value: "b2b",
|
|
136
136
|
children: "B2B (Business)"
|
|
137
137
|
})] })]
|
|
138
138
|
})]
|
|
139
139
|
})]
|
|
140
140
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ R("div", {
|
|
142
142
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ R("div", {
|
|
144
144
|
className: "space-y-2",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ L(E, {
|
|
146
146
|
htmlFor: "email",
|
|
147
147
|
children: "Email"
|
|
148
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ L(T, {
|
|
149
149
|
id: "email",
|
|
150
150
|
type: "email",
|
|
151
|
-
value:
|
|
152
|
-
onChange: (e) =>
|
|
151
|
+
value: o.email,
|
|
152
|
+
onChange: (e) => c((t) => ({
|
|
153
153
|
...t,
|
|
154
154
|
email: e.target.value
|
|
155
155
|
})),
|
|
156
156
|
placeholder: "customer@example.com"
|
|
157
157
|
})]
|
|
158
|
-
}), /* @__PURE__ */
|
|
158
|
+
}), /* @__PURE__ */ R("div", {
|
|
159
159
|
className: "space-y-2",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ L(E, {
|
|
161
161
|
htmlFor: "phone",
|
|
162
162
|
children: "Phone"
|
|
163
|
-
}), /* @__PURE__ */
|
|
163
|
+
}), /* @__PURE__ */ L(T, {
|
|
164
164
|
id: "phone",
|
|
165
|
-
value:
|
|
166
|
-
onChange: (e) =>
|
|
165
|
+
value: o.phone,
|
|
166
|
+
onChange: (e) => c((t) => ({
|
|
167
167
|
...t,
|
|
168
168
|
phone: e.target.value
|
|
169
169
|
})),
|
|
@@ -171,15 +171,15 @@ function de() {
|
|
|
171
171
|
})]
|
|
172
172
|
})]
|
|
173
173
|
}),
|
|
174
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ R("div", {
|
|
175
175
|
className: "space-y-2",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ L(E, {
|
|
177
177
|
htmlFor: "company",
|
|
178
178
|
children: "Company"
|
|
179
|
-
}), /* @__PURE__ */
|
|
179
|
+
}), /* @__PURE__ */ L(T, {
|
|
180
180
|
id: "company",
|
|
181
|
-
value:
|
|
182
|
-
onChange: (e) =>
|
|
181
|
+
value: o.company,
|
|
182
|
+
onChange: (e) => c((t) => ({
|
|
183
183
|
...t,
|
|
184
184
|
company: e.target.value
|
|
185
185
|
})),
|
|
@@ -191,149 +191,149 @@ function de() {
|
|
|
191
191
|
})]
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
let { customerId:
|
|
194
|
+
function H() {
|
|
195
|
+
let { customerId: p } = le(), { basePath: D, navigate: O } = h(), { customer: k, isLoading: A, error: j, refetch: I } = _(p), { updateCustomer: H } = v(), { orders: U, isLoading: pe } = g({ filters: { customerId: p } }), { message: W, notify: me } = ae(), [G, K] = F(!1), [q, J] = F(!1), [he, Y] = F(null), [X, Z] = F({
|
|
196
196
|
name: "",
|
|
197
197
|
email: "",
|
|
198
198
|
phone: "",
|
|
199
199
|
company: ""
|
|
200
200
|
});
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
name:
|
|
204
|
-
email:
|
|
205
|
-
phone:
|
|
206
|
-
company:
|
|
201
|
+
ce(() => {
|
|
202
|
+
k && Z({
|
|
203
|
+
name: k.name,
|
|
204
|
+
email: k.email,
|
|
205
|
+
phone: k.phone,
|
|
206
|
+
company: k.company ?? ""
|
|
207
207
|
});
|
|
208
|
-
}, [
|
|
209
|
-
let
|
|
210
|
-
Y(null),
|
|
208
|
+
}, [k]);
|
|
209
|
+
let ge = () => O?.(m(D, "customers")), Q = (e) => O?.(m(D, e)), $ = () => {
|
|
210
|
+
Y(null), K(!0);
|
|
211
211
|
};
|
|
212
|
-
return
|
|
212
|
+
return p ? A ? /* @__PURE__ */ L(te, { message: "Loading customer details..." }) : j || !k ? /* @__PURE__ */ L(ee, {
|
|
213
213
|
title: "Customer not found",
|
|
214
|
-
onRetry:
|
|
215
|
-
}) : /* @__PURE__ */
|
|
216
|
-
title:
|
|
217
|
-
subtitle:
|
|
218
|
-
icon: /* @__PURE__ */
|
|
219
|
-
headerActions: /* @__PURE__ */
|
|
214
|
+
onRetry: I
|
|
215
|
+
}) : /* @__PURE__ */ R(M, {
|
|
216
|
+
title: k.name,
|
|
217
|
+
subtitle: k.company || k.email,
|
|
218
|
+
icon: /* @__PURE__ */ L(u, { size: 24 }),
|
|
219
|
+
headerActions: /* @__PURE__ */ R("div", {
|
|
220
220
|
className: "flex gap-2",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ R(b, {
|
|
222
222
|
variant: "outline",
|
|
223
|
-
onClick:
|
|
224
|
-
children: [/* @__PURE__ */
|
|
225
|
-
}),
|
|
223
|
+
onClick: ge,
|
|
224
|
+
children: [/* @__PURE__ */ L(e, { size: 16 }), " Back"]
|
|
225
|
+
}), G ? /* @__PURE__ */ R(ue, { children: [/* @__PURE__ */ R(b, {
|
|
226
226
|
variant: "outline",
|
|
227
227
|
onClick: () => {
|
|
228
|
-
Y(null),
|
|
229
|
-
name:
|
|
230
|
-
email:
|
|
231
|
-
phone:
|
|
232
|
-
company:
|
|
228
|
+
Y(null), K(!1), k && Z({
|
|
229
|
+
name: k.name,
|
|
230
|
+
email: k.email,
|
|
231
|
+
phone: k.phone,
|
|
232
|
+
company: k.company ?? ""
|
|
233
233
|
});
|
|
234
234
|
},
|
|
235
|
-
disabled:
|
|
236
|
-
children: [/* @__PURE__ */
|
|
237
|
-
}), /* @__PURE__ */
|
|
235
|
+
disabled: q,
|
|
236
|
+
children: [/* @__PURE__ */ L(d, { size: 16 }), " Cancel"]
|
|
237
|
+
}), /* @__PURE__ */ R(b, {
|
|
238
238
|
onClick: async () => {
|
|
239
|
-
if (
|
|
239
|
+
if (p) {
|
|
240
240
|
if (!X.name.trim()) {
|
|
241
241
|
Y("Customer name is required.");
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
|
-
|
|
244
|
+
J(!0), Y(null);
|
|
245
245
|
try {
|
|
246
|
-
await
|
|
246
|
+
await H(p, {
|
|
247
247
|
name: X.name.trim(),
|
|
248
248
|
email: X.email.trim(),
|
|
249
249
|
phone: X.phone.trim(),
|
|
250
250
|
company: X.company.trim() || void 0
|
|
251
|
-
}), me("Customer updated."),
|
|
251
|
+
}), me("Customer updated."), K(!1), I();
|
|
252
252
|
} catch (e) {
|
|
253
253
|
Y(e instanceof Error ? e.message : "Failed to update customer.");
|
|
254
254
|
} finally {
|
|
255
|
-
|
|
255
|
+
J(!1);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
|
-
disabled:
|
|
259
|
+
disabled: q,
|
|
260
260
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ L(s, { size: 16 }),
|
|
262
262
|
" ",
|
|
263
|
-
|
|
263
|
+
q ? "Saving…" : "Save"
|
|
264
264
|
]
|
|
265
|
-
})] }) : /* @__PURE__ */
|
|
265
|
+
})] }) : /* @__PURE__ */ R(b, {
|
|
266
266
|
onClick: $,
|
|
267
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ L(c, { size: 16 }), " Edit"]
|
|
268
268
|
})]
|
|
269
269
|
}),
|
|
270
|
-
headerContent: /* @__PURE__ */
|
|
270
|
+
headerContent: /* @__PURE__ */ R("div", {
|
|
271
271
|
className: "flex items-center gap-4",
|
|
272
272
|
children: [
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
variant:
|
|
276
|
-
children:
|
|
273
|
+
/* @__PURE__ */ L(re, { type: k.type }),
|
|
274
|
+
/* @__PURE__ */ L(y, {
|
|
275
|
+
variant: k.isActive ? "default" : "secondary",
|
|
276
|
+
children: k.isActive ? "Active" : "Inactive"
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ R("div", {
|
|
279
279
|
className: "flex items-center gap-1",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ L(l, {
|
|
281
281
|
size: 16,
|
|
282
282
|
className: "text-status-warning-text fill-current"
|
|
283
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ L("span", {
|
|
284
284
|
className: "font-medium",
|
|
285
|
-
children:
|
|
285
|
+
children: k.rating.toFixed(1)
|
|
286
286
|
})]
|
|
287
287
|
})
|
|
288
288
|
]
|
|
289
289
|
}),
|
|
290
290
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
icon: /* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ L(B, {
|
|
292
|
+
icon: /* @__PURE__ */ L(u, { size: 18 }),
|
|
293
293
|
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."
|
|
294
294
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ L(de, {
|
|
296
296
|
storageKey: "movethewheels-customer-details",
|
|
297
297
|
steps: [{
|
|
298
298
|
id: "new-order",
|
|
299
299
|
label: "Book a delivery for this customer",
|
|
300
300
|
description: "Start a new order pre-filled for this account.",
|
|
301
|
-
icon: /* @__PURE__ */
|
|
302
|
-
onClick: () => Q("orders/new")
|
|
301
|
+
icon: /* @__PURE__ */ L(n, { size: 16 }),
|
|
302
|
+
onClick: () => Q(f("orders/new", k.id))
|
|
303
303
|
}, {
|
|
304
304
|
id: "edit",
|
|
305
305
|
label: "Update contact details",
|
|
306
306
|
description: "Keep email, phone and address current.",
|
|
307
|
-
icon: /* @__PURE__ */
|
|
307
|
+
icon: /* @__PURE__ */ L(c, { size: 16 }),
|
|
308
308
|
onClick: $
|
|
309
309
|
}]
|
|
310
310
|
}),
|
|
311
|
-
|
|
311
|
+
W && /* @__PURE__ */ L("div", {
|
|
312
312
|
className: "mb-2",
|
|
313
|
-
children: /* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ L(ie, { message: W })
|
|
314
314
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ R("div", {
|
|
316
316
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ R("div", {
|
|
318
318
|
className: "lg:col-span-2 space-y-6",
|
|
319
319
|
children: [
|
|
320
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ R(z, { children: [/* @__PURE__ */ L("h2", {
|
|
321
321
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
322
322
|
children: "Contact Information"
|
|
323
|
-
}),
|
|
323
|
+
}), G ? /* @__PURE__ */ R("div", {
|
|
324
324
|
className: "space-y-4",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ L(N, { message: he }), /* @__PURE__ */ R("div", {
|
|
326
326
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
327
327
|
children: [
|
|
328
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ R("div", {
|
|
329
329
|
className: "space-y-2",
|
|
330
|
-
children: [/* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ R(E, {
|
|
331
331
|
htmlFor: "edit-name",
|
|
332
|
-
children: ["Name ", /* @__PURE__ */
|
|
332
|
+
children: ["Name ", /* @__PURE__ */ L("span", {
|
|
333
333
|
className: "text-status-error-text",
|
|
334
334
|
children: "*"
|
|
335
335
|
})]
|
|
336
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ L(T, {
|
|
337
337
|
id: "edit-name",
|
|
338
338
|
value: X.name,
|
|
339
339
|
onChange: (e) => Z((t) => ({
|
|
@@ -342,12 +342,12 @@ function B() {
|
|
|
342
342
|
}))
|
|
343
343
|
})]
|
|
344
344
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ R("div", {
|
|
346
346
|
className: "space-y-2",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ L(E, {
|
|
348
348
|
htmlFor: "edit-company",
|
|
349
349
|
children: "Company"
|
|
350
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ L(T, {
|
|
351
351
|
id: "edit-company",
|
|
352
352
|
value: X.company,
|
|
353
353
|
onChange: (e) => Z((t) => ({
|
|
@@ -357,12 +357,12 @@ function B() {
|
|
|
357
357
|
placeholder: "Company name (for B2B accounts)"
|
|
358
358
|
})]
|
|
359
359
|
}),
|
|
360
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ R("div", {
|
|
361
361
|
className: "space-y-2",
|
|
362
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ L(E, {
|
|
363
363
|
htmlFor: "edit-email",
|
|
364
364
|
children: "Email"
|
|
365
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ L(T, {
|
|
366
366
|
id: "edit-email",
|
|
367
367
|
type: "email",
|
|
368
368
|
value: X.email,
|
|
@@ -372,12 +372,12 @@ function B() {
|
|
|
372
372
|
}))
|
|
373
373
|
})]
|
|
374
374
|
}),
|
|
375
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ R("div", {
|
|
376
376
|
className: "space-y-2",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ L(E, {
|
|
378
378
|
htmlFor: "edit-phone",
|
|
379
379
|
children: "Phone"
|
|
380
|
-
}), /* @__PURE__ */
|
|
380
|
+
}), /* @__PURE__ */ L(T, {
|
|
381
381
|
id: "edit-phone",
|
|
382
382
|
value: X.phone,
|
|
383
383
|
onChange: (e) => Z((t) => ({
|
|
@@ -388,55 +388,55 @@ function B() {
|
|
|
388
388
|
})
|
|
389
389
|
]
|
|
390
390
|
})]
|
|
391
|
-
}) : /* @__PURE__ */
|
|
391
|
+
}) : /* @__PURE__ */ R("div", {
|
|
392
392
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
393
|
-
children: [/* @__PURE__ */
|
|
393
|
+
children: [/* @__PURE__ */ R("div", {
|
|
394
394
|
className: "space-y-4",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ R("div", {
|
|
396
396
|
className: "flex items-center gap-3",
|
|
397
|
-
children: [/* @__PURE__ */
|
|
397
|
+
children: [/* @__PURE__ */ L(r, {
|
|
398
398
|
size: 18,
|
|
399
399
|
className: "text-text-secondary"
|
|
400
|
-
}), /* @__PURE__ */
|
|
400
|
+
}), /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
401
401
|
className: "text-sm text-text-secondary",
|
|
402
402
|
children: "Email"
|
|
403
|
-
}), /* @__PURE__ */
|
|
403
|
+
}), /* @__PURE__ */ L("p", {
|
|
404
404
|
className: "font-medium",
|
|
405
|
-
children:
|
|
405
|
+
children: k.email || "—"
|
|
406
406
|
})] })]
|
|
407
|
-
}), /* @__PURE__ */
|
|
407
|
+
}), /* @__PURE__ */ R("div", {
|
|
408
408
|
className: "flex items-center gap-3",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ L(o, {
|
|
410
410
|
size: 18,
|
|
411
411
|
className: "text-text-secondary"
|
|
412
|
-
}), /* @__PURE__ */
|
|
412
|
+
}), /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
413
413
|
className: "text-sm text-text-secondary",
|
|
414
414
|
children: "Phone"
|
|
415
|
-
}), /* @__PURE__ */
|
|
415
|
+
}), /* @__PURE__ */ L("p", {
|
|
416
416
|
className: "font-medium",
|
|
417
|
-
children:
|
|
417
|
+
children: k.phone || "—"
|
|
418
418
|
})] })]
|
|
419
419
|
})]
|
|
420
|
-
}), /* @__PURE__ */
|
|
420
|
+
}), /* @__PURE__ */ R("div", {
|
|
421
421
|
className: "space-y-4",
|
|
422
|
-
children: [
|
|
422
|
+
children: [k.company && /* @__PURE__ */ R("div", {
|
|
423
423
|
className: "flex items-center gap-3",
|
|
424
|
-
children: [/* @__PURE__ */
|
|
424
|
+
children: [/* @__PURE__ */ L(t, {
|
|
425
425
|
size: 18,
|
|
426
426
|
className: "text-text-secondary"
|
|
427
|
-
}), /* @__PURE__ */
|
|
427
|
+
}), /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
428
428
|
className: "text-sm text-text-secondary",
|
|
429
429
|
children: "Company"
|
|
430
|
-
}), /* @__PURE__ */
|
|
430
|
+
}), /* @__PURE__ */ L("p", {
|
|
431
431
|
className: "font-medium",
|
|
432
|
-
children:
|
|
432
|
+
children: k.company
|
|
433
433
|
})] })]
|
|
434
434
|
}), (() => {
|
|
435
|
-
let e =
|
|
436
|
-
return e ? /* @__PURE__ */
|
|
435
|
+
let e = fe(k.website);
|
|
436
|
+
return e ? /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
437
437
|
className: "text-sm text-text-secondary",
|
|
438
438
|
children: "Website"
|
|
439
|
-
}), /* @__PURE__ */
|
|
439
|
+
}), /* @__PURE__ */ L("a", {
|
|
440
440
|
href: e,
|
|
441
441
|
target: "_blank",
|
|
442
442
|
rel: "noopener noreferrer",
|
|
@@ -446,122 +446,122 @@ function B() {
|
|
|
446
446
|
})()]
|
|
447
447
|
})]
|
|
448
448
|
})] }),
|
|
449
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ R(x, { children: [/* @__PURE__ */ L(C, { children: /* @__PURE__ */ R(w, {
|
|
450
450
|
className: "flex items-center gap-2",
|
|
451
|
-
children: [/* @__PURE__ */
|
|
452
|
-
}) }), /* @__PURE__ */
|
|
453
|
-
|
|
451
|
+
children: [/* @__PURE__ */ L(i, { size: 18 }), " Address"]
|
|
452
|
+
}) }), /* @__PURE__ */ L(S, { children: /* @__PURE__ */ L("p", { children: oe(k.address) }) })] }),
|
|
453
|
+
k.notes && /* @__PURE__ */ R(x, { children: [/* @__PURE__ */ L(C, { children: /* @__PURE__ */ R(w, {
|
|
454
454
|
className: "flex items-center gap-2",
|
|
455
|
-
children: [/* @__PURE__ */
|
|
456
|
-
}) }), /* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */ L(n, { size: 18 }), " Notes"]
|
|
456
|
+
}) }), /* @__PURE__ */ L(S, { children: /* @__PURE__ */ L("p", { children: k.notes }) })] }),
|
|
457
|
+
/* @__PURE__ */ R(x, { children: [/* @__PURE__ */ R(C, {
|
|
458
458
|
className: "flex flex-row items-center justify-between",
|
|
459
|
-
children: [/* @__PURE__ */
|
|
459
|
+
children: [/* @__PURE__ */ R(w, {
|
|
460
460
|
className: "flex items-center gap-2",
|
|
461
|
-
children: [/* @__PURE__ */
|
|
462
|
-
}), /* @__PURE__ */
|
|
461
|
+
children: [/* @__PURE__ */ L(a, { size: 18 }), " Orders"]
|
|
462
|
+
}), /* @__PURE__ */ R(b, {
|
|
463
463
|
variant: "outline",
|
|
464
464
|
size: "sm",
|
|
465
|
-
onClick: () => Q("orders/new"),
|
|
466
|
-
children: [/* @__PURE__ */
|
|
465
|
+
onClick: () => Q(f("orders/new", k.id)),
|
|
466
|
+
children: [/* @__PURE__ */ L(n, { size: 14 }), " New order"]
|
|
467
467
|
})]
|
|
468
|
-
}), /* @__PURE__ */
|
|
468
|
+
}), /* @__PURE__ */ L(S, { children: pe ? /* @__PURE__ */ L("p", {
|
|
469
469
|
className: "text-text-secondary text-center py-4",
|
|
470
470
|
children: "Loading orders…"
|
|
471
|
-
}) :
|
|
471
|
+
}) : U.length > 0 ? /* @__PURE__ */ L("div", {
|
|
472
472
|
className: "space-y-2",
|
|
473
|
-
children:
|
|
473
|
+
children: U.map((e) => /* @__PURE__ */ R("button", {
|
|
474
474
|
type: "button",
|
|
475
475
|
onClick: () => Q(`orders/${e.id}`),
|
|
476
476
|
className: "w-full flex items-center justify-between gap-3 p-3 border rounded-lg text-left hover:bg-bg-sunken/50 transition-colors",
|
|
477
|
-
children: [/* @__PURE__ */
|
|
477
|
+
children: [/* @__PURE__ */ R("div", {
|
|
478
478
|
className: "min-w-0",
|
|
479
|
-
children: [/* @__PURE__ */
|
|
479
|
+
children: [/* @__PURE__ */ L("p", {
|
|
480
480
|
className: "font-medium truncate",
|
|
481
481
|
children: e.orderNumber
|
|
482
|
-
}), /* @__PURE__ */
|
|
482
|
+
}), /* @__PURE__ */ R("p", {
|
|
483
483
|
className: "text-sm text-text-secondary",
|
|
484
484
|
children: [
|
|
485
485
|
P(e.createdAt, "relative"),
|
|
486
486
|
" ·",
|
|
487
487
|
" ",
|
|
488
|
-
|
|
488
|
+
se(e.pricing.total)
|
|
489
489
|
]
|
|
490
490
|
})]
|
|
491
|
-
}), /* @__PURE__ */
|
|
491
|
+
}), /* @__PURE__ */ L(ne, {
|
|
492
492
|
status: e.status,
|
|
493
493
|
type: "order",
|
|
494
494
|
size: "sm"
|
|
495
495
|
})]
|
|
496
496
|
}, e.id))
|
|
497
|
-
}) : /* @__PURE__ */
|
|
497
|
+
}) : /* @__PURE__ */ R("div", {
|
|
498
498
|
className: "text-center py-6",
|
|
499
499
|
children: [
|
|
500
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ L(a, {
|
|
501
501
|
size: 32,
|
|
502
502
|
className: "mx-auto mb-2 text-text-secondary opacity-50"
|
|
503
503
|
}),
|
|
504
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ L("p", {
|
|
505
505
|
className: "text-text-secondary",
|
|
506
506
|
children: "No orders yet for this customer"
|
|
507
507
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ L("button", {
|
|
509
509
|
type: "button",
|
|
510
|
-
onClick: () => Q("orders/new"),
|
|
510
|
+
onClick: () => Q(f("orders/new", k.id)),
|
|
511
511
|
className: "mt-1 text-sm text-primary hover:underline",
|
|
512
512
|
children: "Book their first delivery"
|
|
513
513
|
})
|
|
514
514
|
]
|
|
515
515
|
}) })] })
|
|
516
516
|
]
|
|
517
|
-
}), /* @__PURE__ */
|
|
517
|
+
}), /* @__PURE__ */ R("div", {
|
|
518
518
|
className: "space-y-6",
|
|
519
|
-
children: [/* @__PURE__ */
|
|
519
|
+
children: [/* @__PURE__ */ R(x, { children: [/* @__PURE__ */ L(C, { children: /* @__PURE__ */ L(w, { children: "Business Details" }) }), /* @__PURE__ */ R(S, {
|
|
520
520
|
className: "space-y-3",
|
|
521
521
|
children: [
|
|
522
|
-
|
|
522
|
+
k.businessLicense && /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
523
523
|
className: "text-sm text-text-secondary",
|
|
524
524
|
children: "Business License"
|
|
525
|
-
}), /* @__PURE__ */
|
|
525
|
+
}), /* @__PURE__ */ L("p", {
|
|
526
526
|
className: "font-mono",
|
|
527
|
-
children:
|
|
527
|
+
children: k.businessLicense
|
|
528
528
|
})] }),
|
|
529
|
-
|
|
529
|
+
k.taxId && /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
530
530
|
className: "text-sm text-text-secondary",
|
|
531
531
|
children: "Tax ID"
|
|
532
|
-
}), /* @__PURE__ */
|
|
532
|
+
}), /* @__PURE__ */ L("p", {
|
|
533
533
|
className: "font-mono",
|
|
534
|
-
children:
|
|
534
|
+
children: k.taxId
|
|
535
535
|
})] }),
|
|
536
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
537
537
|
className: "text-sm text-text-secondary",
|
|
538
538
|
children: "Preferred Contact"
|
|
539
|
-
}), /* @__PURE__ */
|
|
539
|
+
}), /* @__PURE__ */ L("p", {
|
|
540
540
|
className: "capitalize",
|
|
541
|
-
children:
|
|
541
|
+
children: k.preferredContactMethod
|
|
542
542
|
})] }),
|
|
543
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
544
544
|
className: "text-sm text-text-secondary",
|
|
545
545
|
children: "Marketing Opt-in"
|
|
546
|
-
}), /* @__PURE__ */
|
|
547
|
-
variant:
|
|
548
|
-
children:
|
|
546
|
+
}), /* @__PURE__ */ L(y, {
|
|
547
|
+
variant: k.marketingOptIn ? "default" : "secondary",
|
|
548
|
+
children: k.marketingOptIn ? "Yes" : "No"
|
|
549
549
|
})] })
|
|
550
550
|
]
|
|
551
|
-
})] }), /* @__PURE__ */
|
|
551
|
+
})] }), /* @__PURE__ */ R(x, { children: [/* @__PURE__ */ L(C, { children: /* @__PURE__ */ L(w, { children: "Account Info" }) }), /* @__PURE__ */ R(S, {
|
|
552
552
|
className: "space-y-3",
|
|
553
|
-
children: [/* @__PURE__ */
|
|
553
|
+
children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
554
554
|
className: "text-sm text-text-secondary",
|
|
555
555
|
children: "Created"
|
|
556
|
-
}), /* @__PURE__ */
|
|
556
|
+
}), /* @__PURE__ */ L("p", { children: P(k.createdAt, "full") })] }), /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
557
557
|
className: "text-sm text-text-secondary",
|
|
558
558
|
children: "Last Updated"
|
|
559
|
-
}), /* @__PURE__ */
|
|
559
|
+
}), /* @__PURE__ */ L("p", { children: P(k.updatedAt, "relative") })] })]
|
|
560
560
|
})] })]
|
|
561
561
|
})]
|
|
562
562
|
})
|
|
563
563
|
]
|
|
564
|
-
}) : /* @__PURE__ */
|
|
564
|
+
}) : /* @__PURE__ */ L(V, {});
|
|
565
565
|
}
|
|
566
566
|
//#endregion
|
|
567
|
-
export {
|
|
567
|
+
export { H as default };
|