@burdenoff/microfe-technospam 2026.1031.4 → 2026.1031.5
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/technospam/lib/a11y.d.ts +11 -0
- package/dist/technospam/lib/a11y.d.ts.map +1 -0
- package/dist/technospam/lib/a11y.js +6 -0
- package/dist/technospam/lib/a11y.js.map +1 -0
- package/dist/technospam/pages/AdminAdminDashboardPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/AdminAdminDashboardPagePage.js +150 -148
- package/dist/technospam/pages/AdminAdminDashboardPagePage.js.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemsPagePage.js +47 -45
- package/dist/technospam/pages/ApplicationsProblemsPagePage.js.map +1 -1
- package/dist/technospam/pages/CoursesCoursesPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/CoursesCoursesPagePage.js +74 -72
- package/dist/technospam/pages/CoursesCoursesPagePage.js.map +1 -1
- package/dist/technospam/pages/HackathonsHackathonsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/HackathonsHackathonsPagePage.js +83 -81
- package/dist/technospam/pages/HackathonsHackathonsPagePage.js.map +1 -1
- package/dist/technospam/pages/MentorshipSessionsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/MentorshipSessionsPagePage.js +99 -97
- package/dist/technospam/pages/MentorshipSessionsPagePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,47 +10,48 @@ import { CodePanel as g, TestResultsPanel as _ } from "../components/SubmissionV
|
|
|
10
10
|
import { notify as v } from "../lib/toast.js";
|
|
11
11
|
import { useApproveMentor as y, useArchiveCourse as b, useCompleteHackathon as x, useCoursesQuery as S, useCreateCourse as C, useCreateHackathon as w, useCreateLesson as T, useCreateProblem as ee, useGradeSubmission as E, useHackathonsQuery as D, useLessonQuizKeyQuery as O, useLessonsQuery as k, useMentorsQuery as A, useOpenRegistration as te, useProblemsQuery as j, usePublishCourse as M, usePublishProblem as N, useRegradeSubmission as P, useScoreTeam as F, useStartHackathon as I, useStartJudging as L, useSubmissionsQuery as R, useTeamsQuery as z, useUpdateLesson as B } from "../api/technospamApi.js";
|
|
12
12
|
import "../components/index.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
13
|
+
import { TAB_PANEL_FOCUS_CLASS as ne } from "../lib/a11y.js";
|
|
14
|
+
import { draftFromLesson as V, draftToInput as re } from "../components/lesson/lessonAuthoring.js";
|
|
15
|
+
import { LessonKindFields as ie } from "../components/lesson/LessonKindFields.js";
|
|
16
|
+
import { useMemo as ae, useState as H } from "react";
|
|
17
|
+
import { Archive as oe, Award as se, BookOpen as U, Code2 as W, ExternalLink as ce, Gavel as le, ListChecks as ue, Pencil as de, Play as fe, Plus as pe, RefreshCw as me, Rocket as he, ShieldAlert as ge, Trophy as _e, UserCheck as ve, Users as G, X as ye } from "lucide-react";
|
|
17
18
|
import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
18
|
-
import { Badge as
|
|
19
|
-
import { nativeConfirm as
|
|
19
|
+
import { Badge as be, Button as Y, GlassCard as xe, Input as X, Select as Se, SelectContent as Ce, SelectItem as we, SelectTrigger as Te, SelectValue as Ee, Tabs as De, TabsContent as Oe, TabsList as ke, TabsTrigger as Ae, Textarea as Z } from "@burdenoff/fe-libs/ui";
|
|
20
|
+
import { nativeConfirm as je } from "@burdenoff/fe-libs/shared/native";
|
|
20
21
|
//#region src/technospam/pages/AdminAdminDashboardPagePage.tsx
|
|
21
|
-
var
|
|
22
|
+
var Me = [
|
|
22
23
|
"ARTICLE",
|
|
23
24
|
"VIDEO",
|
|
24
25
|
"INTERACTIVE",
|
|
25
26
|
"QUIZ",
|
|
26
27
|
"PROJECT"
|
|
27
|
-
],
|
|
28
|
+
], Ne = [
|
|
28
29
|
"ACCEPTED",
|
|
29
30
|
"WRONG_ANSWER",
|
|
30
31
|
"TIME_LIMIT_EXCEEDED",
|
|
31
32
|
"RUNTIME_ERROR",
|
|
32
33
|
"COMPILE_ERROR"
|
|
33
|
-
],
|
|
34
|
+
], Pe = [
|
|
34
35
|
"BEGINNER",
|
|
35
36
|
"INTERMEDIATE",
|
|
36
37
|
"ADVANCED",
|
|
37
38
|
"EXPERT"
|
|
38
|
-
],
|
|
39
|
+
], Fe = [
|
|
39
40
|
"EASY",
|
|
40
41
|
"MEDIUM",
|
|
41
42
|
"HARD"
|
|
42
43
|
];
|
|
43
|
-
function
|
|
44
|
+
function Ie(e) {
|
|
44
45
|
return e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function Le(e) {
|
|
47
48
|
return e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
48
49
|
}
|
|
49
50
|
function Q(e) {
|
|
50
51
|
let t = Number.parseInt(e, 10);
|
|
51
52
|
return Number.isFinite(t) ? t : void 0;
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function Re(e) {
|
|
54
55
|
if (!e) return null;
|
|
55
56
|
let t = new Date(e);
|
|
56
57
|
return Number.isNaN(t.getTime()) ? null : t.toISOString();
|
|
@@ -67,7 +68,7 @@ function $({ label: e, required: t, className: n, children: r }) {
|
|
|
67
68
|
}), r]
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function ze({ seed: e, icon: n }) {
|
|
71
72
|
return /* @__PURE__ */ q("span", {
|
|
72
73
|
className: t("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br text-white shadow-sm", r(e)),
|
|
73
74
|
children: /* @__PURE__ */ q(n, {
|
|
@@ -76,8 +77,8 @@ function Re({ seed: e, icon: n }) {
|
|
|
76
77
|
})
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
-
return /* @__PURE__ */ J(
|
|
80
|
+
function Be({ title: e, description: t, icon: n, children: r, footer: i }) {
|
|
81
|
+
return /* @__PURE__ */ J(xe, {
|
|
81
82
|
className: "space-y-4 p-4 sm:p-5",
|
|
82
83
|
children: [
|
|
83
84
|
/* @__PURE__ */ J("div", {
|
|
@@ -107,7 +108,7 @@ function ze({ title: e, description: t, icon: n, children: r, footer: i }) {
|
|
|
107
108
|
]
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function Ve({ summary: e, actionLabel: t, open: n, onToggle: r }) {
|
|
111
112
|
return /* @__PURE__ */ J("div", {
|
|
112
113
|
className: "flex items-center justify-between gap-3",
|
|
113
114
|
children: [/* @__PURE__ */ q("p", {
|
|
@@ -117,12 +118,12 @@ function Be({ summary: e, actionLabel: t, open: n, onToggle: r }) {
|
|
|
117
118
|
size: "sm",
|
|
118
119
|
variant: n ? "outline" : "default",
|
|
119
120
|
onClick: r,
|
|
120
|
-
children: [q(n ?
|
|
121
|
+
children: [q(n ? ye : pe, { size: 15 }), n ? "Close" : t]
|
|
121
122
|
}) : null]
|
|
122
123
|
});
|
|
123
124
|
}
|
|
124
|
-
function
|
|
125
|
-
return /* @__PURE__ */ J(
|
|
125
|
+
function He({ leading: e, children: t, actions: n }) {
|
|
126
|
+
return /* @__PURE__ */ J(xe, {
|
|
126
127
|
className: "flex flex-col gap-3 p-4 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md sm:flex-row sm:items-center sm:justify-between",
|
|
127
128
|
children: [/* @__PURE__ */ J("div", {
|
|
128
129
|
className: "flex min-w-0 items-center gap-3",
|
|
@@ -136,8 +137,8 @@ function Ve({ leading: e, children: t, actions: n }) {
|
|
|
136
137
|
}) : null]
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
-
let [r, { loading: i }] = B(), [a, o] =
|
|
140
|
+
function Ue({ lesson: e, onSaved: t, onCancel: n }) {
|
|
141
|
+
let [r, { loading: i }] = B(), [a, o] = H(e.title), [s, c] = H(e.kind), [l, d] = H(e.content ?? ""), [f, p] = H(String(e.estimatedMinutes ?? "")), [m, h] = H(() => V(e)), { data: g } = O(e.id, s !== "QUIZ"), [_, y] = H(null), b = ae(() => V(null, g?.tecLessonQuizKey).quiz, [g]), x = {
|
|
141
142
|
...m,
|
|
142
143
|
quiz: _ ?? b
|
|
143
144
|
};
|
|
@@ -151,13 +152,13 @@ function He({ lesson: e, onSaved: t, onCancel: n }) {
|
|
|
151
152
|
value: a,
|
|
152
153
|
onChange: (e) => o(e.target.value),
|
|
153
154
|
placeholder: "Lesson title"
|
|
154
|
-
}), /* @__PURE__ */ J(
|
|
155
|
+
}), /* @__PURE__ */ J(Se, {
|
|
155
156
|
value: s,
|
|
156
157
|
onValueChange: (e) => c(e),
|
|
157
|
-
children: [/* @__PURE__ */ q(
|
|
158
|
+
children: [/* @__PURE__ */ q(Te, {
|
|
158
159
|
"aria-label": "Lesson type",
|
|
159
|
-
children: /* @__PURE__ */ q(
|
|
160
|
-
}), /* @__PURE__ */ q(
|
|
160
|
+
children: /* @__PURE__ */ q(Ee, {})
|
|
161
|
+
}), /* @__PURE__ */ q(Ce, { children: Me.map((e) => /* @__PURE__ */ q(we, {
|
|
161
162
|
value: e,
|
|
162
163
|
children: u(e)
|
|
163
164
|
}, e)) })]
|
|
@@ -168,7 +169,7 @@ function He({ lesson: e, onSaved: t, onCancel: n }) {
|
|
|
168
169
|
value: l,
|
|
169
170
|
onChange: (e) => d(e.target.value)
|
|
170
171
|
}),
|
|
171
|
-
/* @__PURE__ */ q(
|
|
172
|
+
/* @__PURE__ */ q(ie, {
|
|
172
173
|
kind: s,
|
|
173
174
|
draft: x,
|
|
174
175
|
onChange: (e) => {
|
|
@@ -196,7 +197,7 @@ function He({ lesson: e, onSaved: t, onCancel: n }) {
|
|
|
196
197
|
onClick: async () => {
|
|
197
198
|
let i = a.trim();
|
|
198
199
|
if (!i) return v.error("Lesson title is required");
|
|
199
|
-
let o =
|
|
200
|
+
let o = re(s, x);
|
|
200
201
|
if (!o.ok) return v.error(o.error);
|
|
201
202
|
(await r({ variables: {
|
|
202
203
|
id: e.id,
|
|
@@ -217,8 +218,8 @@ function He({ lesson: e, onSaved: t, onCancel: n }) {
|
|
|
217
218
|
]
|
|
218
219
|
});
|
|
219
220
|
}
|
|
220
|
-
function
|
|
221
|
-
let { data: t, loading: n, refetch: r } = k(e), [i, { loading: a }] = T(), [o] = B(), [c, l] =
|
|
221
|
+
function We({ courseId: e }) {
|
|
222
|
+
let { data: t, loading: n, refetch: r } = k(e), [i, { loading: a }] = T(), [o] = B(), [c, l] = H(null), [d, f] = H(null), [p, h] = H(""), [g, _] = H("ARTICLE"), [y, b] = H(""), [x, S] = H(""), [C, w] = H(!1), [ee, E] = H(() => V()), D = [...t?.tecListLessons?.items ?? []].sort((e, t) => e.position - t.position), O = async (e) => {
|
|
222
223
|
f(e.id);
|
|
223
224
|
try {
|
|
224
225
|
let t = await o({ variables: {
|
|
@@ -237,7 +238,7 @@ function Ue({ courseId: e }) {
|
|
|
237
238
|
className: "mb-3 flex items-center gap-2",
|
|
238
239
|
children: [/* @__PURE__ */ q("span", {
|
|
239
240
|
className: "flex h-7 w-7 items-center justify-center rounded-lg bg-accent-primary/15 text-accent-primary ring-1 ring-accent-primary/20",
|
|
240
|
-
children: /* @__PURE__ */ q(
|
|
241
|
+
children: /* @__PURE__ */ q(ue, { size: 15 })
|
|
241
242
|
}), /* @__PURE__ */ J("span", {
|
|
242
243
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
243
244
|
children: [
|
|
@@ -266,7 +267,7 @@ function Ue({ courseId: e }) {
|
|
|
266
267
|
className: "min-w-0 flex-1 truncate",
|
|
267
268
|
children: e.title
|
|
268
269
|
}),
|
|
269
|
-
/* @__PURE__ */ q(
|
|
270
|
+
/* @__PURE__ */ q(be, {
|
|
270
271
|
variant: "secondary",
|
|
271
272
|
className: "text-[11px]",
|
|
272
273
|
children: u(e.kind)
|
|
@@ -289,13 +290,13 @@ function Ue({ courseId: e }) {
|
|
|
289
290
|
variant: "ghost",
|
|
290
291
|
onClick: () => l(c === e.id ? null : e.id),
|
|
291
292
|
children: [
|
|
292
|
-
/* @__PURE__ */ q(
|
|
293
|
+
/* @__PURE__ */ q(de, { size: 13 }),
|
|
293
294
|
" ",
|
|
294
295
|
c === e.id ? "Close" : "Edit"
|
|
295
296
|
]
|
|
296
297
|
})
|
|
297
298
|
]
|
|
298
|
-
}), c === e.id ? /* @__PURE__ */ q(
|
|
299
|
+
}), c === e.id ? /* @__PURE__ */ q(Ue, {
|
|
299
300
|
lesson: e,
|
|
300
301
|
onSaved: async () => {
|
|
301
302
|
await r();
|
|
@@ -310,13 +311,13 @@ function Ue({ courseId: e }) {
|
|
|
310
311
|
placeholder: "Lesson title",
|
|
311
312
|
value: p,
|
|
312
313
|
onChange: (e) => h(e.target.value)
|
|
313
|
-
}), /* @__PURE__ */ J(
|
|
314
|
+
}), /* @__PURE__ */ J(Se, {
|
|
314
315
|
value: g,
|
|
315
316
|
onValueChange: (e) => _(e),
|
|
316
|
-
children: [/* @__PURE__ */ q(
|
|
317
|
+
children: [/* @__PURE__ */ q(Te, {
|
|
317
318
|
"aria-label": "Lesson type",
|
|
318
|
-
children: /* @__PURE__ */ q(
|
|
319
|
-
}), /* @__PURE__ */ q(
|
|
319
|
+
children: /* @__PURE__ */ q(Ee, {})
|
|
320
|
+
}), /* @__PURE__ */ q(Ce, { children: Me.map((e) => /* @__PURE__ */ q(we, {
|
|
320
321
|
value: e,
|
|
321
322
|
children: u(e)
|
|
322
323
|
}, e)) })]
|
|
@@ -328,7 +329,7 @@ function Ue({ courseId: e }) {
|
|
|
328
329
|
value: y,
|
|
329
330
|
onChange: (e) => b(e.target.value)
|
|
330
331
|
}),
|
|
331
|
-
/* @__PURE__ */ q(
|
|
332
|
+
/* @__PURE__ */ q(ie, {
|
|
332
333
|
kind: g,
|
|
333
334
|
draft: ee,
|
|
334
335
|
onChange: E
|
|
@@ -356,7 +357,7 @@ function Ue({ courseId: e }) {
|
|
|
356
357
|
onClick: async () => {
|
|
357
358
|
let t = p.trim();
|
|
358
359
|
if (!t) return v.error("Lesson title is required");
|
|
359
|
-
let n =
|
|
360
|
+
let n = re(g, ee);
|
|
360
361
|
if (!n.ok) return v.error(n.error);
|
|
361
362
|
(await i({ variables: { input: {
|
|
362
363
|
courseId: e,
|
|
@@ -371,15 +372,15 @@ function Ue({ courseId: e }) {
|
|
|
371
372
|
},
|
|
372
373
|
disabled: a,
|
|
373
374
|
className: "ml-auto",
|
|
374
|
-
children: [/* @__PURE__ */ q(
|
|
375
|
+
children: [/* @__PURE__ */ q(pe, { size: 14 }), " Add lesson"]
|
|
375
376
|
})
|
|
376
377
|
]
|
|
377
378
|
})
|
|
378
379
|
]
|
|
379
380
|
});
|
|
380
381
|
}
|
|
381
|
-
function
|
|
382
|
-
let [i, a] =
|
|
382
|
+
function Ge({ submission: e, busy: t, onGrade: n, onRegrade: r }) {
|
|
383
|
+
let [i, a] = H(!1), s = e.verdict !== "PENDING";
|
|
383
384
|
return /* @__PURE__ */ J("div", {
|
|
384
385
|
className: "space-y-3 rounded-lg bg-bg-surface px-3 py-3 text-sm",
|
|
385
386
|
children: [
|
|
@@ -439,11 +440,11 @@ function We({ submission: e, busy: t, onGrade: n, onRegrade: r }) {
|
|
|
439
440
|
variant: "outline",
|
|
440
441
|
onClick: r,
|
|
441
442
|
disabled: t,
|
|
442
|
-
children: [/* @__PURE__ */ q(
|
|
443
|
+
children: [/* @__PURE__ */ q(me, { size: 13 }), " Re-run grader"]
|
|
443
444
|
}) : null,
|
|
444
445
|
/* @__PURE__ */ q("div", {
|
|
445
446
|
className: "ml-auto flex flex-wrap gap-1",
|
|
446
|
-
children:
|
|
447
|
+
children: Ne.map((r) => /* @__PURE__ */ q(Y, {
|
|
447
448
|
size: "sm",
|
|
448
449
|
variant: r === "ACCEPTED" ? "default" : "outline",
|
|
449
450
|
onClick: () => n(r),
|
|
@@ -465,8 +466,8 @@ function We({ submission: e, busy: t, onGrade: n, onRegrade: r }) {
|
|
|
465
466
|
]
|
|
466
467
|
});
|
|
467
468
|
}
|
|
468
|
-
function
|
|
469
|
-
let { data: t, loading: n, refetch: r } = R({ problemId: e }), [i] = E(), [a] = P(), [o, s] =
|
|
469
|
+
function Ke({ problemId: e }) {
|
|
470
|
+
let { data: t, loading: n, refetch: r } = R({ problemId: e }), [i] = E(), [a] = P(), [o, s] = H(null), [c, l] = H(!1), d = t?.tecListSubmissions?.items ?? [], f = c ? d.filter((e) => e.verdict === "PENDING") : d, p = d.filter((e) => e.verdict === "PENDING").length, h = async (e, t) => {
|
|
470
471
|
s(e);
|
|
471
472
|
try {
|
|
472
473
|
(await i({ variables: {
|
|
@@ -492,7 +493,7 @@ function Ge({ problemId: e }) {
|
|
|
492
493
|
children: [
|
|
493
494
|
/* @__PURE__ */ q("span", {
|
|
494
495
|
className: "flex h-7 w-7 items-center justify-center rounded-lg bg-accent-purple/15 text-accent-purple ring-1 ring-accent-purple/20",
|
|
495
|
-
children: /* @__PURE__ */ q(
|
|
496
|
+
children: /* @__PURE__ */ q(le, { size: 15 })
|
|
496
497
|
}),
|
|
497
498
|
/* @__PURE__ */ J("span", {
|
|
498
499
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
@@ -519,7 +520,7 @@ function Ge({ problemId: e }) {
|
|
|
519
520
|
children: c ? "Nothing is waiting on a verdict." : "No submissions yet."
|
|
520
521
|
}) : /* @__PURE__ */ q("div", {
|
|
521
522
|
className: "space-y-2",
|
|
522
|
-
children: f.map((e) => /* @__PURE__ */ q(
|
|
523
|
+
children: f.map((e) => /* @__PURE__ */ q(Ge, {
|
|
523
524
|
submission: e,
|
|
524
525
|
busy: o === e.id,
|
|
525
526
|
onGrade: (t) => void h(e.id, t),
|
|
@@ -528,8 +529,8 @@ function Ge({ problemId: e }) {
|
|
|
528
529
|
})]
|
|
529
530
|
});
|
|
530
531
|
}
|
|
531
|
-
function
|
|
532
|
-
let { data: t, loading: n, refetch: r } = z(e.id), [i] = F(), [a, o] =
|
|
532
|
+
function qe({ hackathon: e }) {
|
|
533
|
+
let { data: t, loading: n, refetch: r } = z(e.id), [i] = F(), [a, o] = H(null), [s, c] = H({}), l = t?.tecListTeams?.items ?? [], u = async (e, t) => {
|
|
533
534
|
let n = Math.max(0, Number(s[e] ?? "0") || 0);
|
|
534
535
|
o(e);
|
|
535
536
|
try {
|
|
@@ -610,7 +611,7 @@ function Ke({ hackathon: e }) {
|
|
|
610
611
|
variant: "outline",
|
|
611
612
|
onClick: () => u(t.id, !0),
|
|
612
613
|
disabled: a === t.id,
|
|
613
|
-
children: [/* @__PURE__ */ q(
|
|
614
|
+
children: [/* @__PURE__ */ q(_e, { size: 14 }), " Winner"]
|
|
614
615
|
})
|
|
615
616
|
]
|
|
616
617
|
}) : /* @__PURE__ */ J("span", {
|
|
@@ -636,7 +637,7 @@ function Ke({ hackathon: e }) {
|
|
|
636
637
|
target: "_blank",
|
|
637
638
|
rel: "noreferrer noopener",
|
|
638
639
|
className: "inline-flex items-center gap-1 text-xs font-medium text-accent-primary hover:underline",
|
|
639
|
-
children: [/* @__PURE__ */ q(
|
|
640
|
+
children: [/* @__PURE__ */ q(ce, { size: 12 }), " Project"]
|
|
640
641
|
}) : null, t.repoUrl ? /* @__PURE__ */ J("a", {
|
|
641
642
|
href: t.repoUrl,
|
|
642
643
|
target: "_blank",
|
|
@@ -654,13 +655,13 @@ function Ke({ hackathon: e }) {
|
|
|
654
655
|
})]
|
|
655
656
|
});
|
|
656
657
|
}
|
|
657
|
-
function
|
|
658
|
-
let { data: e, loading: t, error: n, refetch: r } = S({}), [o, { loading: c }] = C(), [l] = M(), [g] = b(), [_, y] =
|
|
658
|
+
function Je() {
|
|
659
|
+
let { data: e, loading: t, error: n, refetch: r } = S({}), [o, { loading: c }] = C(), [l] = M(), [g] = b(), [_, y] = H(!1), [x, w] = H(null), [T, ee] = H(null), [E, D] = H(""), [O, k] = H(""), [A, te] = H(""), [j, N] = H(""), [P, F] = H("BEGINNER"), [I, L] = H(""), [R, z] = H([]), B = e?.tecListCourses?.items ?? [], ne = () => {
|
|
659
660
|
D(""), k(""), te(""), N(""), F("BEGINNER"), L(""), z([]), y(!1);
|
|
660
|
-
},
|
|
661
|
+
}, V = async () => {
|
|
661
662
|
let e = E.trim();
|
|
662
663
|
if (!e) return v.error("Title is required");
|
|
663
|
-
let t =
|
|
664
|
+
let t = Ie(O || e);
|
|
664
665
|
if (!t) return v.error("A valid slug is required");
|
|
665
666
|
(await o({ variables: { input: {
|
|
666
667
|
title: e,
|
|
@@ -670,16 +671,16 @@ function qe() {
|
|
|
670
671
|
level: P,
|
|
671
672
|
estimatedMinutes: Q(I),
|
|
672
673
|
tags: R
|
|
673
|
-
} } })).data?.tecCreateCourse && (v.success("Course created", `"${e}" saved as a draft.`),
|
|
674
|
-
},
|
|
674
|
+
} } })).data?.tecCreateCourse && (v.success("Course created", `"${e}" saved as a draft.`), ne(), await r());
|
|
675
|
+
}, re = async (e) => {
|
|
675
676
|
w(e);
|
|
676
677
|
try {
|
|
677
678
|
(await l({ variables: { id: e } })).data?.tecPublishCourse && (v.success("Course published"), await r());
|
|
678
679
|
} finally {
|
|
679
680
|
w(null);
|
|
680
681
|
}
|
|
681
|
-
},
|
|
682
|
-
if (await
|
|
682
|
+
}, ie = async (e, t) => {
|
|
683
|
+
if (await je({
|
|
683
684
|
title: "Archive course",
|
|
684
685
|
message: `Archive "${t}"? Learners will no longer be able to enroll.`,
|
|
685
686
|
okButtonTitle: "Archive",
|
|
@@ -696,24 +697,24 @@ function qe() {
|
|
|
696
697
|
return /* @__PURE__ */ J("div", {
|
|
697
698
|
className: "space-y-4",
|
|
698
699
|
children: [
|
|
699
|
-
/* @__PURE__ */ q(
|
|
700
|
+
/* @__PURE__ */ q(Ve, {
|
|
700
701
|
summary: `${B.length} course${B.length === 1 ? "" : "s"}`,
|
|
701
702
|
actionLabel: "New course",
|
|
702
703
|
open: _,
|
|
703
704
|
onToggle: () => y((e) => !e)
|
|
704
705
|
}),
|
|
705
|
-
_ ? /* @__PURE__ */ J(
|
|
706
|
+
_ ? /* @__PURE__ */ J(Be, {
|
|
706
707
|
title: "New course",
|
|
707
708
|
description: "Draft a course, then add lessons and publish when it's ready.",
|
|
708
|
-
icon:
|
|
709
|
+
icon: U,
|
|
709
710
|
footer: /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Y, {
|
|
710
711
|
variant: "outline",
|
|
711
712
|
size: "sm",
|
|
712
|
-
onClick:
|
|
713
|
+
onClick: ne,
|
|
713
714
|
children: "Cancel"
|
|
714
715
|
}), /* @__PURE__ */ q(Y, {
|
|
715
716
|
size: "sm",
|
|
716
|
-
onClick:
|
|
717
|
+
onClick: V,
|
|
717
718
|
disabled: c,
|
|
718
719
|
children: c ? "Creating…" : "Create course"
|
|
719
720
|
})] }),
|
|
@@ -746,10 +747,10 @@ function qe() {
|
|
|
746
747
|
}),
|
|
747
748
|
/* @__PURE__ */ q($, {
|
|
748
749
|
label: "Level",
|
|
749
|
-
children: /* @__PURE__ */ J(
|
|
750
|
+
children: /* @__PURE__ */ J(Se, {
|
|
750
751
|
value: P,
|
|
751
752
|
onValueChange: (e) => F(e),
|
|
752
|
-
children: [/* @__PURE__ */ q(
|
|
753
|
+
children: [/* @__PURE__ */ q(Te, { children: /* @__PURE__ */ q(Ee, {}) }), /* @__PURE__ */ q(Ce, { children: Pe.map((e) => /* @__PURE__ */ q(we, {
|
|
753
754
|
value: e,
|
|
754
755
|
children: u(e)
|
|
755
756
|
}, e)) })]
|
|
@@ -788,13 +789,13 @@ function qe() {
|
|
|
788
789
|
title: "Couldn't load courses",
|
|
789
790
|
error: n
|
|
790
791
|
}) : B.length === 0 ? /* @__PURE__ */ q(f, {
|
|
791
|
-
icon: /* @__PURE__ */ q(
|
|
792
|
+
icon: /* @__PURE__ */ q(U, { size: 26 }),
|
|
792
793
|
title: "No courses yet",
|
|
793
794
|
description: "Create your first course with the button above. TechnoSpam is pre-launch."
|
|
794
795
|
}) : /* @__PURE__ */ q("div", {
|
|
795
796
|
className: "space-y-3",
|
|
796
|
-
children: B.map((e) => /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J(
|
|
797
|
-
leading: /* @__PURE__ */ q(
|
|
797
|
+
children: B.map((e) => /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J(He, {
|
|
798
|
+
leading: /* @__PURE__ */ q(ze, {
|
|
798
799
|
seed: `${e.topic ?? ""} ${e.title}`,
|
|
799
800
|
icon: i(e.topic ?? e.title)
|
|
800
801
|
}),
|
|
@@ -803,20 +804,20 @@ function qe() {
|
|
|
803
804
|
size: "sm",
|
|
804
805
|
variant: "outline",
|
|
805
806
|
onClick: () => ee(T === e.id ? null : e.id),
|
|
806
|
-
children: [/* @__PURE__ */ q(
|
|
807
|
+
children: [/* @__PURE__ */ q(ue, { size: 15 }), " Lessons"]
|
|
807
808
|
}),
|
|
808
809
|
e.status === "DRAFT" ? /* @__PURE__ */ J(Y, {
|
|
809
810
|
size: "sm",
|
|
810
|
-
onClick: () =>
|
|
811
|
+
onClick: () => re(e.id),
|
|
811
812
|
disabled: x === e.id,
|
|
812
|
-
children: [/* @__PURE__ */ q(
|
|
813
|
+
children: [/* @__PURE__ */ q(he, { size: 15 }), " Publish"]
|
|
813
814
|
}) : null,
|
|
814
815
|
e.status === "ARCHIVED" ? null : /* @__PURE__ */ J(Y, {
|
|
815
816
|
size: "sm",
|
|
816
817
|
variant: "outline",
|
|
817
|
-
onClick: () =>
|
|
818
|
+
onClick: () => ie(e.id, e.title),
|
|
818
819
|
disabled: x === e.id,
|
|
819
|
-
children: [/* @__PURE__ */ q(
|
|
820
|
+
children: [/* @__PURE__ */ q(oe, { size: 15 }), " Archive"]
|
|
820
821
|
})
|
|
821
822
|
] }),
|
|
822
823
|
children: [/* @__PURE__ */ J("div", {
|
|
@@ -844,18 +845,18 @@ function qe() {
|
|
|
844
845
|
a(e.updatedAt)
|
|
845
846
|
]
|
|
846
847
|
})]
|
|
847
|
-
}), T === e.id ? /* @__PURE__ */ q(
|
|
848
|
+
}), T === e.id ? /* @__PURE__ */ q(We, { courseId: e.id }) : null] }, e.id))
|
|
848
849
|
})
|
|
849
850
|
]
|
|
850
851
|
});
|
|
851
852
|
}
|
|
852
|
-
function
|
|
853
|
-
let { data: e, loading: t, error: n, refetch: r } = j({}), [a, { loading: o }] = ee(), [s] = N(), [c, l] =
|
|
853
|
+
function Ye() {
|
|
854
|
+
let { data: e, loading: t, error: n, refetch: r } = j({}), [a, { loading: o }] = ee(), [s] = N(), [c, l] = H(!1), [h, g] = H(null), [_, y] = H(null), [b, x] = H(""), [S, C] = H(""), [w, T] = H(""), [E, D] = H(""), [O, k] = H("EASY"), [A, te] = H(""), [M, P] = H(""), [F, I] = H(""), L = e?.tecListProblems?.items ?? [], R = () => {
|
|
854
855
|
x(""), C(""), T(""), D(""), k("EASY"), te(""), P(""), I(""), l(!1);
|
|
855
856
|
}, z = async () => {
|
|
856
857
|
let e = b.trim();
|
|
857
858
|
if (!e) return v.error("Title is required");
|
|
858
|
-
let t =
|
|
859
|
+
let t = Ie(S || e);
|
|
859
860
|
if (!t) return v.error("A valid slug is required");
|
|
860
861
|
(await a({ variables: { input: {
|
|
861
862
|
title: e,
|
|
@@ -864,7 +865,7 @@ function Je() {
|
|
|
864
865
|
topic: E.trim() || void 0,
|
|
865
866
|
difficulty: O,
|
|
866
867
|
points: Q(A),
|
|
867
|
-
languages:
|
|
868
|
+
languages: Le(M),
|
|
868
869
|
starterCode: F.trim() || void 0
|
|
869
870
|
} } })).data?.tecCreateProblem && (v.success("Problem created", `"${e}" saved as a draft.`), R(), await r());
|
|
870
871
|
}, B = async (e) => {
|
|
@@ -878,13 +879,13 @@ function Je() {
|
|
|
878
879
|
return /* @__PURE__ */ J("div", {
|
|
879
880
|
className: "space-y-4",
|
|
880
881
|
children: [
|
|
881
|
-
/* @__PURE__ */ q(
|
|
882
|
+
/* @__PURE__ */ q(Ve, {
|
|
882
883
|
summary: `${L.length} problem${L.length === 1 ? "" : "s"}`,
|
|
883
884
|
actionLabel: "New problem",
|
|
884
885
|
open: c,
|
|
885
886
|
onToggle: () => l((e) => !e)
|
|
886
887
|
}),
|
|
887
|
-
c ? /* @__PURE__ */ J(
|
|
888
|
+
c ? /* @__PURE__ */ J(Be, {
|
|
888
889
|
title: "New problem",
|
|
889
890
|
description: "Define a coding challenge learners can solve and submit.",
|
|
890
891
|
icon: W,
|
|
@@ -928,10 +929,10 @@ function Je() {
|
|
|
928
929
|
}),
|
|
929
930
|
/* @__PURE__ */ q($, {
|
|
930
931
|
label: "Difficulty",
|
|
931
|
-
children: /* @__PURE__ */ J(
|
|
932
|
+
children: /* @__PURE__ */ J(Se, {
|
|
932
933
|
value: O,
|
|
933
934
|
onValueChange: (e) => k(e),
|
|
934
|
-
children: [/* @__PURE__ */ q(
|
|
935
|
+
children: [/* @__PURE__ */ q(Te, { children: /* @__PURE__ */ q(Ee, {}) }), /* @__PURE__ */ q(Ce, { children: Fe.map((e) => /* @__PURE__ */ q(we, {
|
|
935
936
|
value: e,
|
|
936
937
|
children: u(e)
|
|
937
938
|
}, e)) })]
|
|
@@ -985,8 +986,8 @@ function Je() {
|
|
|
985
986
|
description: "Create your first coding problem with the button above. TechnoSpam is pre-launch."
|
|
986
987
|
}) : /* @__PURE__ */ q("div", {
|
|
987
988
|
className: "space-y-3",
|
|
988
|
-
children: L.map((e) => /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J(
|
|
989
|
-
leading: /* @__PURE__ */ q(
|
|
989
|
+
children: L.map((e) => /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J(He, {
|
|
990
|
+
leading: /* @__PURE__ */ q(ze, {
|
|
990
991
|
seed: `${e.topic ?? ""} ${e.title}`,
|
|
991
992
|
icon: i(e.topic ?? e.title)
|
|
992
993
|
}),
|
|
@@ -994,12 +995,12 @@ function Je() {
|
|
|
994
995
|
size: "sm",
|
|
995
996
|
variant: "outline",
|
|
996
997
|
onClick: () => y(_ === e.id ? null : e.id),
|
|
997
|
-
children: [/* @__PURE__ */ q(
|
|
998
|
+
children: [/* @__PURE__ */ q(le, { size: 15 }), " Grade"]
|
|
998
999
|
}), e.status === "DRAFT" ? /* @__PURE__ */ J(Y, {
|
|
999
1000
|
size: "sm",
|
|
1000
1001
|
onClick: () => B(e.id),
|
|
1001
1002
|
disabled: h === e.id,
|
|
1002
|
-
children: [/* @__PURE__ */ q(
|
|
1003
|
+
children: [/* @__PURE__ */ q(he, { size: 15 }), " Publish"]
|
|
1003
1004
|
}) : null] }),
|
|
1004
1005
|
children: [/* @__PURE__ */ J("div", {
|
|
1005
1006
|
className: "flex flex-wrap items-center gap-2",
|
|
@@ -1027,20 +1028,20 @@ function Je() {
|
|
|
1027
1028
|
e.languages.length ? e.languages.join(", ") : "No languages"
|
|
1028
1029
|
]
|
|
1029
1030
|
})]
|
|
1030
|
-
}), _ === e.id ? /* @__PURE__ */ q(
|
|
1031
|
+
}), _ === e.id ? /* @__PURE__ */ q(Ke, { problemId: e.id }) : null] }, e.id))
|
|
1031
1032
|
})
|
|
1032
1033
|
]
|
|
1033
1034
|
});
|
|
1034
1035
|
}
|
|
1035
|
-
function
|
|
1036
|
-
let { data: e, loading: t, error: n, refetch: r } = D({}), [a, { loading: s }] = w(), [l] = te(), [u] = I(), [g] = L(), [_] = x(), [y, b] =
|
|
1037
|
-
O(""), A(""), M(""), P(""), R(""), B(""),
|
|
1038
|
-
},
|
|
1036
|
+
function Xe() {
|
|
1037
|
+
let { data: e, loading: t, error: n, refetch: r } = D({}), [a, { loading: s }] = w(), [l] = te(), [u] = I(), [g] = L(), [_] = x(), [y, b] = H(!1), [S, C] = H(null), [T, ee] = H(null), [E, O] = H(""), [k, A] = H(""), [j, M] = H(""), [N, P] = H(""), [F, R] = H(""), [z, B] = H(""), [ne, V] = H(""), [re, ie] = H(""), [ae, oe] = H([]), U = e?.tecListHackathons?.items ?? [], W = () => {
|
|
1038
|
+
O(""), A(""), M(""), P(""), R(""), B(""), V(""), ie(""), oe([]), b(!1);
|
|
1039
|
+
}, ce = async () => {
|
|
1039
1040
|
let e = E.trim();
|
|
1040
1041
|
if (!e) return v.error("Title is required");
|
|
1041
|
-
let t =
|
|
1042
|
+
let t = Ie(k || e);
|
|
1042
1043
|
if (!t) return v.error("A valid slug is required");
|
|
1043
|
-
let n =
|
|
1044
|
+
let n = Re(F), i = Re(z);
|
|
1044
1045
|
if (!n || !i) return v.error("Start and end date/time are required");
|
|
1045
1046
|
if (new Date(i) <= new Date(n)) return v.error("End must be after the start");
|
|
1046
1047
|
(await a({ variables: { input: {
|
|
@@ -1050,10 +1051,10 @@ function Ye() {
|
|
|
1050
1051
|
description: N.trim() || void 0,
|
|
1051
1052
|
startAt: n,
|
|
1052
1053
|
endAt: i,
|
|
1053
|
-
prizePool: Q(
|
|
1054
|
-
maxTeamSize: Q(
|
|
1055
|
-
tags:
|
|
1056
|
-
} } })).data?.tecCreateHackathon && (v.success("Hackathon created", `"${e}" saved as a draft.`),
|
|
1054
|
+
prizePool: Q(ne),
|
|
1055
|
+
maxTeamSize: Q(re),
|
|
1056
|
+
tags: ae
|
|
1057
|
+
} } })).data?.tecCreateHackathon && (v.success("Hackathon created", `"${e}" saved as a draft.`), W(), await r());
|
|
1057
1058
|
}, ue = async (e) => {
|
|
1058
1059
|
C(e);
|
|
1059
1060
|
try {
|
|
@@ -1061,7 +1062,7 @@ function Ye() {
|
|
|
1061
1062
|
} finally {
|
|
1062
1063
|
C(null);
|
|
1063
1064
|
}
|
|
1064
|
-
},
|
|
1065
|
+
}, de = async (e, t, n) => {
|
|
1065
1066
|
C(e);
|
|
1066
1067
|
try {
|
|
1067
1068
|
(await t({ variables: { id: e } })).data && (v.success(n), await r());
|
|
@@ -1072,24 +1073,24 @@ function Ye() {
|
|
|
1072
1073
|
return /* @__PURE__ */ J("div", {
|
|
1073
1074
|
className: "space-y-4",
|
|
1074
1075
|
children: [
|
|
1075
|
-
/* @__PURE__ */ q(
|
|
1076
|
-
summary: `${
|
|
1076
|
+
/* @__PURE__ */ q(Ve, {
|
|
1077
|
+
summary: `${U.length} hackathon${U.length === 1 ? "" : "s"}`,
|
|
1077
1078
|
actionLabel: "New hackathon",
|
|
1078
1079
|
open: y,
|
|
1079
1080
|
onToggle: () => b((e) => !e)
|
|
1080
1081
|
}),
|
|
1081
|
-
y ? /* @__PURE__ */ J(
|
|
1082
|
+
y ? /* @__PURE__ */ J(Be, {
|
|
1082
1083
|
title: "New hackathon",
|
|
1083
1084
|
description: "Set up an event, open registration, then run judging to completion.",
|
|
1084
|
-
icon:
|
|
1085
|
+
icon: _e,
|
|
1085
1086
|
footer: /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Y, {
|
|
1086
1087
|
variant: "outline",
|
|
1087
1088
|
size: "sm",
|
|
1088
|
-
onClick:
|
|
1089
|
+
onClick: W,
|
|
1089
1090
|
children: "Cancel"
|
|
1090
1091
|
}), /* @__PURE__ */ q(Y, {
|
|
1091
1092
|
size: "sm",
|
|
1092
|
-
onClick:
|
|
1093
|
+
onClick: ce,
|
|
1093
1094
|
disabled: s,
|
|
1094
1095
|
children: s ? "Creating…" : "Create hackathon"
|
|
1095
1096
|
})] }),
|
|
@@ -1123,7 +1124,7 @@ function Ye() {
|
|
|
1123
1124
|
/* @__PURE__ */ q($, {
|
|
1124
1125
|
label: "Tags",
|
|
1125
1126
|
children: /* @__PURE__ */ q(h, {
|
|
1126
|
-
value:
|
|
1127
|
+
value: ae,
|
|
1127
1128
|
onChange: oe,
|
|
1128
1129
|
placeholder: "ai, web"
|
|
1129
1130
|
})
|
|
@@ -1151,8 +1152,8 @@ function Ye() {
|
|
|
1151
1152
|
children: /* @__PURE__ */ q(X, {
|
|
1152
1153
|
type: "number",
|
|
1153
1154
|
min: 0,
|
|
1154
|
-
value:
|
|
1155
|
-
onChange: (e) =>
|
|
1155
|
+
value: ne,
|
|
1156
|
+
onChange: (e) => V(e.target.value),
|
|
1156
1157
|
placeholder: "5000"
|
|
1157
1158
|
})
|
|
1158
1159
|
}),
|
|
@@ -1161,8 +1162,8 @@ function Ye() {
|
|
|
1161
1162
|
children: /* @__PURE__ */ q(X, {
|
|
1162
1163
|
type: "number",
|
|
1163
1164
|
min: 1,
|
|
1164
|
-
value:
|
|
1165
|
-
onChange: (e) =>
|
|
1165
|
+
value: re,
|
|
1166
|
+
onChange: (e) => ie(e.target.value),
|
|
1166
1167
|
placeholder: "4"
|
|
1167
1168
|
})
|
|
1168
1169
|
}),
|
|
@@ -1177,19 +1178,19 @@ function Ye() {
|
|
|
1177
1178
|
})
|
|
1178
1179
|
]
|
|
1179
1180
|
}) : null,
|
|
1180
|
-
t && !
|
|
1181
|
+
t && !U.length ? /* @__PURE__ */ q(m, { count: 4 }) : n ? /* @__PURE__ */ q(p, {
|
|
1181
1182
|
title: "Couldn't load hackathons",
|
|
1182
1183
|
error: n
|
|
1183
|
-
}) :
|
|
1184
|
-
icon: /* @__PURE__ */ q(
|
|
1184
|
+
}) : U.length === 0 ? /* @__PURE__ */ q(f, {
|
|
1185
|
+
icon: /* @__PURE__ */ q(_e, { size: 26 }),
|
|
1185
1186
|
title: "No hackathons yet",
|
|
1186
1187
|
description: "Create your first hackathon with the button above. TechnoSpam is pre-launch."
|
|
1187
1188
|
}) : /* @__PURE__ */ q("div", {
|
|
1188
1189
|
className: "space-y-3",
|
|
1189
|
-
children:
|
|
1190
|
-
leading: /* @__PURE__ */ q(
|
|
1190
|
+
children: U.map((e) => /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J(He, {
|
|
1191
|
+
leading: /* @__PURE__ */ q(ze, {
|
|
1191
1192
|
seed: e.title,
|
|
1192
|
-
icon: i(e.title,
|
|
1193
|
+
icon: i(e.title, _e)
|
|
1193
1194
|
}),
|
|
1194
1195
|
actions: /* @__PURE__ */ J(K, { children: [
|
|
1195
1196
|
/* @__PURE__ */ J(Y, {
|
|
@@ -1202,25 +1203,25 @@ function Ye() {
|
|
|
1202
1203
|
size: "sm",
|
|
1203
1204
|
onClick: () => ue(e.id),
|
|
1204
1205
|
disabled: S === e.id,
|
|
1205
|
-
children: [/* @__PURE__ */ q(
|
|
1206
|
+
children: [/* @__PURE__ */ q(he, { size: 15 }), " Open registration"]
|
|
1206
1207
|
}) : null,
|
|
1207
1208
|
e.status === "REGISTRATION_OPEN" ? /* @__PURE__ */ J(Y, {
|
|
1208
1209
|
size: "sm",
|
|
1209
|
-
onClick: () =>
|
|
1210
|
+
onClick: () => de(e.id, u, "Hackathon started"),
|
|
1210
1211
|
disabled: S === e.id,
|
|
1211
|
-
children: [/* @__PURE__ */ q(
|
|
1212
|
+
children: [/* @__PURE__ */ q(fe, { size: 15 }), " Start"]
|
|
1212
1213
|
}) : null,
|
|
1213
1214
|
e.status === "IN_PROGRESS" ? /* @__PURE__ */ J(Y, {
|
|
1214
1215
|
size: "sm",
|
|
1215
|
-
onClick: () =>
|
|
1216
|
+
onClick: () => de(e.id, g, "Judging started"),
|
|
1216
1217
|
disabled: S === e.id,
|
|
1217
|
-
children: [/* @__PURE__ */ q(
|
|
1218
|
+
children: [/* @__PURE__ */ q(le, { size: 15 }), " Start judging"]
|
|
1218
1219
|
}) : null,
|
|
1219
1220
|
e.status === "JUDGING" ? /* @__PURE__ */ J(Y, {
|
|
1220
1221
|
size: "sm",
|
|
1221
|
-
onClick: () =>
|
|
1222
|
+
onClick: () => de(e.id, _, "Hackathon completed"),
|
|
1222
1223
|
disabled: S === e.id,
|
|
1223
|
-
children: [/* @__PURE__ */ q(
|
|
1224
|
+
children: [/* @__PURE__ */ q(se, { size: 15 }), " Complete"]
|
|
1224
1225
|
}) : null
|
|
1225
1226
|
] }),
|
|
1226
1227
|
children: [/* @__PURE__ */ J("div", {
|
|
@@ -1240,13 +1241,13 @@ function Ye() {
|
|
|
1240
1241
|
e.prizePool ? ` · ${c(e.prizePool, e.currency)} prize` : ""
|
|
1241
1242
|
]
|
|
1242
1243
|
})]
|
|
1243
|
-
}), T === e.id ? /* @__PURE__ */ q(
|
|
1244
|
+
}), T === e.id ? /* @__PURE__ */ q(qe, { hackathon: e }) : null] }, e.id))
|
|
1244
1245
|
})
|
|
1245
1246
|
]
|
|
1246
1247
|
});
|
|
1247
1248
|
}
|
|
1248
|
-
function
|
|
1249
|
-
let { data: e, loading: t, error: n, refetch: r } = A({}), [a] = y(), [o, s] =
|
|
1249
|
+
function Ze() {
|
|
1250
|
+
let { data: e, loading: t, error: n, refetch: r } = A({}), [a] = y(), [o, s] = H(null), c = e?.tecListMentors?.items ?? [], u = c.filter((e) => e.status === "PENDING").length, h = async (e) => {
|
|
1250
1251
|
s(e);
|
|
1251
1252
|
try {
|
|
1252
1253
|
(await a({ variables: { id: e } })).data?.tecApproveMentor && (v.success("Mentor approved", "They can now accept mentees."), await r());
|
|
@@ -1256,7 +1257,7 @@ function Xe() {
|
|
|
1256
1257
|
};
|
|
1257
1258
|
return /* @__PURE__ */ J("div", {
|
|
1258
1259
|
className: "space-y-4",
|
|
1259
|
-
children: [/* @__PURE__ */ q(
|
|
1260
|
+
children: [/* @__PURE__ */ q(Ve, { summary: `${c.length} mentor${c.length === 1 ? "" : "s"}${u ? ` · ${u} pending approval` : ""}` }), t && !c.length ? /* @__PURE__ */ q(m, { count: 4 }) : n ? /* @__PURE__ */ q(p, {
|
|
1260
1261
|
title: "Couldn't load mentors",
|
|
1261
1262
|
error: n
|
|
1262
1263
|
}) : c.length === 0 ? /* @__PURE__ */ q(f, {
|
|
@@ -1265,8 +1266,8 @@ function Xe() {
|
|
|
1265
1266
|
description: "Mentor applications will appear here for review. TechnoSpam is pre-launch."
|
|
1266
1267
|
}) : /* @__PURE__ */ q("div", {
|
|
1267
1268
|
className: "space-y-3",
|
|
1268
|
-
children: c.map((e) => /* @__PURE__ */ J(
|
|
1269
|
-
leading: /* @__PURE__ */ q(
|
|
1269
|
+
children: c.map((e) => /* @__PURE__ */ J(He, {
|
|
1270
|
+
leading: /* @__PURE__ */ q(ze, {
|
|
1270
1271
|
seed: e.headline,
|
|
1271
1272
|
icon: i(e.expertise[0] ?? e.headline, G)
|
|
1272
1273
|
}),
|
|
@@ -1274,7 +1275,7 @@ function Xe() {
|
|
|
1274
1275
|
size: "sm",
|
|
1275
1276
|
onClick: () => h(e.id),
|
|
1276
1277
|
disabled: o === e.id,
|
|
1277
|
-
children: [/* @__PURE__ */ q(
|
|
1278
|
+
children: [/* @__PURE__ */ q(ve, { size: 15 }), " Approve"]
|
|
1278
1279
|
}) : void 0,
|
|
1279
1280
|
children: [/* @__PURE__ */ J("div", {
|
|
1280
1281
|
className: "flex flex-wrap items-center gap-2",
|
|
@@ -1284,7 +1285,7 @@ function Xe() {
|
|
|
1284
1285
|
children: e.headline
|
|
1285
1286
|
}),
|
|
1286
1287
|
/* @__PURE__ */ q(d, { status: e.status }),
|
|
1287
|
-
e.isAcceptingMentees ? /* @__PURE__ */ q(
|
|
1288
|
+
e.isAcceptingMentees ? /* @__PURE__ */ q(be, {
|
|
1288
1289
|
variant: "secondary",
|
|
1289
1290
|
className: "text-[11px]",
|
|
1290
1291
|
children: "Accepting mentees"
|
|
@@ -1307,15 +1308,15 @@ function Xe() {
|
|
|
1307
1308
|
})]
|
|
1308
1309
|
});
|
|
1309
1310
|
}
|
|
1310
|
-
function
|
|
1311
|
-
let [t, r] =
|
|
1311
|
+
function Qe() {
|
|
1312
|
+
let [t, r] = H("courses"), { currentUser: i } = e(), a = (i?.role ?? "").toLowerCase();
|
|
1312
1313
|
return /* @__PURE__ */ J(n, {
|
|
1313
1314
|
hero: !0,
|
|
1314
1315
|
title: "Authoring Console",
|
|
1315
1316
|
description: "Create and manage TechnoSpam content — courses, problems, hackathons, and mentor applications.",
|
|
1316
|
-
children: [a.includes("admin") || a.includes("owner") || a.includes("instructor") ? null : /* @__PURE__ */ J(
|
|
1317
|
+
children: [a.includes("admin") || a.includes("owner") || a.includes("instructor") ? null : /* @__PURE__ */ J(xe, {
|
|
1317
1318
|
className: "mb-5 flex items-start gap-3 border-status-warning-border p-4",
|
|
1318
|
-
children: [/* @__PURE__ */ q(
|
|
1319
|
+
children: [/* @__PURE__ */ q(ge, {
|
|
1319
1320
|
size: 18,
|
|
1320
1321
|
className: "mt-0.5 shrink-0 text-status-warning-text"
|
|
1321
1322
|
}), /* @__PURE__ */ J("div", {
|
|
@@ -1329,38 +1330,39 @@ function Ze() {
|
|
|
1329
1330
|
"You can review content here, but create/publish actions require the right permission and will be rejected at the gateway otherwise."
|
|
1330
1331
|
]
|
|
1331
1332
|
})]
|
|
1332
|
-
}), /* @__PURE__ */ J(
|
|
1333
|
+
}), /* @__PURE__ */ J(De, {
|
|
1333
1334
|
className: "gap-0",
|
|
1334
1335
|
value: t,
|
|
1335
1336
|
onValueChange: (e) => r(e),
|
|
1336
|
-
children: [/* @__PURE__ */ J(
|
|
1337
|
+
children: [/* @__PURE__ */ J(ke, {
|
|
1337
1338
|
className: "mb-5",
|
|
1338
1339
|
children: [
|
|
1339
|
-
/* @__PURE__ */ J(
|
|
1340
|
+
/* @__PURE__ */ J(Ae, {
|
|
1340
1341
|
value: "courses",
|
|
1341
|
-
children: [/* @__PURE__ */ q(
|
|
1342
|
+
children: [/* @__PURE__ */ q(U, { size: 15 }), " Courses"]
|
|
1342
1343
|
}),
|
|
1343
|
-
/* @__PURE__ */ J(
|
|
1344
|
+
/* @__PURE__ */ J(Ae, {
|
|
1344
1345
|
value: "problems",
|
|
1345
1346
|
children: [/* @__PURE__ */ q(W, { size: 15 }), " Problems"]
|
|
1346
1347
|
}),
|
|
1347
|
-
/* @__PURE__ */ J(
|
|
1348
|
+
/* @__PURE__ */ J(Ae, {
|
|
1348
1349
|
value: "hackathons",
|
|
1349
|
-
children: [/* @__PURE__ */ q(
|
|
1350
|
+
children: [/* @__PURE__ */ q(_e, { size: 15 }), " Hackathons"]
|
|
1350
1351
|
}),
|
|
1351
|
-
/* @__PURE__ */ J(
|
|
1352
|
+
/* @__PURE__ */ J(Ae, {
|
|
1352
1353
|
value: "mentors",
|
|
1353
1354
|
children: [/* @__PURE__ */ q(G, { size: 15 }), " Mentors"]
|
|
1354
1355
|
})
|
|
1355
1356
|
]
|
|
1356
|
-
}), /* @__PURE__ */ q(
|
|
1357
|
+
}), /* @__PURE__ */ q(Oe, {
|
|
1357
1358
|
value: t,
|
|
1358
|
-
|
|
1359
|
+
className: ne,
|
|
1360
|
+
children: q(t === "courses" ? Je : t === "problems" ? Ye : t === "hackathons" ? Xe : Ze, {})
|
|
1359
1361
|
})]
|
|
1360
1362
|
})]
|
|
1361
1363
|
});
|
|
1362
1364
|
}
|
|
1363
1365
|
//#endregion
|
|
1364
|
-
export {
|
|
1366
|
+
export { Qe as AdminAdminDashboardPagePage };
|
|
1365
1367
|
|
|
1366
1368
|
//# sourceMappingURL=AdminAdminDashboardPagePage.js.map
|