@burdenoff/microfe-movethewheels 2026.822.1 → 2026.828.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/wspace-operations.d.ts +168 -912
- package/dist/generated/wspace-types.d.ts +78432 -35831
- package/dist/hooks/useFleet.js +142 -74
- package/dist/hooks/useImportExport.js +22 -51
- package/dist/hooks/useInventory.js +163 -70
- package/dist/hooks/useOrders.js +2 -2
- package/dist/hooks/useReports.js +63 -73
- package/dist/hooks/useSettings.js +52 -44
- package/dist/hooks/useTracking.js +5 -5
- package/dist/index.js +33 -33
- package/dist/movethewheels/hooks/index.d.ts +2 -2
- package/dist/movethewheels/hooks/useFleet.d.ts +32 -1
- package/dist/movethewheels/hooks/useImportExport.d.ts +10 -0
- package/dist/movethewheels/hooks/useInventory.d.ts +67 -12
- package/dist/movethewheels/hooks/useOrders.d.ts +25 -2
- package/dist/movethewheels/pages/MarketplacePage.d.ts +7 -4
- package/dist/movethewheels/types/index.d.ts +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-right.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left-right.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-right.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar-clock.js +32 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/history.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/lock.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/user-round.js +13 -0
- package/dist/pages/CreateOrderPage.js +246 -195
- package/dist/pages/DeliveryCapturePage.js +91 -78
- package/dist/pages/DriversPage.js +202 -108
- package/dist/pages/InventoryPage.js +356 -131
- package/dist/pages/MarketplacePage.js +11 -432
- package/dist/pages/ProductDetailsPage.js +212 -156
- package/dist/pages/ReportsPage.js +120 -109
- package/dist/pages/VehicleDetailsPage.js +257 -193
- package/dist/utils/formatters.js +4 -1
- package/package.json +2 -2
- package/src/generated/wspace-operations.ts +134 -929
- package/src/generated/wspace-types.ts +91730 -40059
- package/src/movethewheels/hooks/index.ts +9 -0
- package/src/movethewheels/hooks/useFleet.ts +133 -3
- package/src/movethewheels/hooks/useImportExport.ts +36 -72
- package/src/movethewheels/hooks/useInventory.ts +311 -53
- package/src/movethewheels/hooks/useOrders.ts +31 -7
- package/src/movethewheels/hooks/useReports.ts +73 -87
- package/src/movethewheels/hooks/useSettings.ts +50 -53
- package/src/movethewheels/hooks/useTracking.ts +14 -14
- package/src/movethewheels/pages/CreateOrderPage.tsx +67 -10
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +8 -0
- package/src/movethewheels/pages/DriversPage.tsx +181 -31
- package/src/movethewheels/pages/InventoryPage.tsx +299 -19
- package/src/movethewheels/pages/MarketplacePage.tsx +16 -539
- package/src/movethewheels/pages/ProductDetailsPage.tsx +68 -3
- package/src/movethewheels/pages/ReportsPage.tsx +23 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +86 -27
- package/src/movethewheels/types/index.ts +2 -0
- package/src/operations/wspace/movethewheels/fragments/core.graphql +23 -53
- package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +59 -0
- package/src/operations/wspace/movethewheels/mutations/entities.graphql +5 -5
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +18 -78
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +93 -0
- package/src/operations/wspace/movethewheels/mutations/orders.graphql +7 -7
- package/src/operations/wspace/movethewheels/queries/dashboard.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/entities.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/logistics.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +58 -0
- package/src/operations/wspace/movethewheels/queries/orders.graphql +3 -3
- package/dist/generated/global-operations.d.ts +0 -1
- package/dist/generated/global-types.d.ts +0 -23526
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -8
- package/src/generated/global-operations.ts +0 -2
- package/src/generated/global-types.ts +0 -27259
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +0 -40
|
@@ -5,52 +5,53 @@ import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/packag
|
|
|
5
5
|
import { Save as i } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
6
6
|
import { SquarePen as a } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
7
7
|
import { Tag as o } from "../node_modules/lucide-react/dist/esm/icons/tag.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
8
|
+
import { Warehouse as s } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
|
|
9
|
+
import { joinPath as c } from "../utils/navigation.js";
|
|
10
|
+
import { useMoveTheWheels as l } from "../providers/MoveTheWheelsProvider.js";
|
|
11
|
+
import { useInventory as u, useProduct as d, useProductStockLevels as f } from "../hooks/useInventory.js";
|
|
12
|
+
import { Badge as p, Button as m, Card as h, CardContent as g, CardHeader as _, CardTitle as v, Input as y, Label as b } from "../components/ui.js";
|
|
13
|
+
import { ErrorState as x, LoadingState as S, PageLayout as C } from "../components/PageLayout.js";
|
|
14
|
+
import { FormError as w } from "../components/FormError.js";
|
|
15
|
+
import { formatCurrency as T } from "../utils/formatters.js";
|
|
16
|
+
import { useEffect as E, useState as D } from "react";
|
|
17
|
+
import { useLocation as O, useParams as k } from "react-router";
|
|
18
|
+
import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
19
|
+
import { EmphasisPanel as N, NextSteps as P, PagePurpose as F } from "@burdenoff/fe-libs/ui";
|
|
19
20
|
//#region src/movethewheels/pages/ProductDetailsPage.tsx
|
|
20
|
-
function
|
|
21
|
-
let { basePath: n, navigate: a } =
|
|
21
|
+
function I({ editId: t }) {
|
|
22
|
+
let { basePath: n, navigate: a } = l(), { createProduct: o, updateProduct: s } = u(), { product: f } = d(t), p = !!t, [h, g] = D({
|
|
22
23
|
name: "",
|
|
23
24
|
sku: "",
|
|
24
25
|
category: "",
|
|
25
26
|
brand: "",
|
|
26
27
|
weight: ""
|
|
27
|
-
}), [
|
|
28
|
-
|
|
29
|
-
t &&
|
|
30
|
-
name:
|
|
31
|
-
sku:
|
|
32
|
-
category:
|
|
33
|
-
brand:
|
|
34
|
-
weight:
|
|
28
|
+
}), [_, v] = D(!1), [x, S] = D(null);
|
|
29
|
+
E(() => {
|
|
30
|
+
t && f && g({
|
|
31
|
+
name: f.name ?? "",
|
|
32
|
+
sku: f.sku ?? "",
|
|
33
|
+
category: f.category ?? "",
|
|
34
|
+
brand: f.brand ?? "",
|
|
35
|
+
weight: f.weight == null ? "" : String(f.weight)
|
|
35
36
|
});
|
|
36
|
-
}, [t,
|
|
37
|
-
let
|
|
37
|
+
}, [t, f]);
|
|
38
|
+
let T = () => a?.(c(n, "inventory/products")), O = async (e) => {
|
|
38
39
|
if (e.preventDefault(), !h.name.trim() || !h.sku.trim()) {
|
|
39
|
-
|
|
40
|
+
S("Product name and SKU are required.");
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
v(!0), S(null);
|
|
43
44
|
try {
|
|
44
45
|
let e = h.weight.trim() ? Number(h.weight) : void 0;
|
|
45
|
-
if (
|
|
46
|
-
let r = await
|
|
46
|
+
if (p && t) {
|
|
47
|
+
let r = await s(t, {
|
|
47
48
|
name: h.name.trim(),
|
|
48
49
|
sku: h.sku.trim(),
|
|
49
50
|
category: h.category.trim() || void 0,
|
|
50
51
|
brand: h.brand.trim() || void 0,
|
|
51
52
|
weight: e !== void 0 && !Number.isNaN(e) ? e : void 0
|
|
52
53
|
});
|
|
53
|
-
a?.(
|
|
54
|
+
a?.(c(n, `inventory/products/${r.id}`));
|
|
54
55
|
} else {
|
|
55
56
|
let t = await o({
|
|
56
57
|
name: h.name.trim(),
|
|
@@ -59,55 +60,55 @@ function N({ editId: t }) {
|
|
|
59
60
|
brand: h.brand.trim() || void 0,
|
|
60
61
|
weight: e !== void 0 && !Number.isNaN(e) ? e : void 0
|
|
61
62
|
});
|
|
62
|
-
a?.(
|
|
63
|
+
a?.(c(n, `inventory/products/${t.id}`));
|
|
63
64
|
}
|
|
64
65
|
} catch (e) {
|
|
65
|
-
console.error("Failed to create product:", e),
|
|
66
|
+
console.error("Failed to create product:", e), S(e instanceof Error ? e.message : "Failed to create product. Please try again."), v(!1);
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
title:
|
|
69
|
+
return /* @__PURE__ */ M(C, {
|
|
70
|
+
title: p ? "Edit Product" : "Add Product",
|
|
70
71
|
subtitle: "Add an item to your catalog",
|
|
71
|
-
icon: /* @__PURE__ */
|
|
72
|
-
headerActions: /* @__PURE__ */
|
|
72
|
+
icon: /* @__PURE__ */ j(r, { size: 24 }),
|
|
73
|
+
headerActions: /* @__PURE__ */ M("div", {
|
|
73
74
|
className: "flex gap-2",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ M(m, {
|
|
75
76
|
variant: "outline",
|
|
76
|
-
onClick:
|
|
77
|
-
disabled:
|
|
78
|
-
children: [/* @__PURE__ */
|
|
79
|
-
}), /* @__PURE__ */
|
|
80
|
-
onClick:
|
|
81
|
-
disabled:
|
|
77
|
+
onClick: T,
|
|
78
|
+
disabled: _,
|
|
79
|
+
children: [/* @__PURE__ */ j(e, { size: 16 }), " Cancel"]
|
|
80
|
+
}), /* @__PURE__ */ M(m, {
|
|
81
|
+
onClick: O,
|
|
82
|
+
disabled: _,
|
|
82
83
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ j(i, { size: 16 }),
|
|
84
85
|
" ",
|
|
85
|
-
|
|
86
|
+
p ? _ ? "Saving..." : "Save Changes" : _ ? "Saving..." : "Add Product"
|
|
86
87
|
]
|
|
87
88
|
})]
|
|
88
89
|
}),
|
|
89
|
-
children: [/* @__PURE__ */
|
|
90
|
-
icon: /* @__PURE__ */
|
|
90
|
+
children: [/* @__PURE__ */ j(F, {
|
|
91
|
+
icon: /* @__PURE__ */ j(r, { size: 18 }),
|
|
91
92
|
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."
|
|
92
|
-
}), /* @__PURE__ */
|
|
93
|
-
onSubmit:
|
|
93
|
+
}), /* @__PURE__ */ M("form", {
|
|
94
|
+
onSubmit: O,
|
|
94
95
|
className: "max-w-2xl space-y-6",
|
|
95
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ j(w, { message: x }), /* @__PURE__ */ M(N, { children: [/* @__PURE__ */ j("h2", {
|
|
96
97
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
97
98
|
children: "Product Details"
|
|
98
|
-
}), /* @__PURE__ */
|
|
99
|
+
}), /* @__PURE__ */ M("div", {
|
|
99
100
|
className: "space-y-4",
|
|
100
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ M("div", {
|
|
101
102
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ M("div", {
|
|
103
104
|
className: "space-y-2",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ M(b, {
|
|
105
106
|
htmlFor: "name",
|
|
106
|
-
children: ["Name ", /* @__PURE__ */
|
|
107
|
+
children: ["Name ", /* @__PURE__ */ j("span", {
|
|
107
108
|
className: "text-status-error-text",
|
|
108
109
|
children: "*"
|
|
109
110
|
})]
|
|
110
|
-
}), /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ j(y, {
|
|
111
112
|
id: "name",
|
|
112
113
|
value: h.name,
|
|
113
114
|
onChange: (e) => g((t) => ({
|
|
@@ -117,15 +118,15 @@ function N({ editId: t }) {
|
|
|
117
118
|
placeholder: "Wireless Headphones",
|
|
118
119
|
required: !0
|
|
119
120
|
})]
|
|
120
|
-
}), /* @__PURE__ */
|
|
121
|
+
}), /* @__PURE__ */ M("div", {
|
|
121
122
|
className: "space-y-2",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ M(b, {
|
|
123
124
|
htmlFor: "sku",
|
|
124
|
-
children: ["SKU ", /* @__PURE__ */
|
|
125
|
+
children: ["SKU ", /* @__PURE__ */ j("span", {
|
|
125
126
|
className: "text-status-error-text",
|
|
126
127
|
children: "*"
|
|
127
128
|
})]
|
|
128
|
-
}), /* @__PURE__ */
|
|
129
|
+
}), /* @__PURE__ */ j(y, {
|
|
129
130
|
id: "sku",
|
|
130
131
|
value: h.sku,
|
|
131
132
|
onChange: (e) => g((t) => ({
|
|
@@ -136,15 +137,15 @@ function N({ editId: t }) {
|
|
|
136
137
|
required: !0
|
|
137
138
|
})]
|
|
138
139
|
})]
|
|
139
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ M("div", {
|
|
140
141
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
141
142
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ M("div", {
|
|
143
144
|
className: "space-y-2",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ j(b, {
|
|
145
146
|
htmlFor: "category",
|
|
146
147
|
children: "Category"
|
|
147
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ j(y, {
|
|
148
149
|
id: "category",
|
|
149
150
|
value: h.category,
|
|
150
151
|
onChange: (e) => g((t) => ({
|
|
@@ -154,12 +155,12 @@ function N({ editId: t }) {
|
|
|
154
155
|
placeholder: "Electronics"
|
|
155
156
|
})]
|
|
156
157
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ M("div", {
|
|
158
159
|
className: "space-y-2",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ j(b, {
|
|
160
161
|
htmlFor: "brand",
|
|
161
162
|
children: "Brand"
|
|
162
|
-
}), /* @__PURE__ */
|
|
163
|
+
}), /* @__PURE__ */ j(y, {
|
|
163
164
|
id: "brand",
|
|
164
165
|
value: h.brand,
|
|
165
166
|
onChange: (e) => g((t) => ({
|
|
@@ -169,12 +170,12 @@ function N({ editId: t }) {
|
|
|
169
170
|
placeholder: "Acme"
|
|
170
171
|
})]
|
|
171
172
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ M("div", {
|
|
173
174
|
className: "space-y-2",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ j(b, {
|
|
175
176
|
htmlFor: "weight",
|
|
176
177
|
children: "Weight (kg)"
|
|
177
|
-
}), /* @__PURE__ */
|
|
178
|
+
}), /* @__PURE__ */ j(y, {
|
|
178
179
|
id: "weight",
|
|
179
180
|
type: "number",
|
|
180
181
|
min: "0",
|
|
@@ -193,175 +194,230 @@ function N({ editId: t }) {
|
|
|
193
194
|
})]
|
|
194
195
|
});
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
-
let { productId: i } =
|
|
198
|
-
return i ?
|
|
197
|
+
function L() {
|
|
198
|
+
let { productId: i } = k(), { basePath: u, navigate: y } = l(), { product: b, isLoading: w, error: E, refetch: D } = d(i), L = O().pathname.endsWith("/edit"), { levels: R, isLoading: z, error: B } = f(L ? void 0 : i), V = R.reduce((e, t) => e + t.available, 0), H = () => y?.(c(u, "inventory/products")), U = (e) => y?.(c(u, e));
|
|
199
|
+
return i ? L ? /* @__PURE__ */ j(I, { editId: i }) : w ? /* @__PURE__ */ j(S, { message: "Loading product details..." }) : E || !b ? /* @__PURE__ */ j(x, {
|
|
199
200
|
title: "Product not found",
|
|
200
|
-
onRetry:
|
|
201
|
-
}) : /* @__PURE__ */
|
|
202
|
-
title:
|
|
203
|
-
subtitle: `SKU: ${
|
|
204
|
-
icon: /* @__PURE__ */
|
|
205
|
-
headerActions: /* @__PURE__ */
|
|
201
|
+
onRetry: D
|
|
202
|
+
}) : /* @__PURE__ */ M(C, {
|
|
203
|
+
title: b.name,
|
|
204
|
+
subtitle: `SKU: ${b.sku}`,
|
|
205
|
+
icon: /* @__PURE__ */ j(r, { size: 24 }),
|
|
206
|
+
headerActions: /* @__PURE__ */ M("div", {
|
|
206
207
|
className: "flex gap-2",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ M(m, {
|
|
208
209
|
variant: "outline",
|
|
209
|
-
onClick:
|
|
210
|
-
children: [/* @__PURE__ */
|
|
211
|
-
}), /* @__PURE__ */
|
|
212
|
-
onClick: () =>
|
|
213
|
-
children: [/* @__PURE__ */
|
|
210
|
+
onClick: H,
|
|
211
|
+
children: [/* @__PURE__ */ j(e, { size: 16 }), " Back"]
|
|
212
|
+
}), /* @__PURE__ */ M(m, {
|
|
213
|
+
onClick: () => y?.(c(u, `inventory/products/${i}/edit`)),
|
|
214
|
+
children: [/* @__PURE__ */ j(a, { size: 16 }), " Edit"]
|
|
214
215
|
})]
|
|
215
216
|
}),
|
|
216
|
-
headerContent: /* @__PURE__ */
|
|
217
|
+
headerContent: /* @__PURE__ */ M("div", {
|
|
217
218
|
className: "flex gap-2",
|
|
218
219
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ j(p, {
|
|
220
221
|
variant: "outline",
|
|
221
|
-
children:
|
|
222
|
+
children: b.category
|
|
222
223
|
}),
|
|
223
|
-
|
|
224
|
+
b.brand && /* @__PURE__ */ j(p, {
|
|
224
225
|
variant: "secondary",
|
|
225
|
-
children:
|
|
226
|
+
children: b.brand
|
|
226
227
|
}),
|
|
227
|
-
|
|
228
|
+
b.fragile && /* @__PURE__ */ j(p, {
|
|
228
229
|
variant: "destructive",
|
|
229
230
|
children: "Fragile"
|
|
230
231
|
}),
|
|
231
|
-
|
|
232
|
+
b.hazardous && /* @__PURE__ */ j(p, {
|
|
232
233
|
variant: "destructive",
|
|
233
234
|
children: "Hazardous"
|
|
234
235
|
}),
|
|
235
|
-
|
|
236
|
+
b.temperatureControlled && /* @__PURE__ */ j(p, {
|
|
236
237
|
variant: "secondary",
|
|
237
238
|
children: "Temp Controlled"
|
|
238
239
|
})
|
|
239
240
|
]
|
|
240
241
|
}),
|
|
241
242
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
icon: /* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ j(F, {
|
|
244
|
+
icon: /* @__PURE__ */ j(r, { size: 18 }),
|
|
244
245
|
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."
|
|
245
246
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ j(P, {
|
|
247
248
|
storageKey: "movethewheels-product-details",
|
|
248
249
|
steps: [{
|
|
249
250
|
id: "order",
|
|
250
251
|
label: "Add this product to an order",
|
|
251
252
|
description: "Include it on a new delivery.",
|
|
252
|
-
icon: /* @__PURE__ */
|
|
253
|
-
onClick: () =>
|
|
253
|
+
icon: /* @__PURE__ */ j(r, { size: 16 }),
|
|
254
|
+
onClick: () => U("orders/new")
|
|
254
255
|
}, {
|
|
255
256
|
id: "edit",
|
|
256
257
|
label: "Edit product details",
|
|
257
258
|
description: "Update dimensions, value or handling flags.",
|
|
258
|
-
icon: /* @__PURE__ */
|
|
259
|
-
onClick: () => {}
|
|
259
|
+
icon: /* @__PURE__ */ j(o, { size: 16 }),
|
|
260
|
+
onClick: () => U(`inventory/products/${i}/edit`)
|
|
260
261
|
}]
|
|
261
262
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ M("div", {
|
|
263
264
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ M("div", {
|
|
265
266
|
className: "lg:col-span-2 space-y-6",
|
|
266
267
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ M(h, { children: [/* @__PURE__ */ j(_, { children: /* @__PURE__ */ j(v, { children: "Description" }) }), /* @__PURE__ */ j(g, { children: /* @__PURE__ */ j("p", { children: b.description }) })] }),
|
|
269
|
+
/* @__PURE__ */ M(h, { children: [/* @__PURE__ */ j(_, { children: /* @__PURE__ */ M(v, {
|
|
269
270
|
className: "flex items-center gap-2",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
271
|
-
}) }), /* @__PURE__ */
|
|
271
|
+
children: [/* @__PURE__ */ j(t, { size: 18 }), " Dimensions & Weight"]
|
|
272
|
+
}) }), /* @__PURE__ */ j(g, { children: /* @__PURE__ */ M("div", {
|
|
272
273
|
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
273
274
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
275
276
|
className: "text-sm text-text-secondary",
|
|
276
277
|
children: "Length"
|
|
277
|
-
}), /* @__PURE__ */
|
|
278
|
+
}), /* @__PURE__ */ M("p", {
|
|
278
279
|
className: "text-2xl font-bold",
|
|
279
|
-
children: [
|
|
280
|
+
children: [b.dimensions.length, /* @__PURE__ */ M("span", {
|
|
280
281
|
className: "text-sm font-normal",
|
|
281
|
-
children: [" ",
|
|
282
|
+
children: [" ", b.dimensions.unit]
|
|
282
283
|
})]
|
|
283
284
|
})] }),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
285
286
|
className: "text-sm text-text-secondary",
|
|
286
287
|
children: "Width"
|
|
287
|
-
}), /* @__PURE__ */
|
|
288
|
+
}), /* @__PURE__ */ M("p", {
|
|
288
289
|
className: "text-2xl font-bold",
|
|
289
|
-
children: [
|
|
290
|
+
children: [b.dimensions.width, /* @__PURE__ */ M("span", {
|
|
290
291
|
className: "text-sm font-normal",
|
|
291
|
-
children: [" ",
|
|
292
|
+
children: [" ", b.dimensions.unit]
|
|
292
293
|
})]
|
|
293
294
|
})] }),
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
295
296
|
className: "text-sm text-text-secondary",
|
|
296
297
|
children: "Height"
|
|
297
|
-
}), /* @__PURE__ */
|
|
298
|
+
}), /* @__PURE__ */ M("p", {
|
|
298
299
|
className: "text-2xl font-bold",
|
|
299
|
-
children: [
|
|
300
|
+
children: [b.dimensions.height, /* @__PURE__ */ M("span", {
|
|
300
301
|
className: "text-sm font-normal",
|
|
301
|
-
children: [" ",
|
|
302
|
+
children: [" ", b.dimensions.unit]
|
|
302
303
|
})]
|
|
303
304
|
})] }),
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
305
306
|
className: "text-sm text-text-secondary",
|
|
306
307
|
children: "Weight"
|
|
307
|
-
}), /* @__PURE__ */
|
|
308
|
+
}), /* @__PURE__ */ M("p", {
|
|
308
309
|
className: "text-2xl font-bold",
|
|
309
|
-
children: [
|
|
310
|
+
children: [b.weight, /* @__PURE__ */ j("span", {
|
|
310
311
|
className: "text-sm font-normal",
|
|
311
312
|
children: " kg"
|
|
312
313
|
})]
|
|
313
314
|
})] })
|
|
314
315
|
]
|
|
315
316
|
}) })] }),
|
|
316
|
-
|
|
317
|
+
b.attributes.length > 0 && /* @__PURE__ */ M(h, { children: [/* @__PURE__ */ j(_, { children: /* @__PURE__ */ M(v, {
|
|
317
318
|
className: "flex items-center gap-2",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
319
|
-
}) }), /* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ j(o, { size: 18 }), " Attributes"]
|
|
320
|
+
}) }), /* @__PURE__ */ j(g, { children: /* @__PURE__ */ j("div", {
|
|
320
321
|
className: "grid grid-cols-2 md:grid-cols-3 gap-4",
|
|
321
|
-
children:
|
|
322
|
+
children: b.attributes.map((e, t) => /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
322
323
|
className: "text-sm text-text-secondary",
|
|
323
324
|
children: e.name
|
|
324
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ j("p", {
|
|
325
326
|
className: "font-medium",
|
|
326
327
|
children: e.value
|
|
327
328
|
})] }, t))
|
|
328
329
|
}) })] })
|
|
329
330
|
]
|
|
330
|
-
}), /* @__PURE__ */
|
|
331
|
+
}), /* @__PURE__ */ M("div", {
|
|
331
332
|
className: "space-y-6",
|
|
332
|
-
children: [
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
children: [/* @__PURE__ */
|
|
348
|
-
className: "
|
|
349
|
-
children: "
|
|
350
|
-
}), /* @__PURE__ */
|
|
351
|
-
className: "
|
|
352
|
-
children:
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
333
|
+
children: [
|
|
334
|
+
/* @__PURE__ */ M(N, { children: [
|
|
335
|
+
/* @__PURE__ */ M("h2", {
|
|
336
|
+
className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-3",
|
|
337
|
+
children: [/* @__PURE__ */ j(n, { size: 18 }), " Pricing"]
|
|
338
|
+
}),
|
|
339
|
+
/* @__PURE__ */ j("p", {
|
|
340
|
+
className: "text-3xl font-bold",
|
|
341
|
+
children: T(b.value)
|
|
342
|
+
}),
|
|
343
|
+
/* @__PURE__ */ j("p", {
|
|
344
|
+
className: "text-sm text-text-secondary",
|
|
345
|
+
children: "Unit price"
|
|
346
|
+
})
|
|
347
|
+
] }),
|
|
348
|
+
/* @__PURE__ */ M(h, { children: [/* @__PURE__ */ j(_, { children: /* @__PURE__ */ M(v, {
|
|
349
|
+
className: "flex items-center gap-2",
|
|
350
|
+
children: [/* @__PURE__ */ j(s, { size: 18 }), " Stock Levels"]
|
|
351
|
+
}) }), /* @__PURE__ */ j(g, {
|
|
352
|
+
className: "space-y-3",
|
|
353
|
+
children: B ? /* @__PURE__ */ j("p", {
|
|
354
|
+
className: "text-sm text-status-error-text",
|
|
355
|
+
children: B.message
|
|
356
|
+
}) : z ? /* @__PURE__ */ j("p", {
|
|
357
|
+
className: "text-sm text-text-secondary",
|
|
358
|
+
children: "Loading stock levels…"
|
|
359
|
+
}) : R.length === 0 ? /* @__PURE__ */ M("div", {
|
|
360
|
+
className: "space-y-3",
|
|
361
|
+
children: [/* @__PURE__ */ j("p", {
|
|
362
|
+
className: "text-sm text-text-secondary",
|
|
363
|
+
children: "This item isn't stocked in any warehouse yet, so nothing can be promised on an order."
|
|
364
|
+
}), /* @__PURE__ */ j(m, {
|
|
365
|
+
variant: "outline",
|
|
366
|
+
size: "sm",
|
|
367
|
+
onClick: () => U("inventory/warehouses"),
|
|
368
|
+
children: "View warehouses"
|
|
369
|
+
})]
|
|
370
|
+
}) : /* @__PURE__ */ M(A, { children: [R.map((e) => /* @__PURE__ */ M("div", {
|
|
371
|
+
className: "flex items-baseline justify-between gap-3",
|
|
372
|
+
children: [/* @__PURE__ */ M("div", {
|
|
373
|
+
className: "min-w-0",
|
|
374
|
+
children: [/* @__PURE__ */ j("p", {
|
|
375
|
+
className: "truncate text-sm font-medium",
|
|
376
|
+
children: e.warehouseName
|
|
377
|
+
}), /* @__PURE__ */ M("p", {
|
|
378
|
+
className: "text-xs text-text-secondary",
|
|
379
|
+
children: [
|
|
380
|
+
e.allocated.toLocaleString(),
|
|
381
|
+
" allocated",
|
|
382
|
+
e.reorderPoint === void 0 ? "" : ` · reorder at ${e.reorderPoint.toLocaleString()}`
|
|
383
|
+
]
|
|
384
|
+
})]
|
|
385
|
+
}), /* @__PURE__ */ j("span", {
|
|
386
|
+
className: e.reorderPoint !== void 0 && e.available <= e.reorderPoint ? "font-semibold text-status-warning-text" : "font-semibold",
|
|
387
|
+
children: e.available.toLocaleString()
|
|
388
|
+
})]
|
|
389
|
+
}, e.inventoryItemId)), /* @__PURE__ */ M("div", {
|
|
390
|
+
className: "flex items-baseline justify-between gap-3 border-t border-border-seam pt-3",
|
|
391
|
+
children: [/* @__PURE__ */ j("p", {
|
|
392
|
+
className: "text-sm text-text-secondary",
|
|
393
|
+
children: "Available across the network"
|
|
394
|
+
}), /* @__PURE__ */ j("span", {
|
|
395
|
+
className: "font-bold",
|
|
396
|
+
children: V.toLocaleString()
|
|
397
|
+
})]
|
|
398
|
+
})] })
|
|
399
|
+
})] }),
|
|
400
|
+
/* @__PURE__ */ M(h, { children: [/* @__PURE__ */ j(_, { children: /* @__PURE__ */ j(v, { children: "Identifiers" }) }), /* @__PURE__ */ M(g, {
|
|
401
|
+
className: "space-y-3",
|
|
402
|
+
children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
403
|
+
className: "text-sm text-text-secondary",
|
|
404
|
+
children: "SKU"
|
|
405
|
+
}), /* @__PURE__ */ j("p", {
|
|
406
|
+
className: "font-mono",
|
|
407
|
+
children: b.sku
|
|
408
|
+
})] }), b.barcode && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
409
|
+
className: "text-sm text-text-secondary",
|
|
410
|
+
children: "Barcode"
|
|
411
|
+
}), /* @__PURE__ */ j("p", {
|
|
412
|
+
className: "font-mono",
|
|
413
|
+
children: b.barcode
|
|
414
|
+
})] })]
|
|
415
|
+
})] })
|
|
416
|
+
]
|
|
361
417
|
})]
|
|
362
418
|
})
|
|
363
419
|
]
|
|
364
|
-
}) : /* @__PURE__ */
|
|
420
|
+
}) : /* @__PURE__ */ j(I, {});
|
|
365
421
|
}
|
|
366
422
|
//#endregion
|
|
367
|
-
export {
|
|
423
|
+
export { L as default };
|