@burdenoff/microfe-movethewheels 2026.1028.1 → 2026.1031.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/MoveTheWheelsRoot.js +130 -122
- package/dist/MoveTheWheelsRoutes.js +55 -51
- package/dist/components/ExportStatusBanner.js +53 -0
- package/dist/components/marketplace/MarketplaceDialogs.js +524 -0
- package/dist/generated/wspace-types.d.ts +30737 -8505
- package/dist/hooks/useEntityExport.js +85 -0
- package/dist/hooks/useMarketplace.js +265 -0
- package/dist/movethewheels/components/ExportStatusBanner.d.ts +7 -0
- package/dist/movethewheels/components/marketplace/MarketplaceDialogs.d.ts +18 -0
- package/dist/movethewheels/hooks/useEntityExport.d.ts +32 -0
- package/dist/movethewheels/hooks/useMarketplace.d.ts +121 -0
- package/dist/movethewheels/pages/MarketplacePage.d.ts +1 -0
- package/dist/movethewheels/utils/entityExport.d.ts +64 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/badge-check.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +8 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +8 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/pencil.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/store.js +26 -0
- package/dist/pages/CustomersPage.js +64 -58
- package/dist/pages/DriversPage.js +113 -107
- package/dist/pages/MarketplacePage.js +503 -0
- package/dist/pages/OrdersListPage.js +85 -79
- package/dist/pages/ProductsPage.js +63 -57
- package/dist/pages/VehiclesPage.js +91 -85
- package/dist/utils/entityExport.js +54 -0
- package/package.json +3 -2
- package/src/generated/wspace-types.ts +34017 -8803
- package/src/movethewheels/MoveTheWheelsRoot.tsx +8 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +4 -0
- package/src/movethewheels/components/ExportStatusBanner.tsx +78 -0
- package/src/movethewheels/components/marketplace/MarketplaceDialogs.tsx +633 -0
- package/src/movethewheels/hooks/useEntityExport.ts +130 -0
- package/src/movethewheels/hooks/useMarketplace.ts +526 -0
- package/src/movethewheels/pages/CustomersPage.tsx +11 -2
- package/src/movethewheels/pages/DriversPage.tsx +11 -2
- package/src/movethewheels/pages/MarketplacePage.tsx +571 -0
- package/src/movethewheels/pages/OrdersListPage.tsx +13 -2
- package/src/movethewheels/pages/ProductsPage.tsx +11 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +11 -2
- package/src/movethewheels/utils/entityExport.ts +140 -0
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
import { BadgeCheck as e } from "../node_modules/lucide-react/dist/esm/icons/badge-check.js";
|
|
2
|
+
import { ChevronDown as t } from "../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
3
|
+
import { ChevronUp as n } from "../node_modules/lucide-react/dist/esm/icons/chevron-up.js";
|
|
4
|
+
import { Mail as r } from "../node_modules/lucide-react/dist/esm/icons/mail.js";
|
|
5
|
+
import { MapPin as i } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
|
|
6
|
+
import { Package as a } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
7
|
+
import { Pencil as o } from "../node_modules/lucide-react/dist/esm/icons/pencil.js";
|
|
8
|
+
import { Phone as s } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
|
|
9
|
+
import { Plus as c } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
10
|
+
import { RefreshCw as l } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
|
|
11
|
+
import { Star as u } from "../node_modules/lucide-react/dist/esm/icons/star.js";
|
|
12
|
+
import { Store as d } from "../node_modules/lucide-react/dist/esm/icons/store.js";
|
|
13
|
+
import { Trash2 as f } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
14
|
+
import { Truck as p } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
15
|
+
import { Badge as m, Button as h, Card as g, CardContent as _, Input as v, Select as y, SelectContent as b, SelectItem as x, SelectTrigger as S, SelectValue as C, Skeleton as w } from "../components/ui.js";
|
|
16
|
+
import { PageLayout as ee } from "../components/PageLayout.js";
|
|
17
|
+
import { MetricCard as T, MetricGrid as te } from "../components/MetricCard.js";
|
|
18
|
+
import { FormError as E } from "../components/FormError.js";
|
|
19
|
+
import { Notice as ne, useNotice as re } from "../components/Notice.js";
|
|
20
|
+
import { formatCurrency as D } from "../utils/formatters.js";
|
|
21
|
+
import { useDebouncedValue as ie } from "../hooks/useDebouncedValue.js";
|
|
22
|
+
import { PROVIDER_TYPES as ae, humanizeEnum as O, useMarketplaceActions as oe, useMarketplaceStats as se, useProviderOfferings as k, useServiceProviders as ce, useShipmentOptions as A } from "../hooks/useMarketplace.js";
|
|
23
|
+
import { AssignShipmentDialog as le, OfferingDialog as ue, ProviderDialog as de } from "../components/marketplace/MarketplaceDialogs.js";
|
|
24
|
+
import { useState as j } from "react";
|
|
25
|
+
import { jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
26
|
+
import { CTAOverflowMenu as fe, PagePurpose as pe } from "@burdenoff/fe-libs/ui";
|
|
27
|
+
//#region src/movethewheels/pages/MarketplacePage.tsx
|
|
28
|
+
var P = 12, F = "ALL";
|
|
29
|
+
function I(e) {
|
|
30
|
+
return e === "AVAILABLE" ? "default" : e === "LIMITED" ? "secondary" : "outline";
|
|
31
|
+
}
|
|
32
|
+
function L({ provider: e, refreshKey: t, onAdd: n, onEdit: r, onDelete: i }) {
|
|
33
|
+
let { offerings: a, isLoading: s, error: l } = k(e.id, t), { total: u } = A({
|
|
34
|
+
carrierId: e.id,
|
|
35
|
+
limit: 1
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ N("div", {
|
|
38
|
+
className: "mt-4 space-y-3 border-t border-border-subtle pt-4",
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ N("div", {
|
|
41
|
+
className: "flex flex-wrap items-center justify-between gap-2",
|
|
42
|
+
children: [/* @__PURE__ */ M("p", {
|
|
43
|
+
className: "text-sm font-medium",
|
|
44
|
+
children: "Offerings"
|
|
45
|
+
}), /* @__PURE__ */ N("div", {
|
|
46
|
+
className: "flex items-center gap-3",
|
|
47
|
+
children: [/* @__PURE__ */ N("span", {
|
|
48
|
+
className: "text-xs text-text-secondary",
|
|
49
|
+
children: [
|
|
50
|
+
"Carrier on ",
|
|
51
|
+
u,
|
|
52
|
+
" shipment",
|
|
53
|
+
u === 1 ? "" : "s"
|
|
54
|
+
]
|
|
55
|
+
}), /* @__PURE__ */ N(h, {
|
|
56
|
+
size: "sm",
|
|
57
|
+
variant: "outline",
|
|
58
|
+
onClick: n,
|
|
59
|
+
children: [/* @__PURE__ */ M(c, {
|
|
60
|
+
size: 14,
|
|
61
|
+
className: "mr-1"
|
|
62
|
+
}), "Add offering"]
|
|
63
|
+
})]
|
|
64
|
+
})]
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ M(E, { message: l?.message }),
|
|
67
|
+
s ? /* @__PURE__ */ M(w, { className: "h-12 w-full" }) : a.length === 0 ? /* @__PURE__ */ M("p", {
|
|
68
|
+
className: "text-sm text-text-secondary",
|
|
69
|
+
children: "No offerings yet. Add the lanes, services and indicative prices this provider offers."
|
|
70
|
+
}) : /* @__PURE__ */ M("ul", {
|
|
71
|
+
className: "space-y-2",
|
|
72
|
+
children: a.map((e) => /* @__PURE__ */ N("li", {
|
|
73
|
+
className: "flex flex-wrap items-start justify-between gap-3 rounded-lg bg-bg-sunken px-3 py-2",
|
|
74
|
+
children: [/* @__PURE__ */ N("div", {
|
|
75
|
+
className: "min-w-0",
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ N("p", {
|
|
78
|
+
className: "text-sm font-medium",
|
|
79
|
+
children: [e.name, e.isActive ? null : /* @__PURE__ */ M("span", {
|
|
80
|
+
className: "ml-2 text-xs text-text-tertiary",
|
|
81
|
+
children: "(inactive)"
|
|
82
|
+
})]
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ N("p", {
|
|
85
|
+
className: "text-xs text-text-secondary",
|
|
86
|
+
children: [O(e.category), e.transitDays == null ? "" : ` · ${e.transitDays} day transit`]
|
|
87
|
+
}),
|
|
88
|
+
e.description ? /* @__PURE__ */ M("p", {
|
|
89
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
90
|
+
children: e.description
|
|
91
|
+
}) : null
|
|
92
|
+
]
|
|
93
|
+
}), /* @__PURE__ */ N("div", {
|
|
94
|
+
className: "flex items-center gap-2",
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ M("span", {
|
|
97
|
+
className: "text-sm font-medium",
|
|
98
|
+
children: e.price == null ? "Price on request" : `${D(e.price, e.currency)}${e.pricingUnit ? ` / ${e.pricingUnit}` : ""}`
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ M(m, {
|
|
101
|
+
variant: I(e.availability),
|
|
102
|
+
children: O(e.availability)
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ M(h, {
|
|
105
|
+
size: "icon",
|
|
106
|
+
variant: "ghost",
|
|
107
|
+
"aria-label": `Edit ${e.name}`,
|
|
108
|
+
onClick: () => r(e),
|
|
109
|
+
children: /* @__PURE__ */ M(o, { size: 14 })
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ M(h, {
|
|
112
|
+
size: "icon",
|
|
113
|
+
variant: "ghost",
|
|
114
|
+
"aria-label": `Remove ${e.name}`,
|
|
115
|
+
onClick: () => i(e),
|
|
116
|
+
children: /* @__PURE__ */ M(f, { size: 14 })
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
})]
|
|
120
|
+
}, e.id))
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function me({ provider: a, expanded: c, refreshKey: l, onToggle: d, onEdit: v, onDelete: y, onAssign: b, onAddOffering: x, onEditOffering: S, onDeleteOffering: C }) {
|
|
126
|
+
return /* @__PURE__ */ M(g, {
|
|
127
|
+
"data-testid": "mtw-provider-card",
|
|
128
|
+
children: /* @__PURE__ */ N(_, {
|
|
129
|
+
className: "p-5",
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ N("div", {
|
|
132
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
133
|
+
children: [/* @__PURE__ */ N("div", {
|
|
134
|
+
className: "min-w-0 space-y-1",
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ N("div", {
|
|
137
|
+
className: "flex flex-wrap items-center gap-2",
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ M("h3", {
|
|
140
|
+
className: "text-base font-semibold",
|
|
141
|
+
children: a.name
|
|
142
|
+
}),
|
|
143
|
+
a.isVerified ? /* @__PURE__ */ N(m, {
|
|
144
|
+
variant: "default",
|
|
145
|
+
className: "gap-1",
|
|
146
|
+
children: [/* @__PURE__ */ M(e, { size: 12 }), "Verified"]
|
|
147
|
+
}) : /* @__PURE__ */ M(m, {
|
|
148
|
+
variant: "outline",
|
|
149
|
+
children: "Unverified"
|
|
150
|
+
}),
|
|
151
|
+
a.isActive ? null : /* @__PURE__ */ M(m, {
|
|
152
|
+
variant: "secondary",
|
|
153
|
+
children: "Inactive"
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ N("p", {
|
|
158
|
+
className: "text-sm text-text-secondary",
|
|
159
|
+
children: [O(a.type), a.rating == null ? null : /* @__PURE__ */ N("span", {
|
|
160
|
+
className: "ml-2 inline-flex items-center gap-1",
|
|
161
|
+
children: [/* @__PURE__ */ M(u, {
|
|
162
|
+
size: 13,
|
|
163
|
+
className: "fill-current text-status-warning-text"
|
|
164
|
+
}), a.rating.toFixed(1)]
|
|
165
|
+
})]
|
|
166
|
+
}),
|
|
167
|
+
a.description ? /* @__PURE__ */ M("p", {
|
|
168
|
+
className: "text-sm text-text-secondary",
|
|
169
|
+
children: a.description
|
|
170
|
+
}) : null
|
|
171
|
+
]
|
|
172
|
+
}), /* @__PURE__ */ N("div", {
|
|
173
|
+
className: "flex flex-wrap items-center gap-2",
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ N(h, {
|
|
176
|
+
size: "sm",
|
|
177
|
+
onClick: b,
|
|
178
|
+
children: [/* @__PURE__ */ M(p, {
|
|
179
|
+
size: 14,
|
|
180
|
+
className: "mr-1"
|
|
181
|
+
}), "Assign to shipment"]
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ M(h, {
|
|
184
|
+
size: "icon",
|
|
185
|
+
variant: "ghost",
|
|
186
|
+
"aria-label": `Edit ${a.name}`,
|
|
187
|
+
onClick: v,
|
|
188
|
+
children: /* @__PURE__ */ M(o, { size: 16 })
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ M(h, {
|
|
191
|
+
size: "icon",
|
|
192
|
+
variant: "ghost",
|
|
193
|
+
"aria-label": `Remove ${a.name}`,
|
|
194
|
+
onClick: y,
|
|
195
|
+
children: /* @__PURE__ */ M(f, { size: 16 })
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
})]
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ N("div", {
|
|
201
|
+
className: "mt-3 flex flex-wrap gap-x-5 gap-y-1 text-xs text-text-secondary",
|
|
202
|
+
children: [
|
|
203
|
+
a.serviceAreas.length > 0 ? /* @__PURE__ */ N("span", {
|
|
204
|
+
className: "inline-flex items-center gap-1",
|
|
205
|
+
children: [/* @__PURE__ */ M(i, { size: 12 }), a.serviceAreas.join(", ")]
|
|
206
|
+
}) : null,
|
|
207
|
+
a.contact.email ? /* @__PURE__ */ N("span", {
|
|
208
|
+
className: "inline-flex items-center gap-1",
|
|
209
|
+
children: [/* @__PURE__ */ M(r, { size: 12 }), a.contact.email]
|
|
210
|
+
}) : null,
|
|
211
|
+
a.contact.phone ? /* @__PURE__ */ N("span", {
|
|
212
|
+
className: "inline-flex items-center gap-1",
|
|
213
|
+
children: [/* @__PURE__ */ M(s, { size: 12 }), a.contact.phone]
|
|
214
|
+
}) : null
|
|
215
|
+
]
|
|
216
|
+
}),
|
|
217
|
+
a.services.length > 0 ? /* @__PURE__ */ M("div", {
|
|
218
|
+
className: "mt-3 flex flex-wrap gap-1.5",
|
|
219
|
+
children: a.services.map((e) => /* @__PURE__ */ M(m, {
|
|
220
|
+
variant: "secondary",
|
|
221
|
+
children: e
|
|
222
|
+
}, e))
|
|
223
|
+
}) : null,
|
|
224
|
+
/* @__PURE__ */ N("button", {
|
|
225
|
+
type: "button",
|
|
226
|
+
className: "mt-3 inline-flex items-center gap-1 text-sm font-medium text-action-primary-text",
|
|
227
|
+
onClick: d,
|
|
228
|
+
"aria-expanded": c,
|
|
229
|
+
children: [
|
|
230
|
+
M(c ? n : t, { size: 14 }),
|
|
231
|
+
a.offeringsCount,
|
|
232
|
+
" offering",
|
|
233
|
+
a.offeringsCount === 1 ? "" : "s"
|
|
234
|
+
]
|
|
235
|
+
}),
|
|
236
|
+
c ? /* @__PURE__ */ M(L, {
|
|
237
|
+
provider: a,
|
|
238
|
+
refreshKey: l,
|
|
239
|
+
onAdd: x,
|
|
240
|
+
onEdit: S,
|
|
241
|
+
onDelete: C
|
|
242
|
+
}) : null
|
|
243
|
+
]
|
|
244
|
+
})
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function R() {
|
|
248
|
+
let t = oe(), { message: n, notify: r } = re(), [i, o] = j(null), [s, f] = j(""), p = ie(s), [m, D] = j(F), [k, A] = j(!1), [I, L] = j(0), [R, he] = j(0), [ge, z] = j(null), [B, V] = j({
|
|
249
|
+
open: !1,
|
|
250
|
+
provider: null
|
|
251
|
+
}), [H, U] = j({
|
|
252
|
+
open: !1,
|
|
253
|
+
provider: null,
|
|
254
|
+
offering: null
|
|
255
|
+
}), [W, G] = j({
|
|
256
|
+
open: !1,
|
|
257
|
+
provider: null
|
|
258
|
+
}), { providers: K, total: q, isLoading: _e, error: J, refetch: ve } = ce({
|
|
259
|
+
filters: {
|
|
260
|
+
search: p,
|
|
261
|
+
type: m === F ? void 0 : m,
|
|
262
|
+
isVerified: k ? !0 : void 0
|
|
263
|
+
},
|
|
264
|
+
limit: P,
|
|
265
|
+
offset: I * P
|
|
266
|
+
}), Y = se(R), X = Math.max(1, Math.ceil(q / P)), Z = () => {
|
|
267
|
+
he((e) => e + 1), ve();
|
|
268
|
+
}, Q = (e) => {
|
|
269
|
+
o(null), r(e), Z();
|
|
270
|
+
}, ye = async (e) => {
|
|
271
|
+
if (window.confirm(`Remove ${e.name} and its offerings from the marketplace? Shipments it already carries keep it as their carrier.`)) try {
|
|
272
|
+
await t.deleteProvider(e.id), Q(`Removed ${e.name}.`);
|
|
273
|
+
} catch (e) {
|
|
274
|
+
o(e instanceof Error ? e.message : "Could not remove the provider.");
|
|
275
|
+
}
|
|
276
|
+
}, be = async (e) => {
|
|
277
|
+
if (window.confirm(`Remove the offering "${e.name}"?`)) try {
|
|
278
|
+
await t.deleteOffering(e.id), Q(`Removed ${e.name}.`);
|
|
279
|
+
} catch (e) {
|
|
280
|
+
o(e instanceof Error ? e.message : "Could not remove the offering.");
|
|
281
|
+
}
|
|
282
|
+
}, $ = !!p.trim() || m !== F || k;
|
|
283
|
+
return /* @__PURE__ */ N(ee, {
|
|
284
|
+
title: "Marketplace",
|
|
285
|
+
subtitle: Y ? `${Y.providers} service providers` : "Service providers",
|
|
286
|
+
icon: /* @__PURE__ */ M(d, { size: 24 }),
|
|
287
|
+
headerActions: /* @__PURE__ */ M(fe, {
|
|
288
|
+
primary: {
|
|
289
|
+
label: "Add provider",
|
|
290
|
+
icon: /* @__PURE__ */ M(c, { size: 16 }),
|
|
291
|
+
onSelect: () => V({
|
|
292
|
+
open: !0,
|
|
293
|
+
provider: null
|
|
294
|
+
})
|
|
295
|
+
},
|
|
296
|
+
actions: [{
|
|
297
|
+
label: "Refresh",
|
|
298
|
+
icon: /* @__PURE__ */ M(l, { size: 16 }),
|
|
299
|
+
onSelect: Z
|
|
300
|
+
}]
|
|
301
|
+
}),
|
|
302
|
+
children: [
|
|
303
|
+
/* @__PURE__ */ M(pe, {
|
|
304
|
+
icon: /* @__PURE__ */ M(d, { size: 18 }),
|
|
305
|
+
children: "Your directory of vetted carriers, 3PLs, warehouses and specialists. When you are short of capacity, find a provider here and make it a shipment's carrier instead of buying assets."
|
|
306
|
+
}),
|
|
307
|
+
/* @__PURE__ */ M(ne, { message: n }),
|
|
308
|
+
/* @__PURE__ */ M(E, { message: i }),
|
|
309
|
+
/* @__PURE__ */ N(te, {
|
|
310
|
+
columns: 4,
|
|
311
|
+
children: [
|
|
312
|
+
/* @__PURE__ */ M(T, {
|
|
313
|
+
label: "Providers",
|
|
314
|
+
value: Y?.providers ?? "—",
|
|
315
|
+
icon: /* @__PURE__ */ M(d, { size: 20 }),
|
|
316
|
+
accent: "brand"
|
|
317
|
+
}),
|
|
318
|
+
/* @__PURE__ */ M(T, {
|
|
319
|
+
label: "Verified",
|
|
320
|
+
value: Y?.verifiedProviders ?? "—",
|
|
321
|
+
icon: /* @__PURE__ */ M(e, { size: 20 }),
|
|
322
|
+
accent: "success"
|
|
323
|
+
}),
|
|
324
|
+
/* @__PURE__ */ M(T, {
|
|
325
|
+
label: "Offerings",
|
|
326
|
+
value: Y?.offerings ?? "—",
|
|
327
|
+
icon: /* @__PURE__ */ M(a, { size: 20 }),
|
|
328
|
+
accent: "blue"
|
|
329
|
+
}),
|
|
330
|
+
/* @__PURE__ */ M(T, {
|
|
331
|
+
label: "Avg. rating",
|
|
332
|
+
value: Y?.avgRating == null ? "—" : Y.avgRating.toFixed(1),
|
|
333
|
+
icon: /* @__PURE__ */ M(u, { size: 20 }),
|
|
334
|
+
accent: "warning"
|
|
335
|
+
})
|
|
336
|
+
]
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ N("div", {
|
|
339
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
340
|
+
children: [
|
|
341
|
+
/* @__PURE__ */ M(v, {
|
|
342
|
+
"aria-label": "Search providers",
|
|
343
|
+
placeholder: "Search by name, service or area…",
|
|
344
|
+
value: s,
|
|
345
|
+
onChange: (e) => {
|
|
346
|
+
f(e.target.value), L(0);
|
|
347
|
+
},
|
|
348
|
+
className: "sm:max-w-sm"
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ N(y, {
|
|
351
|
+
value: m,
|
|
352
|
+
onValueChange: (e) => {
|
|
353
|
+
D(e), L(0);
|
|
354
|
+
},
|
|
355
|
+
children: [/* @__PURE__ */ M(S, {
|
|
356
|
+
"aria-label": "Provider type",
|
|
357
|
+
className: "sm:w-56",
|
|
358
|
+
children: /* @__PURE__ */ M(C, {})
|
|
359
|
+
}), /* @__PURE__ */ N(b, { children: [/* @__PURE__ */ M(x, {
|
|
360
|
+
value: F,
|
|
361
|
+
children: "All provider types"
|
|
362
|
+
}), ae.map((e) => /* @__PURE__ */ M(x, {
|
|
363
|
+
value: e,
|
|
364
|
+
children: O(e)
|
|
365
|
+
}, e))] })]
|
|
366
|
+
}),
|
|
367
|
+
/* @__PURE__ */ N(h, {
|
|
368
|
+
variant: k ? "default" : "outline",
|
|
369
|
+
onClick: () => {
|
|
370
|
+
A((e) => !e), L(0);
|
|
371
|
+
},
|
|
372
|
+
"aria-pressed": k,
|
|
373
|
+
children: [/* @__PURE__ */ M(e, {
|
|
374
|
+
size: 16,
|
|
375
|
+
className: "mr-1.5"
|
|
376
|
+
}), "Verified only"]
|
|
377
|
+
})
|
|
378
|
+
]
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ M(E, { message: J?.message }),
|
|
381
|
+
_e && K.length === 0 ? /* @__PURE__ */ N("div", {
|
|
382
|
+
className: "grid gap-4",
|
|
383
|
+
children: [/* @__PURE__ */ M(w, { className: "h-32 w-full" }), /* @__PURE__ */ M(w, { className: "h-32 w-full" })]
|
|
384
|
+
}) : K.length === 0 && !J ? /* @__PURE__ */ M(g, { children: /* @__PURE__ */ N(_, {
|
|
385
|
+
className: "flex flex-col items-center gap-3 p-10 text-center",
|
|
386
|
+
children: [
|
|
387
|
+
/* @__PURE__ */ M(d, {
|
|
388
|
+
size: 32,
|
|
389
|
+
className: "text-text-tertiary"
|
|
390
|
+
}),
|
|
391
|
+
/* @__PURE__ */ M("p", {
|
|
392
|
+
className: "font-medium",
|
|
393
|
+
children: $ ? "No providers match these filters" : "No providers yet"
|
|
394
|
+
}),
|
|
395
|
+
/* @__PURE__ */ M("p", {
|
|
396
|
+
className: "max-w-md text-sm text-text-secondary",
|
|
397
|
+
children: $ ? "Try a different search or clear the filters." : "Add the carriers, 3PLs and warehouses you work with so your team can find capacity in one place."
|
|
398
|
+
}),
|
|
399
|
+
$ ? null : /* @__PURE__ */ N(h, {
|
|
400
|
+
onClick: () => V({
|
|
401
|
+
open: !0,
|
|
402
|
+
provider: null
|
|
403
|
+
}),
|
|
404
|
+
children: [/* @__PURE__ */ M(c, {
|
|
405
|
+
size: 16,
|
|
406
|
+
className: "mr-1.5"
|
|
407
|
+
}), "Add provider"]
|
|
408
|
+
})
|
|
409
|
+
]
|
|
410
|
+
}) }) : /* @__PURE__ */ M("div", {
|
|
411
|
+
className: "grid gap-4",
|
|
412
|
+
children: K.map((e) => /* @__PURE__ */ M(me, {
|
|
413
|
+
provider: e,
|
|
414
|
+
expanded: ge === e.id,
|
|
415
|
+
refreshKey: R,
|
|
416
|
+
onToggle: () => z((t) => t === e.id ? null : e.id),
|
|
417
|
+
onEdit: () => V({
|
|
418
|
+
open: !0,
|
|
419
|
+
provider: e
|
|
420
|
+
}),
|
|
421
|
+
onDelete: () => void ye(e),
|
|
422
|
+
onAssign: () => G({
|
|
423
|
+
open: !0,
|
|
424
|
+
provider: e
|
|
425
|
+
}),
|
|
426
|
+
onAddOffering: () => U({
|
|
427
|
+
open: !0,
|
|
428
|
+
provider: e,
|
|
429
|
+
offering: null
|
|
430
|
+
}),
|
|
431
|
+
onEditOffering: (t) => U({
|
|
432
|
+
open: !0,
|
|
433
|
+
provider: e,
|
|
434
|
+
offering: t
|
|
435
|
+
}),
|
|
436
|
+
onDeleteOffering: (e) => void be(e)
|
|
437
|
+
}, e.id))
|
|
438
|
+
}),
|
|
439
|
+
q > P ? /* @__PURE__ */ N("div", {
|
|
440
|
+
className: "flex items-center justify-between text-sm",
|
|
441
|
+
children: [/* @__PURE__ */ N("span", {
|
|
442
|
+
className: "text-text-secondary",
|
|
443
|
+
children: [
|
|
444
|
+
"Page ",
|
|
445
|
+
I + 1,
|
|
446
|
+
" of ",
|
|
447
|
+
X,
|
|
448
|
+
" · ",
|
|
449
|
+
q,
|
|
450
|
+
" providers"
|
|
451
|
+
]
|
|
452
|
+
}), /* @__PURE__ */ N("div", {
|
|
453
|
+
className: "flex gap-2",
|
|
454
|
+
children: [/* @__PURE__ */ M(h, {
|
|
455
|
+
variant: "outline",
|
|
456
|
+
size: "sm",
|
|
457
|
+
disabled: I === 0,
|
|
458
|
+
onClick: () => L((e) => e - 1),
|
|
459
|
+
children: "Previous"
|
|
460
|
+
}), /* @__PURE__ */ M(h, {
|
|
461
|
+
variant: "outline",
|
|
462
|
+
size: "sm",
|
|
463
|
+
disabled: I + 1 >= X,
|
|
464
|
+
onClick: () => L((e) => e + 1),
|
|
465
|
+
children: "Next"
|
|
466
|
+
})]
|
|
467
|
+
})]
|
|
468
|
+
}) : null,
|
|
469
|
+
/* @__PURE__ */ M(de, {
|
|
470
|
+
open: B.open,
|
|
471
|
+
provider: B.provider,
|
|
472
|
+
onOpenChange: (e) => V((t) => ({
|
|
473
|
+
...t,
|
|
474
|
+
open: e
|
|
475
|
+
})),
|
|
476
|
+
onDone: Q
|
|
477
|
+
}),
|
|
478
|
+
/* @__PURE__ */ M(ue, {
|
|
479
|
+
open: H.open,
|
|
480
|
+
provider: H.provider,
|
|
481
|
+
offering: H.offering,
|
|
482
|
+
onOpenChange: (e) => U((t) => ({
|
|
483
|
+
...t,
|
|
484
|
+
open: e
|
|
485
|
+
})),
|
|
486
|
+
onDone: (e) => {
|
|
487
|
+
H.provider && z(H.provider.id), Q(e);
|
|
488
|
+
}
|
|
489
|
+
}),
|
|
490
|
+
/* @__PURE__ */ M(le, {
|
|
491
|
+
open: W.open,
|
|
492
|
+
provider: W.provider,
|
|
493
|
+
onOpenChange: (e) => G((t) => ({
|
|
494
|
+
...t,
|
|
495
|
+
open: e
|
|
496
|
+
})),
|
|
497
|
+
onDone: Q
|
|
498
|
+
})
|
|
499
|
+
]
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
export { R as default };
|