@burdenoff/microfe-movethewheels 2026.920.2 → 2026.921.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.
Files changed (82) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +271 -0
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +1043 -5
  6. package/dist/hooks/useAnalytics.js +21 -1
  7. package/dist/hooks/useCustomers.js +94 -78
  8. package/dist/hooks/useDebouncedValue.js +11 -0
  9. package/dist/hooks/useEntityDocuments.js +28 -18
  10. package/dist/hooks/useEpod.js +24 -17
  11. package/dist/hooks/useFleet.js +146 -125
  12. package/dist/hooks/useInventory.js +255 -186
  13. package/dist/hooks/useMultiModalShipments.js +35 -27
  14. package/dist/hooks/useOrders.js +73 -73
  15. package/dist/hooks/useRoutes.js +97 -75
  16. package/dist/hooks/useTracking.js +100 -88
  17. package/dist/movethewheels/components/CustomerPicker.d.ts +19 -0
  18. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  19. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  20. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  21. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  22. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  23. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  24. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  25. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  26. package/dist/movethewheels/hooks/useOrders.d.ts +33 -5
  27. package/dist/movethewheels/hooks/useRoutes.d.ts +2 -1
  28. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  29. package/dist/movethewheels/types/index.d.ts +7 -5
  30. package/dist/movethewheels/utils/navigation.d.ts +14 -0
  31. package/dist/pages/CreateOrderPage.js +228 -217
  32. package/dist/pages/CustomerDetailsPage.js +220 -220
  33. package/dist/pages/CustomersPage.js +61 -54
  34. package/dist/pages/DeliveryCapturePage.js +131 -109
  35. package/dist/pages/DriversPage.js +100 -92
  36. package/dist/pages/InventoryPage.js +239 -236
  37. package/dist/pages/MultiModalShipmentPage.js +163 -130
  38. package/dist/pages/OrderDetailsPage.js +224 -208
  39. package/dist/pages/OrdersListPage.js +66 -60
  40. package/dist/pages/ProductDetailsPage.js +241 -200
  41. package/dist/pages/ProductsPage.js +59 -52
  42. package/dist/pages/RouteDetailsPage.js +343 -321
  43. package/dist/pages/RoutesPage.js +55 -48
  44. package/dist/pages/VehiclesPage.js +63 -56
  45. package/dist/pages/WarehousesPage.js +60 -53
  46. package/dist/utils/navigation.js +22 -1
  47. package/package.json +1 -1
  48. package/src/generated/wspace-types.ts +1188 -5
  49. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  50. package/src/movethewheels/components/CustomerPicker.tsx +321 -0
  51. package/src/movethewheels/components/DataTable.tsx +34 -18
  52. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  53. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  54. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  55. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  56. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  57. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  58. package/src/movethewheels/hooks/useEpod.ts +14 -7
  59. package/src/movethewheels/hooks/useFleet.ts +58 -37
  60. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  61. package/src/movethewheels/hooks/useInventory.ts +211 -90
  62. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  63. package/src/movethewheels/hooks/useOrders.ts +13 -14
  64. package/src/movethewheels/hooks/useRoutes.ts +80 -23
  65. package/src/movethewheels/hooks/useTracking.ts +130 -98
  66. package/src/movethewheels/pages/CreateOrderPage.tsx +92 -31
  67. package/src/movethewheels/pages/CustomerDetailsPage.tsx +15 -6
  68. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  69. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  70. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  71. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  72. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  73. package/src/movethewheels/pages/OrderDetailsPage.tsx +17 -1
  74. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  75. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  76. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  77. package/src/movethewheels/pages/RouteDetailsPage.tsx +35 -5
  78. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  79. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  80. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  81. package/src/movethewheels/types/index.ts +7 -5
  82. package/src/movethewheels/utils/navigation.ts +32 -0
@@ -9,56 +9,57 @@ import { RefreshCw as ee } from "../node_modules/lucide-react/dist/esm/icons/ref
9
9
  import { Search as te } from "../node_modules/lucide-react/dist/esm/icons/search.js";
10
10
  import { TriangleAlert as ne } from "../node_modules/lucide-react/dist/esm/icons/triangle-alert.js";
11
11
  import { cn as s } from "../utils/cn.js";
12
- import { Button as c, Input as re, Select as ie, SelectContent as ae, SelectItem as oe, SelectTrigger as se, SelectValue as ce, Skeleton as l, Table as le, TableBody as u, TableCell as d, TableHead as f, TableHeader as p, TableRow as m } from "./ui.js";
13
- import { useMemo as h, useState as g } from "react";
14
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
15
- import { IllustratedEmptyState as y } from "@burdenoff/fe-libs/ui";
12
+ import { Button as c, Input as re, Select as ie, SelectContent as ae, SelectItem as oe, SelectTrigger as se, SelectValue as ce, Skeleton as l, Table as u, TableBody as d, TableCell as f, TableHead as p, TableHeader as m, TableRow as h } from "./ui.js";
13
+ import { useMemo as g, useState as _ } from "react";
14
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
+ import { IllustratedEmptyState as b } from "@burdenoff/fe-libs/ui";
16
16
  //#region src/movethewheels/components/DataTable.tsx
17
- function b({ columns: b, data: x, isLoading: ue = !1, error: de = null, onRetry: S, searchable: C = !1, searchPlaceholder: fe = "Search...", searchFields: w, pagination: T = !0, pageSize: E = 10, pageSizeOptions: pe = [
17
+ function x({ columns: x, data: S, isLoading: le = !1, error: ue = null, onRetry: de, searchable: fe = !1, searchPlaceholder: pe = "Search...", searchFields: C, searchQuery: me, onSearchQueryChange: w, pagination: T = !0, pageSize: E = 10, pageSizeOptions: he = [
18
18
  10,
19
19
  25,
20
20
  50,
21
21
  100
22
- ], onRowClick: D, rowClassName: O, emptyMessage: k = "No data found", emptyIllustration: A, emptyTitle: me, emptyDescription: he, emptyAction: ge, className: j, getRowId: M, pageIndex: _e, onPageChange: N, onPageSizeChange: ve, totalItems: P, hasNextPage: ye }) {
23
- let F = typeof N == "function", I = _e ?? 0, [L, be] = g(""), [R, z] = g(null), [B, V] = g(null), [H, U] = g(1), [W, xe] = g(E), G = F ? E : W, K = h(() => {
24
- if (!L || !w || w.length === 0) return x;
25
- let e = L.toLowerCase();
26
- return x.filter((t) => w.some((n) => {
22
+ ], onRowClick: D, rowClassName: O, emptyMessage: k = "No data found", emptyIllustration: A, emptyTitle: ge, emptyDescription: _e, emptyAction: ve, className: j, getRowId: M, pageIndex: ye, onPageChange: N, onPageSizeChange: be, totalItems: P, hasNextPage: xe }) {
23
+ let F = typeof N == "function", I = ye ?? 0, [Se, Ce] = _(""), L = typeof w == "function", R = L ? me ?? "" : Se, [z, B] = _(null), [V, H] = _(null), [U, W] = _(1), [G, we] = _(E), K = F ? E : G, q = g(() => {
24
+ if (L || !R || !C || C.length === 0) return S;
25
+ let e = R.toLowerCase();
26
+ return S.filter((t) => C.some((n) => {
27
27
  let r = t[n];
28
28
  return r != null && String(r).toLowerCase().includes(e);
29
29
  }));
30
30
  }, [
31
- x,
32
- L,
33
- w
34
- ]), q = h(() => {
35
- if (!R || !B) return K;
36
- let e = b.find((e) => e.id === R);
37
- return e?.accessorKey ? [...K].sort((t, n) => {
31
+ S,
32
+ R,
33
+ C,
34
+ L
35
+ ]), J = g(() => {
36
+ if (F || !z || !V) return q;
37
+ let e = x.find((e) => e.id === z);
38
+ return e?.accessorKey ? [...q].sort((t, n) => {
38
39
  let r = t[e.accessorKey], i = n[e.accessorKey];
39
40
  if (r == null) return 1;
40
41
  if (i == null) return -1;
41
42
  let a = 0;
42
- return a = typeof r == "string" && typeof i == "string" ? r.localeCompare(i) : typeof r == "number" && typeof i == "number" ? r - i : r instanceof Date && i instanceof Date ? r.getTime() - i.getTime() : String(r).localeCompare(String(i)), B === "asc" ? a : -a;
43
- }) : K;
44
- }, [
45
- K,
46
- R,
47
- B,
48
- b
49
- ]), J = h(() => {
50
- if (!T || F) return q;
51
- let e = (H - 1) * W;
52
- return q.slice(e, e + W);
43
+ return a = typeof r == "string" && typeof i == "string" ? r.localeCompare(i) : typeof r == "number" && typeof i == "number" ? r - i : r instanceof Date && i instanceof Date ? r.getTime() - i.getTime() : String(r).localeCompare(String(i)), V === "asc" ? a : -a;
44
+ }) : q;
53
45
  }, [
54
46
  q,
55
- H,
56
- W,
47
+ z,
48
+ V,
49
+ x
50
+ ]), Y = g(() => {
51
+ if (!T || F) return J;
52
+ let e = (U - 1) * G;
53
+ return J.slice(e, e + G);
54
+ }, [
55
+ J,
56
+ U,
57
+ G,
57
58
  T,
58
59
  F
59
- ]), Y = Math.max(1, Math.ceil(q.length / W)), X = typeof P == "number", Z = X ? Math.max(1, Math.ceil(P / G)) : void 0, Se = (e) => {
60
- R === e ? B === "asc" ? V("desc") : B === "desc" && (z(null), V(null)) : (z(e), V("asc"));
61
- }, Ce = (r) => R === r ? _(B === "asc" ? n : e, { className: "w-4 h-4 text-primary" }) : /* @__PURE__ */ _(t, { className: "w-4 h-4 text-text-secondary/50" }), Q = (e, t) => {
60
+ ]), X = Math.max(1, Math.ceil(J.length / G)), Z = typeof P == "number", Q = Z ? Math.max(1, Math.ceil(P / K)) : void 0, Te = (e) => {
61
+ F || (z === e ? V === "asc" ? H("desc") : V === "desc" && (B(null), H(null)) : (B(e), H("asc")));
62
+ }, Ee = (r) => z === r ? v(V === "asc" ? n : e, { className: "w-4 h-4 text-primary" }) : /* @__PURE__ */ v(t, { className: "w-4 h-4 text-text-secondary/50" }), De = (e, t) => {
62
63
  if (t.cell) return t.cell(e);
63
64
  if (t.accessorKey) {
64
65
  let n = e[t.accessorKey];
@@ -66,116 +67,116 @@ function b({ columns: b, data: x, isLoading: ue = !1, error: de = null, onRetry:
66
67
  }
67
68
  return "-";
68
69
  };
69
- if (ue) return /* @__PURE__ */ v("div", {
70
+ if (le) return /* @__PURE__ */ y("div", {
70
71
  className: s("space-y-4", j),
71
72
  children: [
72
- C && /* @__PURE__ */ _("div", {
73
+ fe && /* @__PURE__ */ v("div", {
73
74
  className: "flex items-center gap-4",
74
- children: /* @__PURE__ */ _(l, { className: "h-10 w-64" })
75
+ children: /* @__PURE__ */ v(l, { className: "h-10 w-64" })
75
76
  }),
76
- /* @__PURE__ */ _("div", {
77
+ /* @__PURE__ */ v("div", {
77
78
  className: "hidden md:block rounded-card border border-border-seam bg-bg-surface shadow-elevation-1",
78
- children: /* @__PURE__ */ v(le, { children: [/* @__PURE__ */ _(p, { children: /* @__PURE__ */ _(m, { children: b.map((e) => /* @__PURE__ */ _(f, { children: /* @__PURE__ */ _(l, { className: "h-4 w-20 motion-safe:animate-vc-shimmer" }) }, e.id)) }) }), /* @__PURE__ */ _(u, { children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ _(m, { children: b.map((e) => /* @__PURE__ */ _(d, { children: /* @__PURE__ */ _(l, { className: "h-4 w-full max-w-[100px] motion-safe:animate-vc-shimmer" }) }, e.id)) }, t)) })] })
79
+ children: /* @__PURE__ */ y(u, { children: [/* @__PURE__ */ v(m, { children: /* @__PURE__ */ v(h, { children: x.map((e) => /* @__PURE__ */ v(p, { children: /* @__PURE__ */ v(l, { className: "h-4 w-20 motion-safe:animate-vc-shimmer" }) }, e.id)) }) }), /* @__PURE__ */ v(d, { children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ v(h, { children: x.map((e) => /* @__PURE__ */ v(f, { children: /* @__PURE__ */ v(l, { className: "h-4 w-full max-w-[100px] motion-safe:animate-vc-shimmer" }) }, e.id)) }, t)) })] })
79
80
  }),
80
- /* @__PURE__ */ _("div", {
81
+ /* @__PURE__ */ v("div", {
81
82
  className: "md:hidden space-y-3",
82
- children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ v("div", {
83
+ children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ y("div", {
83
84
  className: "rounded-card border border-border-seam bg-bg-surface p-4 shadow-elevation-1",
84
- children: [/* @__PURE__ */ _(l, { className: "h-4 w-2/3 mb-2 motion-safe:animate-vc-shimmer" }), /* @__PURE__ */ _(l, { className: "h-4 w-1/2 motion-safe:animate-vc-shimmer" })]
85
+ children: [/* @__PURE__ */ v(l, { className: "h-4 w-2/3 mb-2 motion-safe:animate-vc-shimmer" }), /* @__PURE__ */ v(l, { className: "h-4 w-1/2 motion-safe:animate-vc-shimmer" })]
85
86
  }, t))
86
87
  })
87
88
  ]
88
89
  });
89
- if (de && x.length === 0) return /* @__PURE__ */ v("div", {
90
+ if (ue && S.length === 0) return /* @__PURE__ */ y("div", {
90
91
  className: s("flex flex-col items-center justify-center gap-3 rounded-card border border-border-seam bg-bg-surface px-6 py-14 text-center shadow-elevation-1", j),
91
92
  children: [
92
- /* @__PURE__ */ _("div", {
93
+ /* @__PURE__ */ v("div", {
93
94
  className: "flex h-12 w-12 items-center justify-center rounded-full bg-status-error-bg text-status-error-text",
94
- children: /* @__PURE__ */ _(ne, { size: 22 })
95
+ children: /* @__PURE__ */ v(ne, { size: 22 })
95
96
  }),
96
- /* @__PURE__ */ _("p", {
97
+ /* @__PURE__ */ v("p", {
97
98
  className: "text-base font-medium text-text-primary",
98
99
  children: "Couldn’t load this list"
99
100
  }),
100
- /* @__PURE__ */ _("p", {
101
+ /* @__PURE__ */ v("p", {
101
102
  className: "max-w-sm text-sm text-text-secondary",
102
103
  children: "The service was briefly unreachable. This is usually momentary — try again."
103
104
  }),
104
- S && /* @__PURE__ */ v(c, {
105
+ de && /* @__PURE__ */ y(c, {
105
106
  variant: "outline",
106
107
  size: "sm",
107
- onClick: S,
108
+ onClick: de,
108
109
  className: "mt-1",
109
- children: [/* @__PURE__ */ _(ee, {
110
+ children: [/* @__PURE__ */ v(ee, {
110
111
  size: 14,
111
112
  className: "mr-1.5"
112
113
  }), "Retry"]
113
114
  })
114
115
  ]
115
116
  });
116
- let $ = J.length === 0, we = () => A ? L ? /* @__PURE__ */ _(y, {
117
+ let Oe = Y.length === 0, $ = () => A ? R ? /* @__PURE__ */ v(b, {
117
118
  illustration: "empty-search",
118
119
  title: "No matches",
119
- description: `Nothing matches “${L}”. Try a different search.`
120
- }) : /* @__PURE__ */ _(y, {
120
+ description: `Nothing matches “${R}”. Try a different search.`
121
+ }) : /* @__PURE__ */ v(b, {
121
122
  illustration: A,
122
- title: me ?? k,
123
- description: he,
124
- action: ge
125
- }) : /* @__PURE__ */ _("p", {
123
+ title: ge ?? k,
124
+ description: _e,
125
+ action: ve
126
+ }) : /* @__PURE__ */ v("p", {
126
127
  className: "text-text-secondary",
127
128
  children: k
128
- }), Te = T && (F ? q.length > 0 || I > 0 : q.length > 0);
129
- return /* @__PURE__ */ v("div", {
129
+ }), ke = T && (F ? J.length > 0 || I > 0 : J.length > 0);
130
+ return /* @__PURE__ */ y("div", {
130
131
  className: s("space-y-4", j),
131
132
  children: [
132
- C && /* @__PURE__ */ _("div", {
133
+ fe && /* @__PURE__ */ v("div", {
133
134
  className: "flex items-center gap-4",
134
- children: /* @__PURE__ */ v("div", {
135
+ children: /* @__PURE__ */ y("div", {
135
136
  className: "relative flex-1 max-w-sm",
136
- children: [/* @__PURE__ */ _(te, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-secondary" }), /* @__PURE__ */ _(re, {
137
- placeholder: fe,
138
- value: L,
137
+ children: [/* @__PURE__ */ v(te, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-secondary" }), /* @__PURE__ */ v(re, {
138
+ placeholder: pe,
139
+ value: R,
139
140
  onChange: (e) => {
140
- be(e.target.value), U(1);
141
+ L ? w?.(e.target.value) : (Ce(e.target.value), W(1));
141
142
  },
142
143
  className: "pl-9"
143
144
  })]
144
145
  })
145
146
  }),
146
- /* @__PURE__ */ _("div", {
147
+ /* @__PURE__ */ v("div", {
147
148
  className: "hidden md:block overflow-x-auto rounded-card border border-border-seam bg-bg-surface shadow-elevation-1",
148
- children: /* @__PURE__ */ v(le, { children: [/* @__PURE__ */ _(p, { children: /* @__PURE__ */ _(m, { children: b.map((e) => /* @__PURE__ */ _(f, {
149
- className: s(e.sortable && "cursor-pointer select-none hover:bg-bg-sunken/50", e.headerClassName),
150
- onClick: () => e.sortable && Se(e.id),
151
- children: /* @__PURE__ */ v("div", {
149
+ children: /* @__PURE__ */ y(u, { children: [/* @__PURE__ */ v(m, { children: /* @__PURE__ */ v(h, { children: x.map((e) => /* @__PURE__ */ v(p, {
150
+ className: s(!F && e.sortable && "cursor-pointer select-none hover:bg-bg-sunken/50", e.headerClassName),
151
+ onClick: () => !F && e.sortable && Te(e.id),
152
+ children: /* @__PURE__ */ y("div", {
152
153
  className: "flex items-center gap-2",
153
- children: [e.header, e.sortable && Ce(e.id)]
154
+ children: [e.header, !F && e.sortable && Ee(e.id)]
154
155
  })
155
- }, e.id)) }) }), /* @__PURE__ */ _(u, { children: $ ? /* @__PURE__ */ _(m, { children: /* @__PURE__ */ _(d, {
156
- colSpan: b.length,
156
+ }, e.id)) }) }), /* @__PURE__ */ v(d, { children: Oe ? /* @__PURE__ */ v(h, { children: /* @__PURE__ */ v(f, {
157
+ colSpan: x.length,
157
158
  className: "py-8 text-center",
158
- children: we()
159
- }) }) : J.map((e, t) => {
159
+ children: $()
160
+ }) }) : Y.map((e, t) => {
160
161
  let n = M ? M(e) : t, r = typeof O == "function" ? O(e) : O;
161
- return /* @__PURE__ */ _(m, {
162
+ return /* @__PURE__ */ v(h, {
162
163
  className: s(D && "cursor-pointer hover:bg-bg-sunken/50", r),
163
164
  onClick: () => D?.(e),
164
- children: b.map((t) => /* @__PURE__ */ _(d, {
165
+ children: x.map((t) => /* @__PURE__ */ v(f, {
165
166
  className: t.className,
166
- children: Q(e, t)
167
+ children: De(e, t)
167
168
  }, t.id))
168
169
  }, n);
169
170
  }) })] })
170
171
  }),
171
- /* @__PURE__ */ _("div", {
172
+ /* @__PURE__ */ v("div", {
172
173
  className: "md:hidden space-y-3",
173
- children: $ ? /* @__PURE__ */ _("div", {
174
+ children: Oe ? /* @__PURE__ */ v("div", {
174
175
  className: "rounded-card border border-border-seam bg-bg-surface p-6 text-center shadow-elevation-1",
175
- children: we()
176
- }) : J.map((e, t) => {
176
+ children: $()
177
+ }) : Y.map((e, t) => {
177
178
  let n = M ? M(e) : t, r = typeof O == "function" ? O(e) : O;
178
- return /* @__PURE__ */ _("div", {
179
+ return /* @__PURE__ */ v("div", {
179
180
  role: D ? "button" : void 0,
180
181
  tabIndex: D ? 0 : void 0,
181
182
  className: s("rounded-card border border-border-seam bg-bg-surface p-4 shadow-elevation-1", D && "cursor-pointer hover:bg-bg-sunken/50", r),
@@ -183,154 +184,154 @@ function b({ columns: b, data: x, isLoading: ue = !1, error: de = null, onRetry:
183
184
  onKeyDown: (t) => {
184
185
  D && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), D(e));
185
186
  },
186
- children: /* @__PURE__ */ _("dl", {
187
+ children: /* @__PURE__ */ v("dl", {
187
188
  className: "space-y-2",
188
- children: b.map((t) => /* @__PURE__ */ v("div", {
189
+ children: x.map((t) => /* @__PURE__ */ y("div", {
189
190
  className: "flex items-start justify-between gap-3",
190
- children: [/* @__PURE__ */ _("dt", {
191
+ children: [/* @__PURE__ */ v("dt", {
191
192
  className: "text-xs font-medium text-text-secondary shrink-0",
192
193
  children: t.header
193
- }), /* @__PURE__ */ _("dd", {
194
+ }), /* @__PURE__ */ v("dd", {
194
195
  className: "text-sm text-right min-w-0",
195
- children: Q(e, t)
196
+ children: De(e, t)
196
197
  })]
197
198
  }, t.id))
198
199
  })
199
200
  }, n);
200
201
  })
201
202
  }),
202
- Te && /* @__PURE__ */ v("div", {
203
+ ke && /* @__PURE__ */ y("div", {
203
204
  className: "flex flex-wrap items-center justify-between gap-3",
204
- children: [/* @__PURE__ */ v("div", {
205
+ children: [/* @__PURE__ */ y("div", {
205
206
  className: "flex flex-wrap items-center gap-2 text-sm text-text-secondary",
206
207
  children: [
207
- F ? /* @__PURE__ */ v("span", { children: [
208
+ F ? /* @__PURE__ */ y("span", { children: [
208
209
  "Showing ",
209
- q.length === 0 ? 0 : I * G + 1,
210
+ J.length === 0 ? 0 : I * K + 1,
210
211
  " to",
211
212
  " ",
212
- I * G + q.length,
213
- X ? ` of ${P}` : ""
214
- ] }) : /* @__PURE__ */ v("span", { children: [
213
+ I * K + J.length,
214
+ Z ? ` of ${P}` : ""
215
+ ] }) : /* @__PURE__ */ y("span", { children: [
215
216
  "Showing ",
216
- (H - 1) * W + 1,
217
+ (U - 1) * G + 1,
217
218
  " to",
218
219
  " ",
219
- Math.min(H * W, q.length),
220
+ Math.min(U * G, J.length),
220
221
  " of ",
221
- q.length
222
+ J.length
222
223
  ] }),
223
- /* @__PURE__ */ v(ie, {
224
- value: String(G),
224
+ /* @__PURE__ */ y(ie, {
225
+ value: String(K),
225
226
  onValueChange: (e) => {
226
227
  let t = Number(e);
227
- F ? ve?.(t) : (xe(t), U(1));
228
+ F ? be?.(t) : (we(t), W(1));
228
229
  },
229
- children: [/* @__PURE__ */ _(se, {
230
+ children: [/* @__PURE__ */ v(se, {
230
231
  className: "w-[70px] h-8",
231
- children: /* @__PURE__ */ _(ce, {})
232
- }), /* @__PURE__ */ _(ae, { children: pe.map((e) => /* @__PURE__ */ _(oe, {
232
+ children: /* @__PURE__ */ v(ce, {})
233
+ }), /* @__PURE__ */ v(ae, { children: he.map((e) => /* @__PURE__ */ v(oe, {
233
234
  value: String(e),
234
235
  children: e
235
236
  }, e)) })]
236
237
  }),
237
- /* @__PURE__ */ _("span", { children: "per page" })
238
+ /* @__PURE__ */ v("span", { children: "per page" })
238
239
  ]
239
- }), F ? /* @__PURE__ */ v("div", {
240
+ }), F ? /* @__PURE__ */ y("div", {
240
241
  className: "flex items-center gap-1",
241
242
  children: [
242
- /* @__PURE__ */ _(c, {
243
+ /* @__PURE__ */ v(c, {
243
244
  variant: "outline",
244
245
  size: "icon",
245
246
  className: "h-8 w-8",
246
247
  "aria-label": "First page",
247
248
  onClick: () => N?.(0),
248
249
  disabled: I === 0,
249
- children: /* @__PURE__ */ _(a, { className: "h-4 w-4" })
250
+ children: /* @__PURE__ */ v(a, { className: "h-4 w-4" })
250
251
  }),
251
- /* @__PURE__ */ _(c, {
252
+ /* @__PURE__ */ v(c, {
252
253
  variant: "outline",
253
254
  size: "icon",
254
255
  className: "h-8 w-8",
255
256
  "aria-label": "Previous page",
256
257
  onClick: () => N?.(Math.max(0, I - 1)),
257
258
  disabled: I === 0,
258
- children: /* @__PURE__ */ _(r, { className: "h-4 w-4" })
259
+ children: /* @__PURE__ */ v(r, { className: "h-4 w-4" })
259
260
  }),
260
- /* @__PURE__ */ v("span", {
261
+ /* @__PURE__ */ y("span", {
261
262
  className: "px-3 text-sm",
262
263
  children: [
263
264
  "Page ",
264
265
  I + 1,
265
- X ? ` of ${Z}` : ""
266
+ Z ? ` of ${Q}` : ""
266
267
  ]
267
268
  }),
268
- /* @__PURE__ */ _(c, {
269
+ /* @__PURE__ */ v(c, {
269
270
  variant: "outline",
270
271
  size: "icon",
271
272
  className: "h-8 w-8",
272
273
  "aria-label": "Next page",
273
274
  onClick: () => N?.(I + 1),
274
- disabled: X ? I + 1 >= (Z ?? 1) : !ye,
275
- children: /* @__PURE__ */ _(i, { className: "h-4 w-4" })
275
+ disabled: Z ? I + 1 >= (Q ?? 1) : !xe,
276
+ children: /* @__PURE__ */ v(i, { className: "h-4 w-4" })
276
277
  }),
277
- X && /* @__PURE__ */ _(c, {
278
+ Z && /* @__PURE__ */ v(c, {
278
279
  variant: "outline",
279
280
  size: "icon",
280
281
  className: "h-8 w-8",
281
282
  "aria-label": "Last page",
282
- onClick: () => N?.((Z ?? 1) - 1),
283
- disabled: I + 1 >= (Z ?? 1),
284
- children: /* @__PURE__ */ _(o, { className: "h-4 w-4" })
283
+ onClick: () => N?.((Q ?? 1) - 1),
284
+ disabled: I + 1 >= (Q ?? 1),
285
+ children: /* @__PURE__ */ v(o, { className: "h-4 w-4" })
285
286
  })
286
287
  ]
287
- }) : /* @__PURE__ */ v("div", {
288
+ }) : /* @__PURE__ */ y("div", {
288
289
  className: "flex items-center gap-1",
289
290
  children: [
290
- /* @__PURE__ */ _(c, {
291
+ /* @__PURE__ */ v(c, {
291
292
  variant: "outline",
292
293
  size: "icon",
293
294
  className: "h-8 w-8",
294
295
  "aria-label": "First page",
295
- onClick: () => U(1),
296
- disabled: H === 1,
297
- children: /* @__PURE__ */ _(a, { className: "h-4 w-4" })
296
+ onClick: () => W(1),
297
+ disabled: U === 1,
298
+ children: /* @__PURE__ */ v(a, { className: "h-4 w-4" })
298
299
  }),
299
- /* @__PURE__ */ _(c, {
300
+ /* @__PURE__ */ v(c, {
300
301
  variant: "outline",
301
302
  size: "icon",
302
303
  className: "h-8 w-8",
303
304
  "aria-label": "Previous page",
304
- onClick: () => U((e) => Math.max(1, e - 1)),
305
- disabled: H === 1,
306
- children: /* @__PURE__ */ _(r, { className: "h-4 w-4" })
305
+ onClick: () => W((e) => Math.max(1, e - 1)),
306
+ disabled: U === 1,
307
+ children: /* @__PURE__ */ v(r, { className: "h-4 w-4" })
307
308
  }),
308
- /* @__PURE__ */ v("span", {
309
+ /* @__PURE__ */ y("span", {
309
310
  className: "px-3 text-sm",
310
311
  children: [
311
312
  "Page ",
312
- H,
313
+ U,
313
314
  " of ",
314
- Y
315
+ X
315
316
  ]
316
317
  }),
317
- /* @__PURE__ */ _(c, {
318
+ /* @__PURE__ */ v(c, {
318
319
  variant: "outline",
319
320
  size: "icon",
320
321
  className: "h-8 w-8",
321
322
  "aria-label": "Next page",
322
- onClick: () => U((e) => Math.min(Y, e + 1)),
323
- disabled: H === Y,
324
- children: /* @__PURE__ */ _(i, { className: "h-4 w-4" })
323
+ onClick: () => W((e) => Math.min(X, e + 1)),
324
+ disabled: U === X,
325
+ children: /* @__PURE__ */ v(i, { className: "h-4 w-4" })
325
326
  }),
326
- /* @__PURE__ */ _(c, {
327
+ /* @__PURE__ */ v(c, {
327
328
  variant: "outline",
328
329
  size: "icon",
329
330
  className: "h-8 w-8",
330
331
  "aria-label": "Last page",
331
- onClick: () => U(Y),
332
- disabled: H === Y,
333
- children: /* @__PURE__ */ _(o, { className: "h-4 w-4" })
332
+ onClick: () => W(X),
333
+ disabled: U === X,
334
+ children: /* @__PURE__ */ v(o, { className: "h-4 w-4" })
334
335
  })
335
336
  ]
336
337
  })]
@@ -339,4 +340,4 @@ function b({ columns: b, data: x, isLoading: ue = !1, error: de = null, onRetry:
339
340
  });
340
341
  }
341
342
  //#endregion
342
- export { b as DataTable };
343
+ export { x as DataTable };
@@ -20,7 +20,7 @@ function m(e) {
20
20
  return `${n.toFixed(n >= 10 || r === 0 ? 0 : 1)} ${t[r]}`;
21
21
  }
22
22
  function h({ entityType: h, entityId: g }) {
23
- let { navigate: _ } = i(), { documents: v, isLoading: y } = a(h, g), b = () => _("/files/browse");
23
+ let { navigate: _ } = i(), { documents: v, hasMore: y, isLoading: b, loadMore: x } = a(h, g), S = () => _("/files/browse");
24
24
  return /* @__PURE__ */ p(s, { children: [/* @__PURE__ */ p(l, {
25
25
  className: "flex flex-row items-center justify-between",
26
26
  children: [/* @__PURE__ */ p(u, {
@@ -29,15 +29,15 @@ function h({ entityType: h, entityId: g }) {
29
29
  }), /* @__PURE__ */ p(o, {
30
30
  variant: "outline",
31
31
  size: "sm",
32
- onClick: b,
32
+ onClick: S,
33
33
  children: [/* @__PURE__ */ f(r, { size: 14 }), " Add / Manage"]
34
34
  })]
35
- }), /* @__PURE__ */ f(c, { children: y ? /* @__PURE__ */ f("p", {
35
+ }), /* @__PURE__ */ f(c, { children: b ? /* @__PURE__ */ f("p", {
36
36
  className: "text-text-secondary text-center py-4",
37
37
  children: "Loading documents…"
38
- }) : v.length > 0 ? /* @__PURE__ */ f("div", {
38
+ }) : v.length > 0 ? /* @__PURE__ */ p("div", {
39
39
  className: "space-y-3",
40
- children: v.map((n) => /* @__PURE__ */ p("div", {
40
+ children: [v.map((n) => /* @__PURE__ */ p("div", {
41
41
  className: "flex items-center justify-between gap-3 p-3 border rounded-lg",
42
42
  children: [/* @__PURE__ */ p("div", {
43
43
  className: "min-w-0",
@@ -61,10 +61,16 @@ function h({ entityType: h, entityId: g }) {
61
61
  }) : /* @__PURE__ */ p(o, {
62
62
  variant: "ghost",
63
63
  size: "sm",
64
- onClick: b,
64
+ onClick: S,
65
65
  children: [/* @__PURE__ */ f(t, { size: 14 }), " View"]
66
66
  })]
67
- }, n.id))
67
+ }, n.id)), y && /* @__PURE__ */ f(o, {
68
+ variant: "outline",
69
+ size: "sm",
70
+ onClick: x,
71
+ disabled: b,
72
+ children: "Load more documents"
73
+ })]
68
74
  }) : /* @__PURE__ */ p("div", {
69
75
  className: "text-center py-6",
70
76
  children: [
@@ -78,7 +84,7 @@ function h({ entityType: h, entityId: g }) {
78
84
  }),
79
85
  /* @__PURE__ */ f("button", {
80
86
  type: "button",
81
- onClick: b,
87
+ onClick: S,
82
88
  className: "mt-1 text-sm text-primary hover:underline",
83
89
  children: "Add them in Files"
84
90
  })