@burdenoff/microfe-buildmyiq 2026.1029.5 → 2026.1029.6

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 (33) hide show
  1. package/dist/buildmyiq/BuildmyiqAdminRoot.d.ts.map +1 -1
  2. package/dist/buildmyiq/BuildmyiqAdminRoot.js +160 -165
  3. package/dist/buildmyiq/BuildmyiqAdminRoot.js.map +1 -1
  4. package/dist/buildmyiq/components/Pagination.d.ts +5 -5
  5. package/dist/buildmyiq/components/Pagination.js.map +1 -1
  6. package/dist/buildmyiq/hooks/index.d.ts +1 -1
  7. package/dist/buildmyiq/hooks/index.js +1 -1
  8. package/dist/buildmyiq/hooks/useBuildmyiqApi.d.ts +4 -4
  9. package/dist/buildmyiq/hooks/useBuildmyiqApi.d.ts.map +1 -1
  10. package/dist/buildmyiq/hooks/useBuildmyiqApi.js +14 -14
  11. package/dist/buildmyiq/hooks/useBuildmyiqApi.js.map +1 -1
  12. package/dist/buildmyiq/hooks/useOffsetPager.d.ts +28 -0
  13. package/dist/buildmyiq/hooks/useOffsetPager.d.ts.map +1 -0
  14. package/dist/buildmyiq/hooks/useOffsetPager.js +19 -0
  15. package/dist/buildmyiq/hooks/useOffsetPager.js.map +1 -0
  16. package/dist/buildmyiq/pages/authoring/AuthoringPage.js +4 -4
  17. package/dist/buildmyiq/pages/authoring/AuthoringPage.js.map +1 -1
  18. package/dist/buildmyiq/pages/catalog/CatalogPage.js +4 -4
  19. package/dist/buildmyiq/pages/catalog/CatalogPage.js.map +1 -1
  20. package/dist/buildmyiq/pages/submissions/BulkGradingPage.js +4 -4
  21. package/dist/buildmyiq/pages/submissions/BulkGradingPage.js.map +1 -1
  22. package/dist/buildmyiq/pages/submissions/SubmissionsPage.js +4 -4
  23. package/dist/buildmyiq/pages/submissions/SubmissionsPage.js.map +1 -1
  24. package/dist/buildmyiq/pages/tutorReview/TutorReviewPage.js +4 -4
  25. package/dist/buildmyiq/pages/tutorReview/TutorReviewPage.js.map +1 -1
  26. package/dist/buildmyiq/types/index.d.ts +5 -5
  27. package/dist/buildmyiq/types/index.d.ts.map +1 -1
  28. package/dist/buildmyiq/types/index.js.map +1 -1
  29. package/package.json +1 -1
  30. package/dist/buildmyiq/hooks/useCursorPager.d.ts +0 -33
  31. package/dist/buildmyiq/hooks/useCursorPager.d.ts.map +0 -1
  32. package/dist/buildmyiq/hooks/useCursorPager.js +0 -25
  33. package/dist/buildmyiq/hooks/useCursorPager.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"BuildmyiqAdminRoot.d.ts","sourceRoot":"","sources":["../../src/buildmyiq/BuildmyiqAdminRoot.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA0BhC,OAAO,KAAK,EACV,kBAAkB,EAQnB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,0GAA0G;IAC1G,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAsoBD,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAsB1D,CAAC;AAEF,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"BuildmyiqAdminRoot.d.ts","sourceRoot":"","sources":["../../src/buildmyiq/BuildmyiqAdminRoot.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA2BhC,OAAO,KAAK,EACV,kBAAkB,EAQnB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,0GAA0G;IAC1G,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA+lBD,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAsB1D,CAAC;AAEF,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,CAAC"}
@@ -9,20 +9,21 @@ import { FilterTabs as p } from "./components/FilterTabs.js";
9
9
  import { Tabs as m } from "./components/Tabs.js";
10
10
  import { Pagination as h } from "./components/Pagination.js";
11
11
  import { useBuiArchiveCourse as g, useBuiAssessments as _, useBuiCourses as v, useBuiEnrollments as y, useBuiPublishCourse as b, useBuiSubmissions as x } from "./hooks/useBuildmyiqApi.js";
12
- import { BuiPermissionButton as S } from "./components/BuiPermissionButton.js";
13
- import { useMemo as C, useState as w } from "react";
14
- import { QueryClient as T, QueryClientProvider as E } from "@tanstack/react-query";
15
- import { FeatureFlagProvider as D } from "@burdenoff/fe-libs/shared/feature-flags";
16
- import { PermissionProvider as O } from "@burdenoff/fe-libs/shared/providers/shell";
17
- import { BookOpen as k, CheckSquare as A, ClipboardCheck as j, GraduationCap as M, Users as N } from "lucide-react";
18
- import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
19
- import { Button as L } from "@burdenoff/fe-libs/ui";
12
+ import { useOffsetPager as S } from "./hooks/useOffsetPager.js";
13
+ import { BuiPermissionButton as C } from "./components/BuiPermissionButton.js";
14
+ import { useMemo as w, useState as T } from "react";
15
+ import { QueryClient as E, QueryClientProvider as D } from "@tanstack/react-query";
16
+ import { FeatureFlagProvider as O } from "@burdenoff/fe-libs/shared/feature-flags";
17
+ import { PermissionProvider as k } from "@burdenoff/fe-libs/shared/providers/shell";
18
+ import { BookOpen as A, CheckSquare as j, ClipboardCheck as M, GraduationCap as N, Users as P } from "lucide-react";
19
+ import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
20
+ import { Button as R } from "@burdenoff/fe-libs/ui";
20
21
  //#region src/buildmyiq/BuildmyiqAdminRoot.tsx
21
- var R = new T({ defaultOptions: { queries: {
22
+ var z = new E({ defaultOptions: { queries: {
22
23
  staleTime: 30 * 1e3,
23
24
  retry: 1,
24
25
  refetchOnWindowFocus: !1
25
- } } }), z = 12, B = [
26
+ } } }), B = 12, V = [
26
27
  {
27
28
  value: "ALL",
28
29
  label: "All"
@@ -43,7 +44,7 @@ var R = new T({ defaultOptions: { queries: {
43
44
  value: "ARCHIVED",
44
45
  label: "Archived"
45
46
  }
46
- ], V = [
47
+ ], H = [
47
48
  {
48
49
  value: "ALL",
49
50
  label: "All"
@@ -68,7 +69,7 @@ var R = new T({ defaultOptions: { queries: {
68
69
  value: "EXPIRED",
69
70
  label: "Expired"
70
71
  }
71
- ], H = [
72
+ ], U = [
72
73
  {
73
74
  value: "ALL",
74
75
  label: "All"
@@ -90,15 +91,15 @@ var R = new T({ defaultOptions: { queries: {
90
91
  label: "Returned"
91
92
  }
92
93
  ];
93
- function U({ course: e }) {
94
+ function W({ course: e }) {
94
95
  let t = b(), n = g();
95
- return /* @__PURE__ */ I("div", {
96
+ return /* @__PURE__ */ L("div", {
96
97
  className: "flex flex-wrap items-center gap-2",
97
98
  children: [
98
- e.status === "DRAFT" && /* @__PURE__ */ F(S, {
99
+ e.status === "DRAFT" && /* @__PURE__ */ I(C, {
99
100
  resource: "buildmyiq-course",
100
101
  action: "update",
101
- children: /* @__PURE__ */ F(L, {
102
+ children: /* @__PURE__ */ I(R, {
102
103
  variant: "outline",
103
104
  size: "sm",
104
105
  onClick: () => t.mutate(e.id),
@@ -106,10 +107,10 @@ function U({ course: e }) {
106
107
  children: "Publish"
107
108
  })
108
109
  }),
109
- e.status !== "ARCHIVED" && /* @__PURE__ */ F(S, {
110
+ e.status !== "ARCHIVED" && /* @__PURE__ */ I(C, {
110
111
  resource: "buildmyiq-course",
111
112
  action: "delete",
112
- children: /* @__PURE__ */ F(L, {
113
+ children: /* @__PURE__ */ I(R, {
113
114
  variant: "outline",
114
115
  size: "sm",
115
116
  onClick: () => n.mutate(e.id),
@@ -117,28 +118,28 @@ function U({ course: e }) {
117
118
  children: "Archive"
118
119
  })
119
120
  }),
120
- e.status === "ARCHIVED" && /* @__PURE__ */ F("span", {
121
+ e.status === "ARCHIVED" && /* @__PURE__ */ I("span", {
121
122
  className: "text-xs text-text-secondary",
122
123
  children: "Archived"
123
124
  })
124
125
  ]
125
126
  });
126
127
  }
127
- function W() {
128
- let [e, t] = w("ALL"), [r, o] = w(0), [m, g] = w([]), _ = r > 0 ? m[r - 1] : void 0, { data: y, isLoading: b, error: x, refetch: S } = v({
128
+ function G() {
129
+ let [e, t] = T("ALL"), r = S(B), { data: o, isLoading: m, error: g, refetch: _ } = v({
129
130
  status: e === "ALL" ? void 0 : e,
130
- cursor: _,
131
- limit: z
132
- }), T = C(() => [
131
+ offset: r.offset,
132
+ limit: B
133
+ }), y = w(() => [
133
134
  {
134
135
  key: "title",
135
136
  header: "Course",
136
- render: (e) => /* @__PURE__ */ I("div", {
137
+ render: (e) => /* @__PURE__ */ L("div", {
137
138
  className: "min-w-0",
138
- children: [/* @__PURE__ */ F("p", {
139
+ children: [/* @__PURE__ */ I("p", {
139
140
  className: "font-medium text-text-primary truncate",
140
141
  children: e.title
141
- }), /* @__PURE__ */ F("p", {
142
+ }), /* @__PURE__ */ I("p", {
142
143
  className: "text-xs text-text-secondary",
143
144
  children: e.slug
144
145
  })]
@@ -148,12 +149,12 @@ function W() {
148
149
  {
149
150
  key: "status",
150
151
  header: "Status",
151
- render: (e) => /* @__PURE__ */ F(s, { status: e.status })
152
+ render: (e) => /* @__PURE__ */ I(s, { status: e.status })
152
153
  },
153
154
  {
154
155
  key: "level",
155
156
  header: "Level",
156
- render: (e) => /* @__PURE__ */ F(s, { status: e.level })
157
+ render: (e) => /* @__PURE__ */ I(s, { status: e.level })
157
158
  },
158
159
  {
159
160
  key: "lessons",
@@ -184,65 +185,63 @@ function W() {
184
185
  key: "actions",
185
186
  header: "Actions",
186
187
  align: "right",
187
- render: (e) => /* @__PURE__ */ F(U, { course: e })
188
+ render: (e) => /* @__PURE__ */ I(W, { course: e })
188
189
  }
189
- ], []), E = (e) => {
190
- e > r && y?.pageInfo.cursor ? g((e) => [...e, y.pageInfo.cursor]) : e < r && g((e) => e.slice(0, -1)), o(e);
191
- };
192
- if (b) return /* @__PURE__ */ F(u, { label: "Loading courses…" });
193
- if (x) return /* @__PURE__ */ F(l, {
190
+ ], []);
191
+ if (m) return /* @__PURE__ */ I(u, { label: "Loading courses…" });
192
+ if (g) return /* @__PURE__ */ I(l, {
194
193
  title: "Could not load courses",
195
- message: x.message,
196
- onRetry: S
194
+ message: g.message,
195
+ onRetry: _
197
196
  });
198
- let D = y?.items ?? [];
199
- return /* @__PURE__ */ I(d, {
197
+ let b = o?.items ?? [];
198
+ return /* @__PURE__ */ L(d, {
200
199
  title: "Course catalog",
201
200
  description: "Publish, archive and inspect courses.",
202
- children: [/* @__PURE__ */ F("div", {
201
+ children: [/* @__PURE__ */ I("div", {
203
202
  className: "mb-4",
204
- children: /* @__PURE__ */ F(p, {
205
- options: B,
203
+ children: /* @__PURE__ */ I(p, {
204
+ options: V,
206
205
  value: e,
207
206
  onChange: (e) => {
208
- t(e), o(0), g([]);
207
+ t(e), r.reset();
209
208
  }
210
209
  })
211
- }), D.length === 0 ? /* @__PURE__ */ F(c, {
212
- icon: /* @__PURE__ */ F(k, { size: 40 }),
210
+ }), b.length === 0 ? /* @__PURE__ */ I(c, {
211
+ icon: /* @__PURE__ */ I(A, { size: 40 }),
213
212
  title: "No courses found",
214
213
  description: `There are no ${e === "ALL" ? "" : e.toLowerCase()} courses in this workspace.`
215
- }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(f, {
216
- columns: T,
217
- rows: D,
214
+ }) : /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(f, {
215
+ columns: y,
216
+ rows: b,
218
217
  rowKey: (e) => e.id,
219
218
  defaultSort: {
220
219
  key: "created",
221
220
  dir: "desc"
222
221
  }
223
- }), /* @__PURE__ */ F(h, {
224
- page: r,
225
- pageSize: z,
226
- itemCount: D.length,
227
- hasMore: y?.pageInfo.hasMore ?? !1,
228
- onPageChange: E
222
+ }), /* @__PURE__ */ I(h, {
223
+ page: r.page,
224
+ pageSize: B,
225
+ itemCount: b.length,
226
+ hasMore: o?.pageInfo.hasMore ?? !1,
227
+ onPageChange: r.onPageChange
229
228
  })] })]
230
229
  });
231
230
  }
232
- function G() {
233
- let [e, t] = w(""), { data: n, isLoading: r, error: i } = v({
231
+ function K() {
232
+ let [e, t] = T(""), { data: n, isLoading: r, error: i } = v({
234
233
  status: "PUBLISHED",
235
234
  limit: 100
236
- }), { data: p, isLoading: m, error: h } = _(e || void 0), g = C(() => [
235
+ }), { data: p, isLoading: m, error: h } = _(e || void 0), g = w(() => [
237
236
  {
238
237
  key: "title",
239
238
  header: "Assessment",
240
- render: (e) => /* @__PURE__ */ I("div", {
239
+ render: (e) => /* @__PURE__ */ L("div", {
241
240
  className: "min-w-0",
242
- children: [/* @__PURE__ */ F("p", {
241
+ children: [/* @__PURE__ */ I("p", {
243
242
  className: "font-medium text-text-primary truncate",
244
243
  children: e.title
245
- }), /* @__PURE__ */ F("p", {
244
+ }), /* @__PURE__ */ I("p", {
246
245
  className: "text-xs text-text-secondary",
247
246
  children: e.type
248
247
  })]
@@ -252,7 +251,7 @@ function G() {
252
251
  {
253
252
  key: "status",
254
253
  header: "Status",
255
- render: (e) => /* @__PURE__ */ F(s, { status: e.status })
254
+ render: (e) => /* @__PURE__ */ I(s, { status: e.status })
256
255
  },
257
256
  {
258
257
  key: "questions",
@@ -280,43 +279,43 @@ function G() {
280
279
  render: (e) => e.timeLimitMin > 0 ? `${e.timeLimitMin} min` : "—"
281
280
  }
282
281
  ], []);
283
- if (r) return /* @__PURE__ */ F(u, { label: "Loading courses…" });
284
- if (i) return /* @__PURE__ */ F(l, {
282
+ if (r) return /* @__PURE__ */ I(u, { label: "Loading courses…" });
283
+ if (i) return /* @__PURE__ */ I(l, {
285
284
  title: "Could not load courses",
286
285
  message: i.message
287
286
  });
288
287
  let y = n?.items ?? [];
289
- return /* @__PURE__ */ F(d, {
288
+ return /* @__PURE__ */ I(d, {
290
289
  title: "Assessments",
291
290
  description: "Inspect assessments attached to a published course.",
292
- action: /* @__PURE__ */ I("div", {
291
+ action: /* @__PURE__ */ L("div", {
293
292
  className: "min-w-[16rem]",
294
- children: [/* @__PURE__ */ F("label", {
293
+ children: [/* @__PURE__ */ I("label", {
295
294
  htmlFor: "bui-admin-course-select",
296
295
  className: "sr-only",
297
296
  children: "Select course"
298
- }), /* @__PURE__ */ I("select", {
297
+ }), /* @__PURE__ */ L("select", {
299
298
  id: "bui-admin-course-select",
300
299
  value: e,
301
300
  onChange: (e) => t(e.target.value),
302
301
  className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg",
303
- children: [/* @__PURE__ */ F("option", {
302
+ children: [/* @__PURE__ */ I("option", {
304
303
  value: "",
305
304
  children: "Choose a course…"
306
- }), y.map((e) => /* @__PURE__ */ F("option", {
305
+ }), y.map((e) => /* @__PURE__ */ I("option", {
307
306
  value: e.id,
308
307
  children: e.title
309
308
  }, e.id))]
310
309
  })]
311
310
  }),
312
- children: e ? m ? /* @__PURE__ */ F(u, { label: "Loading assessments…" }) : h ? /* @__PURE__ */ F(l, {
311
+ children: e ? m ? /* @__PURE__ */ I(u, { label: "Loading assessments…" }) : h ? /* @__PURE__ */ I(l, {
313
312
  title: "Could not load assessments",
314
313
  message: h.message
315
- }) : p?.length === 0 ? /* @__PURE__ */ F(c, {
316
- icon: /* @__PURE__ */ F(j, { size: 40 }),
314
+ }) : p?.length === 0 ? /* @__PURE__ */ I(c, {
315
+ icon: /* @__PURE__ */ I(M, { size: 40 }),
317
316
  title: "No assessments",
318
317
  description: "This course has no assessments yet."
319
- }) : /* @__PURE__ */ F(f, {
318
+ }) : /* @__PURE__ */ I(f, {
320
319
  columns: g,
321
320
  rows: p ?? [],
322
321
  rowKey: (e) => e.id,
@@ -324,23 +323,23 @@ function G() {
324
323
  key: "title",
325
324
  dir: "asc"
326
325
  }
327
- }) : /* @__PURE__ */ F(c, {
328
- icon: /* @__PURE__ */ F(j, { size: 40 }),
326
+ }) : /* @__PURE__ */ I(c, {
327
+ icon: /* @__PURE__ */ I(M, { size: 40 }),
329
328
  title: "Select a course",
330
329
  description: "Choose a published course above to view its assessments."
331
330
  })
332
331
  });
333
332
  }
334
- function K() {
335
- let [e, t] = w("ALL"), [n, i] = w(0), [a, m] = w([]), g = n > 0 ? a[n - 1] : void 0, { data: _, isLoading: v, error: b, refetch: x } = y({
333
+ function q() {
334
+ let [e, t] = T("ALL"), n = S(B), { data: i, isLoading: a, error: m, refetch: g } = y({
336
335
  status: e === "ALL" ? void 0 : e,
337
- cursor: g,
338
- limit: z
339
- }), S = C(() => [
336
+ offset: n.offset,
337
+ limit: B
338
+ }), _ = w(() => [
340
339
  {
341
340
  key: "learner",
342
341
  header: "Learner",
343
- render: (e) => /* @__PURE__ */ F("span", {
342
+ render: (e) => /* @__PURE__ */ I("span", {
344
343
  className: "font-mono text-xs text-text-secondary",
345
344
  children: e.learnerId
346
345
  })
@@ -348,7 +347,7 @@ function K() {
348
347
  {
349
348
  key: "course",
350
349
  header: "Course ID",
351
- render: (e) => /* @__PURE__ */ F("span", {
350
+ render: (e) => /* @__PURE__ */ I("span", {
352
351
  className: "font-mono text-xs text-text-secondary",
353
352
  children: e.courseId
354
353
  })
@@ -356,7 +355,7 @@ function K() {
356
355
  {
357
356
  key: "status",
358
357
  header: "Status",
359
- render: (e) => /* @__PURE__ */ F(s, { status: e.status })
358
+ render: (e) => /* @__PURE__ */ I(s, { status: e.status })
360
359
  },
361
360
  {
362
361
  key: "progress",
@@ -380,70 +379,68 @@ function K() {
380
379
  {
381
380
  key: "lastActive",
382
381
  header: "Last Active",
383
- render: (e) => e.lastActiveAt ? q(e.lastActiveAt) : "—",
382
+ render: (e) => e.lastActiveAt ? J(e.lastActiveAt) : "—",
384
383
  sortValue: (e) => e.lastActiveAt ? new Date(e.lastActiveAt).getTime() : 0,
385
384
  hideOnMobile: !0
386
385
  }
387
- ], []), T = (e) => {
388
- e > n && _?.pageInfo.cursor ? m((e) => [...e, _.pageInfo.cursor]) : e < n && m((e) => e.slice(0, -1)), i(e);
389
- };
390
- if (v) return /* @__PURE__ */ F(u, { label: "Loading enrollments…" });
391
- if (b) return /* @__PURE__ */ F(l, {
386
+ ], []);
387
+ if (a) return /* @__PURE__ */ I(u, { label: "Loading enrollments…" });
388
+ if (m) return /* @__PURE__ */ I(l, {
392
389
  title: "Could not load enrollments",
393
- message: b.message,
394
- onRetry: x
390
+ message: m.message,
391
+ onRetry: g
395
392
  });
396
- let E = _?.items ?? [];
397
- return /* @__PURE__ */ I(d, {
393
+ let v = i?.items ?? [];
394
+ return /* @__PURE__ */ L(d, {
398
395
  title: "Enrollments",
399
396
  description: "Workspace-wide learner enrollment overview.",
400
- children: [/* @__PURE__ */ F("div", {
397
+ children: [/* @__PURE__ */ I("div", {
401
398
  className: "mb-4",
402
- children: /* @__PURE__ */ F(p, {
403
- options: V,
399
+ children: /* @__PURE__ */ I(p, {
400
+ options: H,
404
401
  value: e,
405
402
  onChange: (e) => {
406
- t(e), i(0), m([]);
403
+ t(e), n.reset();
407
404
  }
408
405
  })
409
- }), E.length === 0 ? /* @__PURE__ */ F(c, {
410
- icon: /* @__PURE__ */ F(N, { size: 40 }),
406
+ }), v.length === 0 ? /* @__PURE__ */ I(c, {
407
+ icon: /* @__PURE__ */ I(P, { size: 40 }),
411
408
  title: "No enrollments",
412
409
  description: `There are no ${e === "ALL" ? "" : e.toLowerCase()} enrollments in this workspace.`
413
- }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(f, {
414
- columns: S,
415
- rows: E,
410
+ }) : /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(f, {
411
+ columns: _,
412
+ rows: v,
416
413
  rowKey: (e) => e.id,
417
414
  defaultSort: {
418
415
  key: "enrolled",
419
416
  dir: "desc"
420
417
  }
421
- }), /* @__PURE__ */ F(h, {
422
- page: n,
423
- pageSize: z,
424
- itemCount: E.length,
425
- hasMore: _?.pageInfo.hasMore ?? !1,
426
- onPageChange: T
418
+ }), /* @__PURE__ */ I(h, {
419
+ page: n.page,
420
+ pageSize: B,
421
+ itemCount: v.length,
422
+ hasMore: i?.pageInfo.hasMore ?? !1,
423
+ onPageChange: n.onPageChange
427
424
  })] })]
428
425
  });
429
426
  }
430
- function q(e) {
427
+ function J(e) {
431
428
  let t = typeof e == "string" ? new Date(e) : e, n = /* @__PURE__ */ new Date(), r = t.getTime() - n.getTime(), i = r >= 0, a = Math.floor(Math.abs(r) / 1e3), o = Math.floor(a / 60), s = Math.floor(o / 60), c = Math.floor(s / 24), l = (e, t) => {
432
429
  let n = `${e} ${t}${e === 1 ? "" : "s"}`;
433
430
  return i ? `in ${n}` : `${n} ago`;
434
431
  };
435
432
  return a < 60 ? i ? "soon" : "just now" : o < 60 ? l(o, "min") : s < 24 ? l(s, "hour") : l(c, "day");
436
433
  }
437
- function J() {
438
- let [e, t] = w("ALL"), [n, i] = w(0), [m, g] = w([]), _ = n > 0 ? m[n - 1] : void 0, { data: v, isLoading: y, error: b, refetch: S } = x({
434
+ function Y() {
435
+ let [e, t] = T("ALL"), n = S(B), { data: i, isLoading: m, error: g, refetch: _ } = x({
439
436
  status: e === "ALL" ? void 0 : e,
440
- cursor: _,
441
- limit: z
442
- }), T = C(() => [
437
+ offset: n.offset,
438
+ limit: B
439
+ }), v = w(() => [
443
440
  {
444
441
  key: "learner",
445
442
  header: "Learner",
446
- render: (e) => /* @__PURE__ */ F("span", {
443
+ render: (e) => /* @__PURE__ */ I("span", {
447
444
  className: "font-mono text-xs text-text-secondary",
448
445
  children: e.learnerId
449
446
  })
@@ -451,7 +448,7 @@ function J() {
451
448
  {
452
449
  key: "assessment",
453
450
  header: "Assessment ID",
454
- render: (e) => /* @__PURE__ */ F("span", {
451
+ render: (e) => /* @__PURE__ */ I("span", {
455
452
  className: "font-mono text-xs text-text-secondary",
456
453
  children: e.assessmentId
457
454
  })
@@ -465,7 +462,7 @@ function J() {
465
462
  {
466
463
  key: "status",
467
464
  header: "Status",
468
- render: (e) => /* @__PURE__ */ F(s, { status: e.status })
465
+ render: (e) => /* @__PURE__ */ I(s, { status: e.status })
469
466
  },
470
467
  {
471
468
  key: "score",
@@ -491,121 +488,119 @@ function J() {
491
488
  key: "actions",
492
489
  header: "Review",
493
490
  align: "right",
494
- render: () => /* @__PURE__ */ F(L, {
491
+ render: () => /* @__PURE__ */ I(R, {
495
492
  variant: "ghost",
496
493
  size: "sm",
497
494
  disabled: !0,
498
495
  children: "Open"
499
496
  })
500
497
  }
501
- ], []), E = (e) => {
502
- e > n && v?.pageInfo.cursor ? g((e) => [...e, v.pageInfo.cursor]) : e < n && g((e) => e.slice(0, -1)), i(e);
503
- };
504
- if (y) return /* @__PURE__ */ F(u, { label: "Loading submissions…" });
505
- if (b) return /* @__PURE__ */ F(l, {
498
+ ], []);
499
+ if (m) return /* @__PURE__ */ I(u, { label: "Loading submissions…" });
500
+ if (g) return /* @__PURE__ */ I(l, {
506
501
  title: "Could not load submissions",
507
- message: b.message,
508
- onRetry: S
502
+ message: g.message,
503
+ onRetry: _
509
504
  });
510
- let D = v?.items ?? [];
511
- return /* @__PURE__ */ I(d, {
505
+ let y = i?.items ?? [];
506
+ return /* @__PURE__ */ L(d, {
512
507
  title: "Submission review",
513
508
  description: "Review learner submissions and grading status.",
514
- children: [/* @__PURE__ */ F("div", {
509
+ children: [/* @__PURE__ */ I("div", {
515
510
  className: "mb-4",
516
- children: /* @__PURE__ */ F(p, {
517
- options: H,
511
+ children: /* @__PURE__ */ I(p, {
512
+ options: U,
518
513
  value: e,
519
514
  onChange: (e) => {
520
- t(e), i(0), g([]);
515
+ t(e), n.reset();
521
516
  }
522
517
  })
523
- }), D.length === 0 ? /* @__PURE__ */ F(c, {
524
- icon: /* @__PURE__ */ F(A, { size: 40 }),
518
+ }), y.length === 0 ? /* @__PURE__ */ I(c, {
519
+ icon: /* @__PURE__ */ I(j, { size: 40 }),
525
520
  title: "No submissions",
526
521
  description: `There are no ${e === "ALL" ? "" : e.toLowerCase()} submissions in this workspace.`
527
- }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(f, {
528
- columns: T,
529
- rows: D,
522
+ }) : /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(f, {
523
+ columns: v,
524
+ rows: y,
530
525
  rowKey: (e) => e.id,
531
526
  defaultSort: {
532
527
  key: "submitted",
533
528
  dir: "desc"
534
529
  }
535
- }), /* @__PURE__ */ F(h, {
536
- page: n,
537
- pageSize: z,
538
- itemCount: D.length,
539
- hasMore: v?.pageInfo.hasMore ?? !1,
540
- onPageChange: E
530
+ }), /* @__PURE__ */ I(h, {
531
+ page: n.page,
532
+ pageSize: B,
533
+ itemCount: y.length,
534
+ hasMore: i?.pageInfo.hasMore ?? !1,
535
+ onPageChange: n.onPageChange
541
536
  })] })]
542
537
  });
543
538
  }
544
- function Y() {
545
- let [e, n] = w("courses"), r = C(() => [
539
+ function X() {
540
+ let [e, n] = T("courses"), r = w(() => [
546
541
  {
547
542
  value: "courses",
548
543
  label: "Courses",
549
- icon: /* @__PURE__ */ F(k, { size: 18 })
544
+ icon: /* @__PURE__ */ I(A, { size: 18 })
550
545
  },
551
546
  {
552
547
  value: "assessments",
553
548
  label: "Assessments",
554
- icon: /* @__PURE__ */ F(j, { size: 18 })
549
+ icon: /* @__PURE__ */ I(M, { size: 18 })
555
550
  },
556
551
  {
557
552
  value: "enrollments",
558
553
  label: "Enrollments",
559
- icon: /* @__PURE__ */ F(N, { size: 18 })
554
+ icon: /* @__PURE__ */ I(P, { size: 18 })
560
555
  },
561
556
  {
562
557
  value: "submissions",
563
558
  label: "Submissions",
564
- icon: /* @__PURE__ */ F(A, { size: 18 })
559
+ icon: /* @__PURE__ */ I(j, { size: 18 })
565
560
  }
566
561
  ], []);
567
- return /* @__PURE__ */ I(t, {
562
+ return /* @__PURE__ */ L(t, {
568
563
  title: "BuildMyIQ Admin",
569
564
  description: "Course, assessment, enrollment and submission governance.",
570
- actions: /* @__PURE__ */ I("span", {
565
+ actions: /* @__PURE__ */ L("span", {
571
566
  className: "inline-flex items-center gap-2 text-sm text-text-secondary",
572
- children: [/* @__PURE__ */ F(M, { size: 18 }), "Workspace-scoped"]
567
+ children: [/* @__PURE__ */ I(N, { size: 18 }), "Workspace-scoped"]
573
568
  }),
574
- children: [/* @__PURE__ */ F(m, {
569
+ children: [/* @__PURE__ */ I(m, {
575
570
  items: r,
576
571
  value: e,
577
572
  onChange: (e) => n(e)
578
- }), /* @__PURE__ */ I("div", {
573
+ }), /* @__PURE__ */ L("div", {
579
574
  className: "mt-6",
580
575
  children: [
581
- e === "courses" && /* @__PURE__ */ F(W, {}),
582
- e === "assessments" && /* @__PURE__ */ F(G, {}),
583
- e === "enrollments" && /* @__PURE__ */ F(K, {}),
584
- e === "submissions" && /* @__PURE__ */ F(J, {})
576
+ e === "courses" && /* @__PURE__ */ I(G, {}),
577
+ e === "assessments" && /* @__PURE__ */ I(K, {}),
578
+ e === "enrollments" && /* @__PURE__ */ I(q, {}),
579
+ e === "submissions" && /* @__PURE__ */ I(Y, {})
585
580
  ]
586
581
  })]
587
582
  });
588
583
  }
589
- var X = (t) => {
584
+ var Z = (t) => {
590
585
  let n = t;
591
- return /* @__PURE__ */ F(E, {
592
- client: R,
593
- children: /* @__PURE__ */ F(D, {
586
+ return /* @__PURE__ */ I(D, {
587
+ client: z,
588
+ children: /* @__PURE__ */ I(O, {
594
589
  workspaceId: t.workspaceId ?? null,
595
590
  gateway: "global",
596
591
  defaultEnabled: !0,
597
- children: /* @__PURE__ */ F(O, {
592
+ children: /* @__PURE__ */ I(k, {
598
593
  scopeId: t.workspaceId ?? null,
599
594
  gateway: "workspace",
600
- children: /* @__PURE__ */ F(e, {
595
+ children: /* @__PURE__ */ I(e, {
601
596
  ...n,
602
- children: /* @__PURE__ */ F(Y, {})
597
+ children: /* @__PURE__ */ I(X, {})
603
598
  })
604
599
  })
605
600
  })
606
601
  });
607
602
  };
608
603
  //#endregion
609
- export { X as BuildmyiqAdminRoot };
604
+ export { Z as BuildmyiqAdminRoot };
610
605
 
611
606
  //# sourceMappingURL=BuildmyiqAdminRoot.js.map