@burdenoff/microfe-movethewheels 2026.929.3 → 2026.929.4
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/generated/wspace-types.d.ts +1547 -64
- package/dist/hooks/useCustomers.js +3 -9
- package/dist/hooks/useFleet.js +146 -149
- package/dist/hooks/useInventory.js +178 -153
- package/dist/hooks/useRoutes.js +9 -9
- package/dist/hooks/useTracking.js +14 -16
- package/dist/movethewheels/hooks/useFleet.d.ts +9 -2
- package/dist/movethewheels/hooks/useInventory.d.ts +13 -12
- package/dist/movethewheels/hooks/useRoutes.d.ts +4 -1
- package/dist/movethewheels/types/index.d.ts +33 -23
- package/dist/movethewheels/utils/formatters.d.ts +1 -1
- package/dist/pages/CustomerDetailsPage.js +6 -6
- package/dist/pages/CustomersPage.js +2 -2
- package/dist/pages/DashboardPage.js +1 -1
- package/dist/pages/DriverDetailsPage.js +7 -3
- package/dist/pages/DriversPage.js +4 -4
- package/dist/pages/FleetPage.js +1 -1
- package/dist/pages/InventoryPage.js +11 -12
- package/dist/pages/LiveTrackingPage.js +4 -4
- package/dist/pages/ProductDetailsPage.js +408 -249
- package/dist/pages/ProductsPage.js +5 -5
- package/dist/pages/RouteDetailsPage.js +8 -10
- package/dist/pages/RoutesPage.js +2 -2
- package/dist/pages/TrackingPage.js +14 -8
- package/dist/pages/WarehouseDetailsPage.js +166 -163
- package/dist/pages/WarehousesPage.js +29 -21
- package/package.json +1 -1
- package/src/generated/wspace-types.ts +1762 -64
- package/src/movethewheels/hooks/useCustomers.ts +7 -9
- package/src/movethewheels/hooks/useFleet.ts +89 -31
- package/src/movethewheels/hooks/useInventory.ts +143 -49
- package/src/movethewheels/hooks/useRoutes.ts +36 -16
- package/src/movethewheels/hooks/useTracking.ts +23 -15
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +14 -8
- package/src/movethewheels/pages/CustomersPage.tsx +5 -2
- package/src/movethewheels/pages/DashboardPage.tsx +3 -1
- package/src/movethewheels/pages/DriverDetailsPage.tsx +13 -3
- package/src/movethewheels/pages/DriversPage.tsx +1 -1
- package/src/movethewheels/pages/FleetPage.tsx +1 -1
- package/src/movethewheels/pages/InventoryPage.tsx +20 -16
- package/src/movethewheels/pages/LiveTrackingPage.tsx +6 -4
- package/src/movethewheels/pages/ProductDetailsPage.tsx +228 -49
- package/src/movethewheels/pages/ProductsPage.tsx +13 -5
- package/src/movethewheels/pages/RouteDetailsPage.tsx +16 -8
- package/src/movethewheels/pages/RoutesPage.tsx +4 -2
- package/src/movethewheels/pages/TrackingPage.tsx +25 -10
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +42 -29
- package/src/movethewheels/pages/WarehousesPage.tsx +23 -15
- package/src/movethewheels/types/index.ts +36 -24
- package/src/movethewheels/utils/formatters.ts +1 -1
|
@@ -7,384 +7,493 @@ import { Package as a } from "../node_modules/lucide-react/dist/esm/icons/packag
|
|
|
7
7
|
import { Save as o } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
8
8
|
import { SquarePen as s } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
9
9
|
import { Tag as c } from "../node_modules/lucide-react/dist/esm/icons/tag.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
10
|
+
import { Trash2 as l } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
11
|
+
import { Warehouse as u } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
|
|
12
|
+
import { joinPath as d } from "../utils/navigation.js";
|
|
13
|
+
import { useMoveTheWheels as f } from "../providers/MoveTheWheelsProvider.js";
|
|
14
|
+
import { useInventory as p, useProduct as m, useProductStockLevels as h } from "../hooks/useInventory.js";
|
|
15
|
+
import { Badge as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Checkbox as S, Input as C, Label as w, Textarea as T } from "../components/ui.js";
|
|
16
|
+
import { ErrorState as E, LoadingState as ee, PageLayout as D } from "../components/PageLayout.js";
|
|
17
|
+
import { FormError as O } from "../components/FormError.js";
|
|
18
|
+
import { formatCurrency as te } from "../utils/formatters.js";
|
|
19
|
+
import { useEffect as k, useState as A } from "react";
|
|
20
|
+
import { useLocation as j, useParams as ne } from "react-router";
|
|
21
|
+
import { Fragment as re, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
22
|
+
import { EmphasisPanel as P, NextSteps as ie, PagePurpose as F, ResponsiveDialog as I, ResponsiveDialogContent as ae, ResponsiveDialogDescription as oe, ResponsiveDialogFooter as se, ResponsiveDialogHeader as ce, ResponsiveDialogTitle as le } from "@burdenoff/fe-libs/ui";
|
|
22
23
|
//#region src/movethewheels/pages/ProductDetailsPage.tsx
|
|
23
|
-
function
|
|
24
|
-
let { basePath: n, navigate: r } =
|
|
24
|
+
function L({ editId: t }) {
|
|
25
|
+
let { basePath: n, navigate: r } = f(), { createProduct: i, updateProduct: s } = p(), { product: c } = m(t), l = !!t, [u, h] = A({
|
|
25
26
|
name: "",
|
|
26
27
|
sku: "",
|
|
28
|
+
description: "",
|
|
27
29
|
category: "",
|
|
28
30
|
brand: "",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
length: "",
|
|
32
|
+
width: "",
|
|
33
|
+
height: "",
|
|
34
|
+
dimensionUnit: "",
|
|
35
|
+
weight: "",
|
|
36
|
+
value: "",
|
|
37
|
+
hazardous: !1,
|
|
38
|
+
fragile: !1,
|
|
39
|
+
temperatureControlled: !1
|
|
40
|
+
}), [g, v] = A(!1), [y, b] = A(null);
|
|
41
|
+
k(() => {
|
|
32
42
|
t && c && h({
|
|
33
43
|
name: c.name ?? "",
|
|
34
44
|
sku: c.sku ?? "",
|
|
45
|
+
description: c.description ?? "",
|
|
35
46
|
category: c.category ?? "",
|
|
36
47
|
brand: c.brand ?? "",
|
|
37
|
-
|
|
48
|
+
length: c.dimensions?.length === void 0 ? "" : String(c.dimensions.length),
|
|
49
|
+
width: c.dimensions?.width === void 0 ? "" : String(c.dimensions.width),
|
|
50
|
+
height: c.dimensions?.height === void 0 ? "" : String(c.dimensions.height),
|
|
51
|
+
dimensionUnit: c.dimensions?.unit ?? "",
|
|
52
|
+
weight: c.weight === void 0 ? "" : String(c.weight),
|
|
53
|
+
value: c.value === void 0 ? "" : String(c.value),
|
|
54
|
+
hazardous: c.hazardous,
|
|
55
|
+
fragile: c.fragile,
|
|
56
|
+
temperatureControlled: c.temperatureControlled
|
|
38
57
|
});
|
|
39
58
|
}, [t, c]);
|
|
40
|
-
let
|
|
41
|
-
if (e.preventDefault(), !
|
|
59
|
+
let x = () => r?.(d(n, "inventory/products")), E = async (e) => {
|
|
60
|
+
if (e.preventDefault(), !u.name.trim() || !u.sku.trim()) {
|
|
42
61
|
b("Product name and SKU are required.");
|
|
43
62
|
return;
|
|
44
63
|
}
|
|
45
64
|
v(!0), b(null);
|
|
46
65
|
try {
|
|
47
|
-
let e =
|
|
66
|
+
let e = (e) => {
|
|
67
|
+
if (!e.trim()) return;
|
|
68
|
+
let t = Number(e);
|
|
69
|
+
return Number.isFinite(t) ? t : void 0;
|
|
70
|
+
}, a = u.length.trim() || u.width.trim() || u.height.trim() || u.dimensionUnit.trim() ? {
|
|
71
|
+
...e(u.length) === void 0 ? {} : { length: e(u.length) },
|
|
72
|
+
...e(u.width) === void 0 ? {} : { width: e(u.width) },
|
|
73
|
+
...e(u.height) === void 0 ? {} : { height: e(u.height) },
|
|
74
|
+
...u.dimensionUnit.trim() ? { unit: u.dimensionUnit.trim() } : {}
|
|
75
|
+
} : void 0, o = {
|
|
76
|
+
name: u.name.trim(),
|
|
77
|
+
sku: u.sku.trim(),
|
|
78
|
+
description: u.description.trim() || (l ? null : void 0),
|
|
79
|
+
category: u.category.trim() || (l ? null : void 0),
|
|
80
|
+
brand: u.brand.trim() || (l ? null : void 0),
|
|
81
|
+
dimensions: a ?? (l ? null : void 0),
|
|
82
|
+
weight: e(u.weight) ?? (l ? null : void 0),
|
|
83
|
+
value: e(u.value) ?? (l ? null : void 0),
|
|
84
|
+
hazardous: u.hazardous,
|
|
85
|
+
fragile: u.fragile,
|
|
86
|
+
temperatureControlled: u.temperatureControlled
|
|
87
|
+
};
|
|
48
88
|
if (l && t) {
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
sku: m.sku.trim(),
|
|
52
|
-
category: m.category.trim() || void 0,
|
|
53
|
-
brand: m.brand.trim() || void 0,
|
|
54
|
-
weight: e !== void 0 && !Number.isNaN(e) ? e : void 0
|
|
55
|
-
});
|
|
56
|
-
r?.(u(n, `inventory/products/${i.id}`));
|
|
89
|
+
let e = await s(t, o);
|
|
90
|
+
r?.(d(n, `inventory/products/${e.id}`));
|
|
57
91
|
} else {
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
-
sku: m.sku.trim(),
|
|
61
|
-
category: m.category.trim() || void 0,
|
|
62
|
-
brand: m.brand.trim() || void 0,
|
|
63
|
-
weight: e !== void 0 && !Number.isNaN(e) ? e : void 0
|
|
64
|
-
});
|
|
65
|
-
r?.(u(n, `inventory/products/${t.id}`));
|
|
92
|
+
let e = await i(o);
|
|
93
|
+
r?.(d(n, `inventory/products/${e.id}`));
|
|
66
94
|
}
|
|
67
95
|
} catch (e) {
|
|
68
96
|
console.error("Failed to create product:", e), b(e instanceof Error ? e.message : "Failed to create product. Please try again."), v(!1);
|
|
69
97
|
}
|
|
70
98
|
};
|
|
71
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ N(D, {
|
|
72
100
|
title: l ? "Edit Product" : "Add Product",
|
|
73
101
|
subtitle: "Add an item to your catalog",
|
|
74
|
-
icon: /* @__PURE__ */
|
|
75
|
-
headerActions: /* @__PURE__ */
|
|
102
|
+
icon: /* @__PURE__ */ M(a, { size: 24 }),
|
|
103
|
+
headerActions: /* @__PURE__ */ N("div", {
|
|
76
104
|
className: "flex gap-2",
|
|
77
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ N(_, {
|
|
78
106
|
variant: "outline",
|
|
79
|
-
onClick:
|
|
80
|
-
disabled:
|
|
81
|
-
children: [/* @__PURE__ */
|
|
82
|
-
}), /* @__PURE__ */
|
|
83
|
-
onClick:
|
|
84
|
-
disabled:
|
|
107
|
+
onClick: x,
|
|
108
|
+
disabled: g,
|
|
109
|
+
children: [/* @__PURE__ */ M(e, { size: 16 }), " Cancel"]
|
|
110
|
+
}), /* @__PURE__ */ N(_, {
|
|
111
|
+
onClick: E,
|
|
112
|
+
disabled: g,
|
|
85
113
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ M(o, { size: 16 }),
|
|
87
115
|
" ",
|
|
88
|
-
l ?
|
|
116
|
+
l ? g ? "Saving..." : "Save Changes" : g ? "Saving..." : "Add Product"
|
|
89
117
|
]
|
|
90
118
|
})]
|
|
91
119
|
}),
|
|
92
|
-
children: [/* @__PURE__ */
|
|
93
|
-
icon: /* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ M(F, {
|
|
121
|
+
icon: /* @__PURE__ */ M(a, { size: 18 }),
|
|
94
122
|
children: "Add a product so it can be added to orders and stocked in warehouses. A name and SKU are all it takes to start — category, brand and weight help with picking, pricing and routing."
|
|
95
|
-
}), /* @__PURE__ */
|
|
96
|
-
onSubmit:
|
|
123
|
+
}), /* @__PURE__ */ N("form", {
|
|
124
|
+
onSubmit: E,
|
|
97
125
|
className: "max-w-2xl space-y-6",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ M(O, { message: y }), /* @__PURE__ */ N(P, { children: [/* @__PURE__ */ M("h2", {
|
|
99
127
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
100
128
|
children: "Product Details"
|
|
101
|
-
}), /* @__PURE__ */
|
|
129
|
+
}), /* @__PURE__ */ N("div", {
|
|
102
130
|
className: "space-y-4",
|
|
103
|
-
children: [
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ N("div", {
|
|
133
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
134
|
+
children: [/* @__PURE__ */ N("div", {
|
|
135
|
+
className: "space-y-2",
|
|
136
|
+
children: [/* @__PURE__ */ N(w, {
|
|
137
|
+
htmlFor: "name",
|
|
138
|
+
children: ["Name ", /* @__PURE__ */ M("span", {
|
|
139
|
+
className: "text-status-error-text",
|
|
140
|
+
children: "*"
|
|
141
|
+
})]
|
|
142
|
+
}), /* @__PURE__ */ M(C, {
|
|
143
|
+
id: "name",
|
|
144
|
+
value: u.name,
|
|
145
|
+
onChange: (e) => h((t) => ({
|
|
146
|
+
...t,
|
|
147
|
+
name: e.target.value
|
|
148
|
+
})),
|
|
149
|
+
placeholder: "Wireless Headphones",
|
|
150
|
+
required: !0
|
|
112
151
|
})]
|
|
113
|
-
}), /* @__PURE__ */ N(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
152
|
+
}), /* @__PURE__ */ N("div", {
|
|
153
|
+
className: "space-y-2",
|
|
154
|
+
children: [/* @__PURE__ */ N(w, {
|
|
155
|
+
htmlFor: "sku",
|
|
156
|
+
children: ["SKU ", /* @__PURE__ */ M("span", {
|
|
157
|
+
className: "text-status-error-text",
|
|
158
|
+
children: "*"
|
|
159
|
+
})]
|
|
160
|
+
}), /* @__PURE__ */ M(C, {
|
|
161
|
+
id: "sku",
|
|
162
|
+
value: u.sku,
|
|
163
|
+
onChange: (e) => h((t) => ({
|
|
164
|
+
...t,
|
|
165
|
+
sku: e.target.value
|
|
166
|
+
})),
|
|
167
|
+
placeholder: "SKU-001",
|
|
168
|
+
required: !0
|
|
130
169
|
})]
|
|
131
|
-
}), /* @__PURE__ */ N(x, {
|
|
132
|
-
id: "sku",
|
|
133
|
-
value: m.sku,
|
|
134
|
-
onChange: (e) => h((t) => ({
|
|
135
|
-
...t,
|
|
136
|
-
sku: e.target.value
|
|
137
|
-
})),
|
|
138
|
-
placeholder: "SKU-001",
|
|
139
|
-
required: !0
|
|
140
170
|
})]
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
/* @__PURE__ */ P("div", {
|
|
171
|
+
}),
|
|
172
|
+
/* @__PURE__ */ N("div", {
|
|
173
|
+
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
174
|
+
children: [/* @__PURE__ */ N("div", {
|
|
146
175
|
className: "space-y-2",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ M(w, {
|
|
148
177
|
htmlFor: "category",
|
|
149
178
|
children: "Category"
|
|
150
|
-
}), /* @__PURE__ */
|
|
179
|
+
}), /* @__PURE__ */ M(C, {
|
|
151
180
|
id: "category",
|
|
152
|
-
value:
|
|
181
|
+
value: u.category,
|
|
153
182
|
onChange: (e) => h((t) => ({
|
|
154
183
|
...t,
|
|
155
184
|
category: e.target.value
|
|
156
185
|
})),
|
|
157
186
|
placeholder: "Electronics"
|
|
158
187
|
})]
|
|
159
|
-
}),
|
|
160
|
-
/* @__PURE__ */ P("div", {
|
|
188
|
+
}), /* @__PURE__ */ N("div", {
|
|
161
189
|
className: "space-y-2",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ M(w, {
|
|
163
191
|
htmlFor: "brand",
|
|
164
192
|
children: "Brand"
|
|
165
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ M(C, {
|
|
166
194
|
id: "brand",
|
|
167
|
-
value:
|
|
195
|
+
value: u.brand,
|
|
168
196
|
onChange: (e) => h((t) => ({
|
|
169
197
|
...t,
|
|
170
198
|
brand: e.target.value
|
|
171
199
|
})),
|
|
172
200
|
placeholder: "Acme"
|
|
173
201
|
})]
|
|
174
|
-
})
|
|
175
|
-
|
|
202
|
+
})]
|
|
203
|
+
}),
|
|
204
|
+
/* @__PURE__ */ N("div", {
|
|
205
|
+
className: "space-y-2",
|
|
206
|
+
children: [/* @__PURE__ */ M(w, {
|
|
207
|
+
htmlFor: "description",
|
|
208
|
+
children: "Description"
|
|
209
|
+
}), /* @__PURE__ */ M(T, {
|
|
210
|
+
id: "description",
|
|
211
|
+
value: u.description,
|
|
212
|
+
onChange: (e) => h((t) => ({
|
|
213
|
+
...t,
|
|
214
|
+
description: e.target.value
|
|
215
|
+
})),
|
|
216
|
+
placeholder: "Describe the item",
|
|
217
|
+
rows: 3
|
|
218
|
+
})]
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ N("div", {
|
|
221
|
+
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
222
|
+
children: [[
|
|
223
|
+
["length", "Length"],
|
|
224
|
+
["width", "Width"],
|
|
225
|
+
["height", "Height"]
|
|
226
|
+
].map(([e, t]) => /* @__PURE__ */ N("div", {
|
|
227
|
+
className: "space-y-2",
|
|
228
|
+
children: [/* @__PURE__ */ M(w, {
|
|
229
|
+
htmlFor: e,
|
|
230
|
+
children: t
|
|
231
|
+
}), /* @__PURE__ */ M(C, {
|
|
232
|
+
id: e,
|
|
233
|
+
type: "number",
|
|
234
|
+
min: "0",
|
|
235
|
+
step: "0.01",
|
|
236
|
+
value: u[e],
|
|
237
|
+
onChange: (t) => h((n) => ({
|
|
238
|
+
...n,
|
|
239
|
+
[e]: t.target.value
|
|
240
|
+
})),
|
|
241
|
+
placeholder: "Not provided"
|
|
242
|
+
})]
|
|
243
|
+
}, e)), /* @__PURE__ */ N("div", {
|
|
244
|
+
className: "space-y-2",
|
|
245
|
+
children: [/* @__PURE__ */ M(w, {
|
|
246
|
+
htmlFor: "dimensionUnit",
|
|
247
|
+
children: "Dimension unit"
|
|
248
|
+
}), /* @__PURE__ */ M(C, {
|
|
249
|
+
id: "dimensionUnit",
|
|
250
|
+
value: u.dimensionUnit,
|
|
251
|
+
onChange: (e) => h((t) => ({
|
|
252
|
+
...t,
|
|
253
|
+
dimensionUnit: e.target.value
|
|
254
|
+
})),
|
|
255
|
+
placeholder: "cm"
|
|
256
|
+
})]
|
|
257
|
+
})]
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ N("div", {
|
|
260
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
261
|
+
children: [/* @__PURE__ */ N("div", {
|
|
262
|
+
className: "space-y-2",
|
|
263
|
+
children: [/* @__PURE__ */ M(w, {
|
|
264
|
+
htmlFor: "value",
|
|
265
|
+
children: "Unit value"
|
|
266
|
+
}), /* @__PURE__ */ M(C, {
|
|
267
|
+
id: "value",
|
|
268
|
+
type: "number",
|
|
269
|
+
min: "0",
|
|
270
|
+
step: "0.01",
|
|
271
|
+
value: u.value,
|
|
272
|
+
onChange: (e) => h((t) => ({
|
|
273
|
+
...t,
|
|
274
|
+
value: e.target.value
|
|
275
|
+
})),
|
|
276
|
+
placeholder: "Not provided"
|
|
277
|
+
})]
|
|
278
|
+
}), /* @__PURE__ */ N("div", {
|
|
176
279
|
className: "space-y-2",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ M(w, {
|
|
178
281
|
htmlFor: "weight",
|
|
179
282
|
children: "Weight (kg)"
|
|
180
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ M(C, {
|
|
181
284
|
id: "weight",
|
|
182
285
|
type: "number",
|
|
183
286
|
min: "0",
|
|
184
287
|
step: "0.01",
|
|
185
|
-
value:
|
|
288
|
+
value: u.weight,
|
|
186
289
|
onChange: (e) => h((t) => ({
|
|
187
290
|
...t,
|
|
188
291
|
weight: e.target.value
|
|
189
292
|
})),
|
|
190
|
-
placeholder: "
|
|
293
|
+
placeholder: "Not provided"
|
|
191
294
|
})]
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
|
|
295
|
+
})]
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ M("div", {
|
|
298
|
+
className: "flex flex-wrap gap-4",
|
|
299
|
+
children: [
|
|
300
|
+
["fragile", "Fragile"],
|
|
301
|
+
["hazardous", "Hazardous"],
|
|
302
|
+
["temperatureControlled", "Temperature controlled"]
|
|
303
|
+
].map(([e, t]) => /* @__PURE__ */ N("label", {
|
|
304
|
+
className: "flex items-center gap-2 text-sm",
|
|
305
|
+
children: [/* @__PURE__ */ M(S, {
|
|
306
|
+
checked: u[e],
|
|
307
|
+
onCheckedChange: (t) => h((n) => ({
|
|
308
|
+
...n,
|
|
309
|
+
[e]: t === !0
|
|
310
|
+
}))
|
|
311
|
+
}), t]
|
|
312
|
+
}, e))
|
|
313
|
+
})
|
|
314
|
+
]
|
|
195
315
|
})] })]
|
|
196
316
|
})]
|
|
197
317
|
});
|
|
198
318
|
}
|
|
199
|
-
function
|
|
200
|
-
let { productId: o } =
|
|
319
|
+
function R() {
|
|
320
|
+
let { productId: o } = ne(), { basePath: S, navigate: C } = f(), { product: w, isLoading: T, error: R, refetch: ue } = m(o), { deleteProduct: de } = p(), z = j().pathname.endsWith("/edit"), [B, V] = A(!1), [H, U] = A(!1), [fe, W] = A(null), [G, K] = A(0), { levels: q, totalLevels: J, totalAvailable: pe, hasMore: Y, isLoading: X, error: Z } = h(z ? void 0 : o, {
|
|
201
321
|
limit: 20,
|
|
202
|
-
offset:
|
|
322
|
+
offset: G * 20
|
|
203
323
|
});
|
|
204
|
-
|
|
205
|
-
|
|
324
|
+
k(() => {
|
|
325
|
+
K(0);
|
|
206
326
|
}, [o]);
|
|
207
|
-
let
|
|
208
|
-
return o ?
|
|
327
|
+
let Q = () => C?.(d(S, "inventory/products")), $ = (e) => C?.(d(S, e));
|
|
328
|
+
return o ? z ? /* @__PURE__ */ M(L, { editId: o }) : T ? /* @__PURE__ */ M(ee, { message: "Loading product details..." }) : R || !w ? /* @__PURE__ */ M(E, {
|
|
209
329
|
title: "Product not found",
|
|
210
|
-
onRetry:
|
|
211
|
-
}) : /* @__PURE__ */
|
|
212
|
-
title:
|
|
213
|
-
subtitle: `SKU: ${
|
|
214
|
-
icon: /* @__PURE__ */
|
|
215
|
-
headerActions: /* @__PURE__ */
|
|
330
|
+
onRetry: ue
|
|
331
|
+
}) : /* @__PURE__ */ N(D, {
|
|
332
|
+
title: w.name,
|
|
333
|
+
subtitle: `SKU: ${w.sku}`,
|
|
334
|
+
icon: /* @__PURE__ */ M(a, { size: 24 }),
|
|
335
|
+
headerActions: /* @__PURE__ */ N("div", {
|
|
216
336
|
className: "flex gap-2",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ N(_, {
|
|
218
338
|
variant: "outline",
|
|
219
|
-
onClick:
|
|
220
|
-
children: [/* @__PURE__ */
|
|
221
|
-
}), /* @__PURE__ */
|
|
222
|
-
onClick: () =>
|
|
223
|
-
children: [/* @__PURE__ */
|
|
339
|
+
onClick: Q,
|
|
340
|
+
children: [/* @__PURE__ */ M(e, { size: 16 }), " Back"]
|
|
341
|
+
}), /* @__PURE__ */ N(_, {
|
|
342
|
+
onClick: () => C?.(d(S, `inventory/products/${o}/edit`)),
|
|
343
|
+
children: [/* @__PURE__ */ M(s, { size: 16 }), " Edit"]
|
|
224
344
|
})]
|
|
225
345
|
}),
|
|
226
|
-
headerContent: /* @__PURE__ */
|
|
346
|
+
headerContent: /* @__PURE__ */ N("div", {
|
|
227
347
|
className: "flex gap-2",
|
|
228
348
|
children: [
|
|
229
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ M(g, {
|
|
230
350
|
variant: "outline",
|
|
231
|
-
children:
|
|
351
|
+
children: w.category ?? "Not provided"
|
|
232
352
|
}),
|
|
233
|
-
|
|
353
|
+
w.brand && /* @__PURE__ */ M(g, {
|
|
234
354
|
variant: "secondary",
|
|
235
|
-
children:
|
|
355
|
+
children: w.brand
|
|
236
356
|
}),
|
|
237
|
-
|
|
357
|
+
w.fragile && /* @__PURE__ */ M(g, {
|
|
238
358
|
variant: "destructive",
|
|
239
359
|
children: "Fragile"
|
|
240
360
|
}),
|
|
241
|
-
|
|
361
|
+
w.hazardous && /* @__PURE__ */ M(g, {
|
|
242
362
|
variant: "destructive",
|
|
243
363
|
children: "Hazardous"
|
|
244
364
|
}),
|
|
245
|
-
|
|
365
|
+
w.temperatureControlled && /* @__PURE__ */ M(g, {
|
|
246
366
|
variant: "secondary",
|
|
247
367
|
children: "Temp Controlled"
|
|
248
368
|
})
|
|
249
369
|
]
|
|
250
370
|
}),
|
|
251
371
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
icon: /* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ M(F, {
|
|
373
|
+
icon: /* @__PURE__ */ M(a, { size: 18 }),
|
|
254
374
|
children: "The catalog record for this item — its dimensions, weight, value and handling flags. These drive how it's packed, priced and routed, so keep them accurate before adding the product to an order or stocking it in a warehouse."
|
|
255
375
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ M(ie, {
|
|
257
377
|
storageKey: "movethewheels-product-details",
|
|
258
378
|
steps: [{
|
|
259
379
|
id: "order",
|
|
260
380
|
label: "Add this product to an order",
|
|
261
381
|
description: "Include it on a new delivery.",
|
|
262
|
-
icon: /* @__PURE__ */
|
|
263
|
-
onClick: () =>
|
|
382
|
+
icon: /* @__PURE__ */ M(a, { size: 16 }),
|
|
383
|
+
onClick: () => $("orders/new")
|
|
264
384
|
}, {
|
|
265
385
|
id: "edit",
|
|
266
386
|
label: "Edit product details",
|
|
267
387
|
description: "Update dimensions, value or handling flags.",
|
|
268
|
-
icon: /* @__PURE__ */
|
|
269
|
-
onClick: () =>
|
|
388
|
+
icon: /* @__PURE__ */ M(c, { size: 16 }),
|
|
389
|
+
onClick: () => $(`inventory/products/${o}/edit`)
|
|
270
390
|
}]
|
|
271
391
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ N("div", {
|
|
273
393
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
394
|
+
children: [/* @__PURE__ */ N("div", {
|
|
275
395
|
className: "lg:col-span-2 space-y-6",
|
|
276
396
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ N(v, { children: [/* @__PURE__ */ M(b, { children: /* @__PURE__ */ M(x, { children: "Description" }) }), /* @__PURE__ */ M(y, { children: /* @__PURE__ */ M("p", { children: w.description ?? "Not provided" }) })] }),
|
|
398
|
+
/* @__PURE__ */ N(v, { children: [/* @__PURE__ */ M(b, { children: /* @__PURE__ */ N(x, {
|
|
279
399
|
className: "flex items-center gap-2",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
281
|
-
}) }), /* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ M(t, { size: 18 }), " Dimensions & Weight"]
|
|
401
|
+
}) }), /* @__PURE__ */ M(y, { children: /* @__PURE__ */ M("div", {
|
|
282
402
|
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
283
403
|
children: [
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
315
|
-
className: "text-sm text-text-secondary",
|
|
316
|
-
children: "Weight"
|
|
317
|
-
}), /* @__PURE__ */ P("p", {
|
|
318
|
-
className: "text-2xl font-bold",
|
|
319
|
-
children: [S.weight, /* @__PURE__ */ N("span", {
|
|
320
|
-
className: "text-sm font-normal",
|
|
321
|
-
children: " kg"
|
|
322
|
-
})]
|
|
323
|
-
})] })
|
|
324
|
-
]
|
|
404
|
+
[
|
|
405
|
+
"Length",
|
|
406
|
+
w.dimensions?.length,
|
|
407
|
+
w.dimensions?.unit
|
|
408
|
+
],
|
|
409
|
+
[
|
|
410
|
+
"Width",
|
|
411
|
+
w.dimensions?.width,
|
|
412
|
+
w.dimensions?.unit
|
|
413
|
+
],
|
|
414
|
+
[
|
|
415
|
+
"Height",
|
|
416
|
+
w.dimensions?.height,
|
|
417
|
+
w.dimensions?.unit
|
|
418
|
+
],
|
|
419
|
+
[
|
|
420
|
+
"Weight",
|
|
421
|
+
w.weight,
|
|
422
|
+
"kg"
|
|
423
|
+
]
|
|
424
|
+
].map(([e, t, n]) => /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
|
|
425
|
+
className: "text-sm text-text-secondary",
|
|
426
|
+
children: e
|
|
427
|
+
}), /* @__PURE__ */ N("p", {
|
|
428
|
+
className: "text-2xl font-bold",
|
|
429
|
+
children: [t === void 0 ? "Not provided" : t, t !== void 0 && n && /* @__PURE__ */ N("span", {
|
|
430
|
+
className: "text-sm font-normal",
|
|
431
|
+
children: [" ", n]
|
|
432
|
+
})]
|
|
433
|
+
})] }, e))
|
|
325
434
|
}) })] }),
|
|
326
|
-
|
|
435
|
+
w.attributes.length > 0 && /* @__PURE__ */ N(v, { children: [/* @__PURE__ */ M(b, { children: /* @__PURE__ */ N(x, {
|
|
327
436
|
className: "flex items-center gap-2",
|
|
328
|
-
children: [/* @__PURE__ */
|
|
329
|
-
}) }), /* @__PURE__ */
|
|
437
|
+
children: [/* @__PURE__ */ M(c, { size: 18 }), " Attributes"]
|
|
438
|
+
}) }), /* @__PURE__ */ M(y, { children: /* @__PURE__ */ M("div", {
|
|
330
439
|
className: "grid grid-cols-2 md:grid-cols-3 gap-4",
|
|
331
|
-
children:
|
|
440
|
+
children: w.attributes.map((e, t) => /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
|
|
332
441
|
className: "text-sm text-text-secondary",
|
|
333
442
|
children: e.name
|
|
334
|
-
}), /* @__PURE__ */
|
|
443
|
+
}), /* @__PURE__ */ M("p", {
|
|
335
444
|
className: "font-medium",
|
|
336
445
|
children: e.value
|
|
337
446
|
})] }, t))
|
|
338
447
|
}) })] })
|
|
339
448
|
]
|
|
340
|
-
}), /* @__PURE__ */
|
|
449
|
+
}), /* @__PURE__ */ N("div", {
|
|
341
450
|
className: "space-y-6",
|
|
342
451
|
children: [
|
|
343
|
-
/* @__PURE__ */ P
|
|
344
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ N(P, { children: [
|
|
453
|
+
/* @__PURE__ */ N("h2", {
|
|
345
454
|
className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-3",
|
|
346
|
-
children: [/* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */ M(i, { size: 18 }), " Pricing"]
|
|
347
456
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ M("p", {
|
|
349
458
|
className: "text-3xl font-bold",
|
|
350
|
-
children:
|
|
459
|
+
children: w.value === void 0 ? "Not provided" : te(w.value)
|
|
351
460
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ M("p", {
|
|
353
462
|
className: "text-sm text-text-secondary",
|
|
354
463
|
children: "Unit price"
|
|
355
464
|
})
|
|
356
465
|
] }),
|
|
357
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ N(v, { children: [/* @__PURE__ */ M(b, { children: /* @__PURE__ */ N(x, {
|
|
358
467
|
className: "flex items-center gap-2",
|
|
359
|
-
children: [/* @__PURE__ */
|
|
360
|
-
}) }), /* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ M(u, { size: 18 }), " Stock Levels"]
|
|
469
|
+
}) }), /* @__PURE__ */ M(y, {
|
|
361
470
|
className: "space-y-3",
|
|
362
|
-
children:
|
|
471
|
+
children: Z ? /* @__PURE__ */ M("p", {
|
|
363
472
|
className: "text-sm text-status-error-text",
|
|
364
|
-
children:
|
|
365
|
-
}) :
|
|
473
|
+
children: Z.message
|
|
474
|
+
}) : X ? /* @__PURE__ */ M("p", {
|
|
366
475
|
className: "text-sm text-text-secondary",
|
|
367
476
|
children: "Loading stock levels…"
|
|
368
|
-
}) :
|
|
477
|
+
}) : q.length === 0 ? /* @__PURE__ */ N("div", {
|
|
369
478
|
className: "space-y-3",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
479
|
+
children: [/* @__PURE__ */ M("p", {
|
|
371
480
|
className: "text-sm text-text-secondary",
|
|
372
481
|
children: "This item isn't stocked in any warehouse yet, so nothing can be promised on an order."
|
|
373
|
-
}), /* @__PURE__ */
|
|
482
|
+
}), /* @__PURE__ */ M(_, {
|
|
374
483
|
variant: "outline",
|
|
375
484
|
size: "sm",
|
|
376
|
-
onClick: () =>
|
|
485
|
+
onClick: () => $("inventory/warehouses"),
|
|
377
486
|
children: "View warehouses"
|
|
378
487
|
})]
|
|
379
|
-
}) : /* @__PURE__ */
|
|
380
|
-
|
|
488
|
+
}) : /* @__PURE__ */ N(re, { children: [
|
|
489
|
+
q.map((e) => /* @__PURE__ */ N("div", {
|
|
381
490
|
className: "flex items-baseline justify-between gap-3",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
491
|
+
children: [/* @__PURE__ */ N("div", {
|
|
383
492
|
className: "min-w-0",
|
|
384
|
-
children: [/* @__PURE__ */
|
|
493
|
+
children: [/* @__PURE__ */ M("p", {
|
|
385
494
|
className: "truncate text-sm font-medium",
|
|
386
495
|
children: e.warehouseName
|
|
387
|
-
}), /* @__PURE__ */
|
|
496
|
+
}), /* @__PURE__ */ N("p", {
|
|
388
497
|
className: "text-xs text-text-secondary",
|
|
389
498
|
children: [
|
|
390
499
|
e.allocated.toLocaleString(),
|
|
@@ -392,73 +501,123 @@ function z() {
|
|
|
392
501
|
e.reorderPoint === void 0 ? "" : ` · reorder at ${e.reorderPoint.toLocaleString()}`
|
|
393
502
|
]
|
|
394
503
|
})]
|
|
395
|
-
}), /* @__PURE__ */
|
|
504
|
+
}), /* @__PURE__ */ M("span", {
|
|
396
505
|
className: e.reorderPoint !== void 0 && e.available <= e.reorderPoint ? "font-semibold text-status-warning-text" : "font-semibold",
|
|
397
506
|
children: e.available.toLocaleString()
|
|
398
507
|
})]
|
|
399
508
|
}, e.inventoryItemId)),
|
|
400
|
-
|
|
509
|
+
G > 0 || Y ? /* @__PURE__ */ N("div", {
|
|
401
510
|
className: "flex items-center justify-between gap-2 border-t border-border-seam pt-3",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
511
|
+
children: [/* @__PURE__ */ N("span", {
|
|
403
512
|
className: "text-xs text-text-secondary",
|
|
404
513
|
children: [
|
|
405
|
-
|
|
514
|
+
G * 20 + 1,
|
|
406
515
|
"–",
|
|
407
|
-
Math.min(
|
|
516
|
+
Math.min(G * 20 + q.length, J),
|
|
408
517
|
" ",
|
|
409
518
|
"of ",
|
|
410
|
-
|
|
519
|
+
J
|
|
411
520
|
]
|
|
412
|
-
}), /* @__PURE__ */
|
|
521
|
+
}), /* @__PURE__ */ N("div", {
|
|
413
522
|
className: "flex gap-2",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
523
|
+
children: [/* @__PURE__ */ N(_, {
|
|
415
524
|
variant: "outline",
|
|
416
525
|
size: "sm",
|
|
417
|
-
disabled:
|
|
418
|
-
onClick: () =>
|
|
419
|
-
children: [/* @__PURE__ */
|
|
420
|
-
}), /* @__PURE__ */
|
|
526
|
+
disabled: G === 0 || X,
|
|
527
|
+
onClick: () => K((e) => Math.max(0, e - 1)),
|
|
528
|
+
children: [/* @__PURE__ */ M(n, { size: 14 }), " Previous"]
|
|
529
|
+
}), /* @__PURE__ */ N(_, {
|
|
421
530
|
variant: "outline",
|
|
422
531
|
size: "sm",
|
|
423
|
-
disabled: !
|
|
424
|
-
onClick: () =>
|
|
425
|
-
children: ["Next ", /* @__PURE__ */
|
|
532
|
+
disabled: !Y || X,
|
|
533
|
+
onClick: () => K((e) => e + 1),
|
|
534
|
+
children: ["Next ", /* @__PURE__ */ M(r, { size: 14 })]
|
|
426
535
|
})]
|
|
427
536
|
})]
|
|
428
537
|
}) : null,
|
|
429
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ N("div", {
|
|
430
539
|
className: "flex items-baseline justify-between gap-3 border-t border-border-seam pt-3",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
540
|
+
children: [/* @__PURE__ */ M("p", {
|
|
432
541
|
className: "text-sm text-text-secondary",
|
|
433
542
|
children: "Available across the network"
|
|
434
|
-
}), /* @__PURE__ */
|
|
543
|
+
}), /* @__PURE__ */ M("span", {
|
|
435
544
|
className: "font-bold",
|
|
436
|
-
children:
|
|
545
|
+
children: pe.toLocaleString()
|
|
437
546
|
})]
|
|
438
547
|
})
|
|
439
548
|
] })
|
|
440
549
|
})] }),
|
|
441
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ N(v, { children: [/* @__PURE__ */ M(b, { children: /* @__PURE__ */ M(x, { children: "Identifiers" }) }), /* @__PURE__ */ N(y, {
|
|
442
551
|
className: "space-y-3",
|
|
443
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
|
|
444
553
|
className: "text-sm text-text-secondary",
|
|
445
554
|
children: "SKU"
|
|
446
|
-
}), /* @__PURE__ */
|
|
555
|
+
}), /* @__PURE__ */ M("p", {
|
|
447
556
|
className: "font-mono",
|
|
448
|
-
children:
|
|
449
|
-
})] }),
|
|
557
|
+
children: w.sku
|
|
558
|
+
})] }), w.barcode && /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
|
|
450
559
|
className: "text-sm text-text-secondary",
|
|
451
560
|
children: "Barcode"
|
|
452
|
-
}), /* @__PURE__ */
|
|
561
|
+
}), /* @__PURE__ */ M("p", {
|
|
453
562
|
className: "font-mono",
|
|
454
|
-
children:
|
|
563
|
+
children: w.barcode
|
|
455
564
|
})] })]
|
|
456
|
-
})] })
|
|
565
|
+
})] }),
|
|
566
|
+
/* @__PURE__ */ N(v, {
|
|
567
|
+
className: "border-status-error-border",
|
|
568
|
+
children: [/* @__PURE__ */ M(b, { children: /* @__PURE__ */ N(x, {
|
|
569
|
+
className: "flex items-center gap-2 text-status-error-text",
|
|
570
|
+
children: [/* @__PURE__ */ M(l, { size: 18 }), " Delete Product"]
|
|
571
|
+
}) }), /* @__PURE__ */ N(y, { children: [/* @__PURE__ */ M("p", {
|
|
572
|
+
className: "mb-3 text-sm text-text-secondary",
|
|
573
|
+
children: "Removes this catalog item. Existing inventory records may prevent deletion."
|
|
574
|
+
}), /* @__PURE__ */ N(_, {
|
|
575
|
+
variant: "outline",
|
|
576
|
+
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
577
|
+
onClick: () => V(!0),
|
|
578
|
+
children: [/* @__PURE__ */ M(l, { size: 16 }), " Delete this product"]
|
|
579
|
+
})] })]
|
|
580
|
+
})
|
|
457
581
|
]
|
|
458
582
|
})]
|
|
583
|
+
}),
|
|
584
|
+
/* @__PURE__ */ M(I, {
|
|
585
|
+
open: B,
|
|
586
|
+
onOpenChange: V,
|
|
587
|
+
children: /* @__PURE__ */ N(ae, { children: [
|
|
588
|
+
/* @__PURE__ */ N(ce, { children: [/* @__PURE__ */ M(le, { children: "Delete this product?" }), /* @__PURE__ */ N(oe, { children: [
|
|
589
|
+
"This removes ",
|
|
590
|
+
w.name,
|
|
591
|
+
" from the catalog and cannot be undone from here."
|
|
592
|
+
] })] }),
|
|
593
|
+
/* @__PURE__ */ M("div", {
|
|
594
|
+
className: "px-1",
|
|
595
|
+
children: /* @__PURE__ */ M(O, { message: fe })
|
|
596
|
+
}),
|
|
597
|
+
/* @__PURE__ */ N(se, { children: [/* @__PURE__ */ M(_, {
|
|
598
|
+
variant: "outline",
|
|
599
|
+
onClick: () => V(!1),
|
|
600
|
+
disabled: H,
|
|
601
|
+
children: "Cancel"
|
|
602
|
+
}), /* @__PURE__ */ M(_, {
|
|
603
|
+
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
604
|
+
onClick: async () => {
|
|
605
|
+
if (o) {
|
|
606
|
+
U(!0), W(null);
|
|
607
|
+
try {
|
|
608
|
+
await de(o), V(!1), Q();
|
|
609
|
+
} catch (e) {
|
|
610
|
+
W(e instanceof Error ? e.message : "Failed to delete product."), U(!1);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
disabled: H,
|
|
615
|
+
children: H ? "Deleting..." : "Delete product"
|
|
616
|
+
})] })
|
|
617
|
+
] })
|
|
459
618
|
})
|
|
460
619
|
]
|
|
461
|
-
}) : /* @__PURE__ */
|
|
620
|
+
}) : /* @__PURE__ */ M(L, {});
|
|
462
621
|
}
|
|
463
622
|
//#endregion
|
|
464
|
-
export {
|
|
623
|
+
export { R as default };
|