@burdenoff/microfe-technospam 2026.1031.5 → 2026.1031.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.
- package/dist/technospam/api/technospamApi.d.ts +56 -0
- package/dist/technospam/api/technospamApi.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.js +298 -231
- package/dist/technospam/api/technospamApi.js.map +1 -1
- package/dist/technospam/components/StatusBadge.d.ts.map +1 -1
- package/dist/technospam/components/StatusBadge.js +2 -0
- package/dist/technospam/components/StatusBadge.js.map +1 -1
- package/dist/technospam/components/admin/EnterpriseIntegrationsTab.d.ts +6 -0
- package/dist/technospam/components/admin/EnterpriseIntegrationsTab.d.ts.map +1 -0
- package/dist/technospam/components/admin/EnterpriseIntegrationsTab.js +256 -0
- package/dist/technospam/components/admin/EnterpriseIntegrationsTab.js.map +1 -0
- package/dist/technospam/lib/enterprise.d.ts +21 -0
- package/dist/technospam/lib/enterprise.d.ts.map +1 -0
- package/dist/technospam/lib/enterprise.js +36 -0
- package/dist/technospam/lib/enterprise.js.map +1 -0
- package/dist/technospam/pages/AdminAdminDashboardPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/AdminAdminDashboardPagePage.js +206 -201
- package/dist/technospam/pages/AdminAdminDashboardPagePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,50 +8,51 @@ import { EmptyView as f, ErrorView as p, LoadingRows as m } from "../components/
|
|
|
8
8
|
import { TagInput as h } from "../components/TagInput.js";
|
|
9
9
|
import { CodePanel as g, TestResultsPanel as _ } from "../components/SubmissionViews.js";
|
|
10
10
|
import { notify as v } from "../lib/toast.js";
|
|
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
|
|
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 ne, usePublishCourse as j, usePublishProblem as M, useRegradeSubmission as N, useScoreTeam as P, useStartHackathon as re, useStartJudging as F, useSubmissionsQuery as I, useTeamsQuery as L, useUpdateLesson as R } from "../api/technospamApi.js";
|
|
12
12
|
import "../components/index.js";
|
|
13
|
-
import { TAB_PANEL_FOCUS_CLASS as
|
|
14
|
-
import { draftFromLesson as
|
|
15
|
-
import { LessonKindFields as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
13
|
+
import { TAB_PANEL_FOCUS_CLASS as ie } from "../lib/a11y.js";
|
|
14
|
+
import { draftFromLesson as z, draftToInput as ae } from "../components/lesson/lessonAuthoring.js";
|
|
15
|
+
import { LessonKindFields as oe } from "../components/lesson/LessonKindFields.js";
|
|
16
|
+
import { EnterpriseIntegrationsTab as se } from "../components/admin/EnterpriseIntegrationsTab.js";
|
|
17
|
+
import { useMemo as ce, useState as B } from "react";
|
|
18
|
+
import { Archive as V, Award as le, BookOpen as H, Code2 as U, ExternalLink as ue, Gavel as de, ListChecks as W, Pencil as fe, Play as pe, PlugZap as me, Plus as he, RefreshCw as ge, Rocket as _e, ShieldAlert as ve, Trophy as ye, UserCheck as be, Users as G, X as xe } from "lucide-react";
|
|
18
19
|
import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
19
|
-
import { Badge as
|
|
20
|
-
import { nativeConfirm as
|
|
20
|
+
import { Badge as Se, Button as Y, GlassCard as Ce, Input as X, Select as we, SelectContent as Te, SelectItem as Ee, SelectTrigger as De, SelectValue as Oe, Tabs as ke, TabsContent as Ae, TabsList as je, TabsTrigger as Me, Textarea as Z } from "@burdenoff/fe-libs/ui";
|
|
21
|
+
import { nativeConfirm as Ne } from "@burdenoff/fe-libs/shared/native";
|
|
21
22
|
//#region src/technospam/pages/AdminAdminDashboardPagePage.tsx
|
|
22
|
-
var
|
|
23
|
+
var Pe = [
|
|
23
24
|
"ARTICLE",
|
|
24
25
|
"VIDEO",
|
|
25
26
|
"INTERACTIVE",
|
|
26
27
|
"QUIZ",
|
|
27
28
|
"PROJECT"
|
|
28
|
-
],
|
|
29
|
+
], Fe = [
|
|
29
30
|
"ACCEPTED",
|
|
30
31
|
"WRONG_ANSWER",
|
|
31
32
|
"TIME_LIMIT_EXCEEDED",
|
|
32
33
|
"RUNTIME_ERROR",
|
|
33
34
|
"COMPILE_ERROR"
|
|
34
|
-
],
|
|
35
|
+
], Ie = [
|
|
35
36
|
"BEGINNER",
|
|
36
37
|
"INTERMEDIATE",
|
|
37
38
|
"ADVANCED",
|
|
38
39
|
"EXPERT"
|
|
39
|
-
],
|
|
40
|
+
], Le = [
|
|
40
41
|
"EASY",
|
|
41
42
|
"MEDIUM",
|
|
42
43
|
"HARD"
|
|
43
44
|
];
|
|
44
|
-
function
|
|
45
|
+
function Re(e) {
|
|
45
46
|
return e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function ze(e) {
|
|
48
49
|
return e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
49
50
|
}
|
|
50
51
|
function Q(e) {
|
|
51
52
|
let t = Number.parseInt(e, 10);
|
|
52
53
|
return Number.isFinite(t) ? t : void 0;
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function Be(e) {
|
|
55
56
|
if (!e) return null;
|
|
56
57
|
let t = new Date(e);
|
|
57
58
|
return Number.isNaN(t.getTime()) ? null : t.toISOString();
|
|
@@ -68,7 +69,7 @@ function $({ label: e, required: t, className: n, children: r }) {
|
|
|
68
69
|
}), r]
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
+
function Ve({ seed: e, icon: n }) {
|
|
72
73
|
return /* @__PURE__ */ q("span", {
|
|
73
74
|
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)),
|
|
74
75
|
children: /* @__PURE__ */ q(n, {
|
|
@@ -77,8 +78,8 @@ function ze({ seed: e, icon: n }) {
|
|
|
77
78
|
})
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
-
return /* @__PURE__ */ J(
|
|
81
|
+
function He({ title: e, description: t, icon: n, children: r, footer: i }) {
|
|
82
|
+
return /* @__PURE__ */ J(Ce, {
|
|
82
83
|
className: "space-y-4 p-4 sm:p-5",
|
|
83
84
|
children: [
|
|
84
85
|
/* @__PURE__ */ J("div", {
|
|
@@ -108,7 +109,7 @@ function Be({ title: e, description: t, icon: n, children: r, footer: i }) {
|
|
|
108
109
|
]
|
|
109
110
|
});
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
+
function Ue({ summary: e, actionLabel: t, open: n, onToggle: r }) {
|
|
112
113
|
return /* @__PURE__ */ J("div", {
|
|
113
114
|
className: "flex items-center justify-between gap-3",
|
|
114
115
|
children: [/* @__PURE__ */ q("p", {
|
|
@@ -118,12 +119,12 @@ function Ve({ summary: e, actionLabel: t, open: n, onToggle: r }) {
|
|
|
118
119
|
size: "sm",
|
|
119
120
|
variant: n ? "outline" : "default",
|
|
120
121
|
onClick: r,
|
|
121
|
-
children: [q(n ?
|
|
122
|
+
children: [q(n ? xe : he, { size: 15 }), n ? "Close" : t]
|
|
122
123
|
}) : null]
|
|
123
124
|
});
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
-
return /* @__PURE__ */ J(
|
|
126
|
+
function We({ leading: e, children: t, actions: n }) {
|
|
127
|
+
return /* @__PURE__ */ J(Ce, {
|
|
127
128
|
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",
|
|
128
129
|
children: [/* @__PURE__ */ J("div", {
|
|
129
130
|
className: "flex min-w-0 items-center gap-3",
|
|
@@ -137,8 +138,8 @@ function He({ leading: e, children: t, actions: n }) {
|
|
|
137
138
|
}) : null]
|
|
138
139
|
});
|
|
139
140
|
}
|
|
140
|
-
function
|
|
141
|
-
let [r, { loading: i }] =
|
|
141
|
+
function Ge({ lesson: e, onSaved: t, onCancel: n }) {
|
|
142
|
+
let [r, { loading: i }] = R(), [a, o] = B(e.title), [s, c] = B(e.kind), [l, d] = B(e.content ?? ""), [f, p] = B(String(e.estimatedMinutes ?? "")), [m, h] = B(() => z(e)), { data: g } = O(e.id, s !== "QUIZ"), [_, y] = B(null), b = ce(() => z(null, g?.tecLessonQuizKey).quiz, [g]), x = {
|
|
142
143
|
...m,
|
|
143
144
|
quiz: _ ?? b
|
|
144
145
|
};
|
|
@@ -152,13 +153,13 @@ function Ue({ lesson: e, onSaved: t, onCancel: n }) {
|
|
|
152
153
|
value: a,
|
|
153
154
|
onChange: (e) => o(e.target.value),
|
|
154
155
|
placeholder: "Lesson title"
|
|
155
|
-
}), /* @__PURE__ */ J(
|
|
156
|
+
}), /* @__PURE__ */ J(we, {
|
|
156
157
|
value: s,
|
|
157
158
|
onValueChange: (e) => c(e),
|
|
158
|
-
children: [/* @__PURE__ */ q(
|
|
159
|
+
children: [/* @__PURE__ */ q(De, {
|
|
159
160
|
"aria-label": "Lesson type",
|
|
160
|
-
children: /* @__PURE__ */ q(
|
|
161
|
-
}), /* @__PURE__ */ q(
|
|
161
|
+
children: /* @__PURE__ */ q(Oe, {})
|
|
162
|
+
}), /* @__PURE__ */ q(Te, { children: Pe.map((e) => /* @__PURE__ */ q(Ee, {
|
|
162
163
|
value: e,
|
|
163
164
|
children: u(e)
|
|
164
165
|
}, e)) })]
|
|
@@ -169,7 +170,7 @@ function Ue({ lesson: e, onSaved: t, onCancel: n }) {
|
|
|
169
170
|
value: l,
|
|
170
171
|
onChange: (e) => d(e.target.value)
|
|
171
172
|
}),
|
|
172
|
-
/* @__PURE__ */ q(
|
|
173
|
+
/* @__PURE__ */ q(oe, {
|
|
173
174
|
kind: s,
|
|
174
175
|
draft: x,
|
|
175
176
|
onChange: (e) => {
|
|
@@ -197,7 +198,7 @@ function Ue({ lesson: e, onSaved: t, onCancel: n }) {
|
|
|
197
198
|
onClick: async () => {
|
|
198
199
|
let i = a.trim();
|
|
199
200
|
if (!i) return v.error("Lesson title is required");
|
|
200
|
-
let o =
|
|
201
|
+
let o = ae(s, x);
|
|
201
202
|
if (!o.ok) return v.error(o.error);
|
|
202
203
|
(await r({ variables: {
|
|
203
204
|
id: e.id,
|
|
@@ -218,8 +219,8 @@ function Ue({ lesson: e, onSaved: t, onCancel: n }) {
|
|
|
218
219
|
]
|
|
219
220
|
});
|
|
220
221
|
}
|
|
221
|
-
function
|
|
222
|
-
let { data: t, loading: n, refetch: r } = k(e), [i, { loading: a }] = T(), [o] =
|
|
222
|
+
function Ke({ courseId: e }) {
|
|
223
|
+
let { data: t, loading: n, refetch: r } = k(e), [i, { loading: a }] = T(), [o] = R(), [c, l] = B(null), [d, f] = B(null), [p, h] = B(""), [g, _] = B("ARTICLE"), [y, b] = B(""), [x, S] = B(""), [C, w] = B(!1), [ee, E] = B(() => z()), D = [...t?.tecListLessons?.items ?? []].sort((e, t) => e.position - t.position), O = async (e) => {
|
|
223
224
|
f(e.id);
|
|
224
225
|
try {
|
|
225
226
|
let t = await o({ variables: {
|
|
@@ -238,7 +239,7 @@ function We({ courseId: e }) {
|
|
|
238
239
|
className: "mb-3 flex items-center gap-2",
|
|
239
240
|
children: [/* @__PURE__ */ q("span", {
|
|
240
241
|
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",
|
|
241
|
-
children: /* @__PURE__ */ q(
|
|
242
|
+
children: /* @__PURE__ */ q(W, { size: 15 })
|
|
242
243
|
}), /* @__PURE__ */ J("span", {
|
|
243
244
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
244
245
|
children: [
|
|
@@ -267,7 +268,7 @@ function We({ courseId: e }) {
|
|
|
267
268
|
className: "min-w-0 flex-1 truncate",
|
|
268
269
|
children: e.title
|
|
269
270
|
}),
|
|
270
|
-
/* @__PURE__ */ q(
|
|
271
|
+
/* @__PURE__ */ q(Se, {
|
|
271
272
|
variant: "secondary",
|
|
272
273
|
className: "text-[11px]",
|
|
273
274
|
children: u(e.kind)
|
|
@@ -290,13 +291,13 @@ function We({ courseId: e }) {
|
|
|
290
291
|
variant: "ghost",
|
|
291
292
|
onClick: () => l(c === e.id ? null : e.id),
|
|
292
293
|
children: [
|
|
293
|
-
/* @__PURE__ */ q(
|
|
294
|
+
/* @__PURE__ */ q(fe, { size: 13 }),
|
|
294
295
|
" ",
|
|
295
296
|
c === e.id ? "Close" : "Edit"
|
|
296
297
|
]
|
|
297
298
|
})
|
|
298
299
|
]
|
|
299
|
-
}), c === e.id ? /* @__PURE__ */ q(
|
|
300
|
+
}), c === e.id ? /* @__PURE__ */ q(Ge, {
|
|
300
301
|
lesson: e,
|
|
301
302
|
onSaved: async () => {
|
|
302
303
|
await r();
|
|
@@ -311,13 +312,13 @@ function We({ courseId: e }) {
|
|
|
311
312
|
placeholder: "Lesson title",
|
|
312
313
|
value: p,
|
|
313
314
|
onChange: (e) => h(e.target.value)
|
|
314
|
-
}), /* @__PURE__ */ J(
|
|
315
|
+
}), /* @__PURE__ */ J(we, {
|
|
315
316
|
value: g,
|
|
316
317
|
onValueChange: (e) => _(e),
|
|
317
|
-
children: [/* @__PURE__ */ q(
|
|
318
|
+
children: [/* @__PURE__ */ q(De, {
|
|
318
319
|
"aria-label": "Lesson type",
|
|
319
|
-
children: /* @__PURE__ */ q(
|
|
320
|
-
}), /* @__PURE__ */ q(
|
|
320
|
+
children: /* @__PURE__ */ q(Oe, {})
|
|
321
|
+
}), /* @__PURE__ */ q(Te, { children: Pe.map((e) => /* @__PURE__ */ q(Ee, {
|
|
321
322
|
value: e,
|
|
322
323
|
children: u(e)
|
|
323
324
|
}, e)) })]
|
|
@@ -329,7 +330,7 @@ function We({ courseId: e }) {
|
|
|
329
330
|
value: y,
|
|
330
331
|
onChange: (e) => b(e.target.value)
|
|
331
332
|
}),
|
|
332
|
-
/* @__PURE__ */ q(
|
|
333
|
+
/* @__PURE__ */ q(oe, {
|
|
333
334
|
kind: g,
|
|
334
335
|
draft: ee,
|
|
335
336
|
onChange: E
|
|
@@ -357,7 +358,7 @@ function We({ courseId: e }) {
|
|
|
357
358
|
onClick: async () => {
|
|
358
359
|
let t = p.trim();
|
|
359
360
|
if (!t) return v.error("Lesson title is required");
|
|
360
|
-
let n =
|
|
361
|
+
let n = ae(g, ee);
|
|
361
362
|
if (!n.ok) return v.error(n.error);
|
|
362
363
|
(await i({ variables: { input: {
|
|
363
364
|
courseId: e,
|
|
@@ -368,19 +369,19 @@ function We({ courseId: e }) {
|
|
|
368
369
|
estimatedMinutes: Q(x),
|
|
369
370
|
isPreview: C,
|
|
370
371
|
...n.input
|
|
371
|
-
} } })).data?.tecCreateLesson && (v.success("Lesson added", t), h(""), b(""), S(""), w(!1), E(
|
|
372
|
+
} } })).data?.tecCreateLesson && (v.success("Lesson added", t), h(""), b(""), S(""), w(!1), E(z()), await r());
|
|
372
373
|
},
|
|
373
374
|
disabled: a,
|
|
374
375
|
className: "ml-auto",
|
|
375
|
-
children: [/* @__PURE__ */ q(
|
|
376
|
+
children: [/* @__PURE__ */ q(he, { size: 14 }), " Add lesson"]
|
|
376
377
|
})
|
|
377
378
|
]
|
|
378
379
|
})
|
|
379
380
|
]
|
|
380
381
|
});
|
|
381
382
|
}
|
|
382
|
-
function
|
|
383
|
-
let [i, a] =
|
|
383
|
+
function qe({ submission: e, busy: t, onGrade: n, onRegrade: r }) {
|
|
384
|
+
let [i, a] = B(!1), s = e.verdict !== "PENDING";
|
|
384
385
|
return /* @__PURE__ */ J("div", {
|
|
385
386
|
className: "space-y-3 rounded-lg bg-bg-surface px-3 py-3 text-sm",
|
|
386
387
|
children: [
|
|
@@ -391,7 +392,7 @@ function Ge({ submission: e, busy: t, onGrade: n, onRegrade: r }) {
|
|
|
391
392
|
/* @__PURE__ */ J("span", {
|
|
392
393
|
className: "inline-flex items-center gap-1 text-xs text-text-muted",
|
|
393
394
|
children: [
|
|
394
|
-
/* @__PURE__ */ q(
|
|
395
|
+
/* @__PURE__ */ q(U, { size: 12 }),
|
|
395
396
|
" ",
|
|
396
397
|
u(e.language)
|
|
397
398
|
]
|
|
@@ -430,7 +431,7 @@ function Ge({ submission: e, busy: t, onGrade: n, onRegrade: r }) {
|
|
|
430
431
|
variant: "outline",
|
|
431
432
|
onClick: () => a((e) => !e),
|
|
432
433
|
children: [
|
|
433
|
-
/* @__PURE__ */ q(
|
|
434
|
+
/* @__PURE__ */ q(U, { size: 13 }),
|
|
434
435
|
" ",
|
|
435
436
|
i ? "Hide code" : "View code"
|
|
436
437
|
]
|
|
@@ -440,11 +441,11 @@ function Ge({ submission: e, busy: t, onGrade: n, onRegrade: r }) {
|
|
|
440
441
|
variant: "outline",
|
|
441
442
|
onClick: r,
|
|
442
443
|
disabled: t,
|
|
443
|
-
children: [/* @__PURE__ */ q(
|
|
444
|
+
children: [/* @__PURE__ */ q(ge, { size: 13 }), " Re-run grader"]
|
|
444
445
|
}) : null,
|
|
445
446
|
/* @__PURE__ */ q("div", {
|
|
446
447
|
className: "ml-auto flex flex-wrap gap-1",
|
|
447
|
-
children:
|
|
448
|
+
children: Fe.map((r) => /* @__PURE__ */ q(Y, {
|
|
448
449
|
size: "sm",
|
|
449
450
|
variant: r === "ACCEPTED" ? "default" : "outline",
|
|
450
451
|
onClick: () => n(r),
|
|
@@ -466,8 +467,8 @@ function Ge({ submission: e, busy: t, onGrade: n, onRegrade: r }) {
|
|
|
466
467
|
]
|
|
467
468
|
});
|
|
468
469
|
}
|
|
469
|
-
function
|
|
470
|
-
let { data: t, loading: n, refetch: r } =
|
|
470
|
+
function Je({ problemId: e }) {
|
|
471
|
+
let { data: t, loading: n, refetch: r } = I({ problemId: e }), [i] = E(), [a] = N(), [o, s] = B(null), [c, l] = B(!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) => {
|
|
471
472
|
s(e);
|
|
472
473
|
try {
|
|
473
474
|
(await i({ variables: {
|
|
@@ -493,7 +494,7 @@ function Ke({ problemId: e }) {
|
|
|
493
494
|
children: [
|
|
494
495
|
/* @__PURE__ */ q("span", {
|
|
495
496
|
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",
|
|
496
|
-
children: /* @__PURE__ */ q(
|
|
497
|
+
children: /* @__PURE__ */ q(de, { size: 15 })
|
|
497
498
|
}),
|
|
498
499
|
/* @__PURE__ */ J("span", {
|
|
499
500
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
@@ -520,7 +521,7 @@ function Ke({ problemId: e }) {
|
|
|
520
521
|
children: c ? "Nothing is waiting on a verdict." : "No submissions yet."
|
|
521
522
|
}) : /* @__PURE__ */ q("div", {
|
|
522
523
|
className: "space-y-2",
|
|
523
|
-
children: f.map((e) => /* @__PURE__ */ q(
|
|
524
|
+
children: f.map((e) => /* @__PURE__ */ q(qe, {
|
|
524
525
|
submission: e,
|
|
525
526
|
busy: o === e.id,
|
|
526
527
|
onGrade: (t) => void h(e.id, t),
|
|
@@ -529,8 +530,8 @@ function Ke({ problemId: e }) {
|
|
|
529
530
|
})]
|
|
530
531
|
});
|
|
531
532
|
}
|
|
532
|
-
function
|
|
533
|
-
let { data: t, loading: n, refetch: r } =
|
|
533
|
+
function Ye({ hackathon: e }) {
|
|
534
|
+
let { data: t, loading: n, refetch: r } = L(e.id), [i] = P(), [a, o] = B(null), [s, c] = B({}), l = t?.tecListTeams?.items ?? [], u = async (e, t) => {
|
|
534
535
|
let n = Math.max(0, Number(s[e] ?? "0") || 0);
|
|
535
536
|
o(e);
|
|
536
537
|
try {
|
|
@@ -611,7 +612,7 @@ function qe({ hackathon: e }) {
|
|
|
611
612
|
variant: "outline",
|
|
612
613
|
onClick: () => u(t.id, !0),
|
|
613
614
|
disabled: a === t.id,
|
|
614
|
-
children: [/* @__PURE__ */ q(
|
|
615
|
+
children: [/* @__PURE__ */ q(ye, { size: 14 }), " Winner"]
|
|
615
616
|
})
|
|
616
617
|
]
|
|
617
618
|
}) : /* @__PURE__ */ J("span", {
|
|
@@ -637,13 +638,13 @@ function qe({ hackathon: e }) {
|
|
|
637
638
|
target: "_blank",
|
|
638
639
|
rel: "noreferrer noopener",
|
|
639
640
|
className: "inline-flex items-center gap-1 text-xs font-medium text-accent-primary hover:underline",
|
|
640
|
-
children: [/* @__PURE__ */ q(
|
|
641
|
+
children: [/* @__PURE__ */ q(ue, { size: 12 }), " Project"]
|
|
641
642
|
}) : null, t.repoUrl ? /* @__PURE__ */ J("a", {
|
|
642
643
|
href: t.repoUrl,
|
|
643
644
|
target: "_blank",
|
|
644
645
|
rel: "noreferrer noopener",
|
|
645
646
|
className: "inline-flex items-center gap-1 text-xs font-medium text-accent-primary hover:underline",
|
|
646
|
-
children: [/* @__PURE__ */ q(
|
|
647
|
+
children: [/* @__PURE__ */ q(U, { size: 12 }), " Repository"]
|
|
647
648
|
}) : null]
|
|
648
649
|
})
|
|
649
650
|
]
|
|
@@ -655,32 +656,32 @@ function qe({ hackathon: e }) {
|
|
|
655
656
|
})]
|
|
656
657
|
});
|
|
657
658
|
}
|
|
658
|
-
function
|
|
659
|
-
let { data: e, loading: t, error: n, refetch: r } = S({}), [o, { loading: c }] = C(), [l] =
|
|
660
|
-
D(""), k(""), te(""),
|
|
661
|
-
},
|
|
659
|
+
function Xe() {
|
|
660
|
+
let { data: e, loading: t, error: n, refetch: r } = S({}), [o, { loading: c }] = C(), [l] = j(), [g] = b(), [_, y] = B(!1), [x, w] = B(null), [T, ee] = B(null), [E, D] = B(""), [O, k] = B(""), [A, te] = B(""), [ne, M] = B(""), [N, P] = B("BEGINNER"), [re, F] = B(""), [I, L] = B([]), R = e?.tecListCourses?.items ?? [], ie = () => {
|
|
661
|
+
D(""), k(""), te(""), M(""), P("BEGINNER"), F(""), L([]), y(!1);
|
|
662
|
+
}, z = async () => {
|
|
662
663
|
let e = E.trim();
|
|
663
664
|
if (!e) return v.error("Title is required");
|
|
664
|
-
let t =
|
|
665
|
+
let t = Re(O || e);
|
|
665
666
|
if (!t) return v.error("A valid slug is required");
|
|
666
667
|
(await o({ variables: { input: {
|
|
667
668
|
title: e,
|
|
668
669
|
slug: t,
|
|
669
670
|
summary: A.trim() || void 0,
|
|
670
|
-
topic:
|
|
671
|
-
level:
|
|
672
|
-
estimatedMinutes: Q(
|
|
673
|
-
tags:
|
|
674
|
-
} } })).data?.tecCreateCourse && (v.success("Course created", `"${e}" saved as a draft.`),
|
|
675
|
-
},
|
|
671
|
+
topic: ne.trim() || void 0,
|
|
672
|
+
level: N,
|
|
673
|
+
estimatedMinutes: Q(re),
|
|
674
|
+
tags: I
|
|
675
|
+
} } })).data?.tecCreateCourse && (v.success("Course created", `"${e}" saved as a draft.`), ie(), await r());
|
|
676
|
+
}, ae = async (e) => {
|
|
676
677
|
w(e);
|
|
677
678
|
try {
|
|
678
679
|
(await l({ variables: { id: e } })).data?.tecPublishCourse && (v.success("Course published"), await r());
|
|
679
680
|
} finally {
|
|
680
681
|
w(null);
|
|
681
682
|
}
|
|
682
|
-
},
|
|
683
|
-
if (await
|
|
683
|
+
}, oe = async (e, t) => {
|
|
684
|
+
if (await Ne({
|
|
684
685
|
title: "Archive course",
|
|
685
686
|
message: `Archive "${t}"? Learners will no longer be able to enroll.`,
|
|
686
687
|
okButtonTitle: "Archive",
|
|
@@ -697,24 +698,24 @@ function Je() {
|
|
|
697
698
|
return /* @__PURE__ */ J("div", {
|
|
698
699
|
className: "space-y-4",
|
|
699
700
|
children: [
|
|
700
|
-
/* @__PURE__ */ q(
|
|
701
|
-
summary: `${
|
|
701
|
+
/* @__PURE__ */ q(Ue, {
|
|
702
|
+
summary: `${R.length} course${R.length === 1 ? "" : "s"}`,
|
|
702
703
|
actionLabel: "New course",
|
|
703
704
|
open: _,
|
|
704
705
|
onToggle: () => y((e) => !e)
|
|
705
706
|
}),
|
|
706
|
-
_ ? /* @__PURE__ */ J(
|
|
707
|
+
_ ? /* @__PURE__ */ J(He, {
|
|
707
708
|
title: "New course",
|
|
708
709
|
description: "Draft a course, then add lessons and publish when it's ready.",
|
|
709
|
-
icon:
|
|
710
|
+
icon: H,
|
|
710
711
|
footer: /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Y, {
|
|
711
712
|
variant: "outline",
|
|
712
713
|
size: "sm",
|
|
713
|
-
onClick:
|
|
714
|
+
onClick: ie,
|
|
714
715
|
children: "Cancel"
|
|
715
716
|
}), /* @__PURE__ */ q(Y, {
|
|
716
717
|
size: "sm",
|
|
717
|
-
onClick:
|
|
718
|
+
onClick: z,
|
|
718
719
|
disabled: c,
|
|
719
720
|
children: c ? "Creating…" : "Create course"
|
|
720
721
|
})] }),
|
|
@@ -740,17 +741,17 @@ function Je() {
|
|
|
740
741
|
/* @__PURE__ */ q($, {
|
|
741
742
|
label: "Topic",
|
|
742
743
|
children: /* @__PURE__ */ q(X, {
|
|
743
|
-
value:
|
|
744
|
-
onChange: (e) =>
|
|
744
|
+
value: ne,
|
|
745
|
+
onChange: (e) => M(e.target.value),
|
|
745
746
|
placeholder: "e.g. Web, AI, Data, Cloud"
|
|
746
747
|
})
|
|
747
748
|
}),
|
|
748
749
|
/* @__PURE__ */ q($, {
|
|
749
750
|
label: "Level",
|
|
750
|
-
children: /* @__PURE__ */ J(
|
|
751
|
-
value:
|
|
752
|
-
onValueChange: (e) =>
|
|
753
|
-
children: [/* @__PURE__ */ q(
|
|
751
|
+
children: /* @__PURE__ */ J(we, {
|
|
752
|
+
value: N,
|
|
753
|
+
onValueChange: (e) => P(e),
|
|
754
|
+
children: [/* @__PURE__ */ q(De, { children: /* @__PURE__ */ q(Oe, {}) }), /* @__PURE__ */ q(Te, { children: Ie.map((e) => /* @__PURE__ */ q(Ee, {
|
|
754
755
|
value: e,
|
|
755
756
|
children: u(e)
|
|
756
757
|
}, e)) })]
|
|
@@ -761,16 +762,16 @@ function Je() {
|
|
|
761
762
|
children: /* @__PURE__ */ q(X, {
|
|
762
763
|
type: "number",
|
|
763
764
|
min: 0,
|
|
764
|
-
value:
|
|
765
|
-
onChange: (e) =>
|
|
765
|
+
value: re,
|
|
766
|
+
onChange: (e) => F(e.target.value),
|
|
766
767
|
placeholder: "120"
|
|
767
768
|
})
|
|
768
769
|
}),
|
|
769
770
|
/* @__PURE__ */ q($, {
|
|
770
771
|
label: "Tags",
|
|
771
772
|
children: /* @__PURE__ */ q(h, {
|
|
772
|
-
value:
|
|
773
|
-
onChange:
|
|
773
|
+
value: I,
|
|
774
|
+
onChange: L,
|
|
774
775
|
placeholder: "typescript, basics"
|
|
775
776
|
})
|
|
776
777
|
}),
|
|
@@ -785,17 +786,17 @@ function Je() {
|
|
|
785
786
|
})
|
|
786
787
|
]
|
|
787
788
|
}) : null,
|
|
788
|
-
t && !
|
|
789
|
+
t && !R.length ? /* @__PURE__ */ q(m, { count: 4 }) : n ? /* @__PURE__ */ q(p, {
|
|
789
790
|
title: "Couldn't load courses",
|
|
790
791
|
error: n
|
|
791
|
-
}) :
|
|
792
|
-
icon: /* @__PURE__ */ q(
|
|
792
|
+
}) : R.length === 0 ? /* @__PURE__ */ q(f, {
|
|
793
|
+
icon: /* @__PURE__ */ q(H, { size: 26 }),
|
|
793
794
|
title: "No courses yet",
|
|
794
795
|
description: "Create your first course with the button above. TechnoSpam is pre-launch."
|
|
795
796
|
}) : /* @__PURE__ */ q("div", {
|
|
796
797
|
className: "space-y-3",
|
|
797
|
-
children:
|
|
798
|
-
leading: /* @__PURE__ */ q(
|
|
798
|
+
children: R.map((e) => /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J(We, {
|
|
799
|
+
leading: /* @__PURE__ */ q(Ve, {
|
|
799
800
|
seed: `${e.topic ?? ""} ${e.title}`,
|
|
800
801
|
icon: i(e.topic ?? e.title)
|
|
801
802
|
}),
|
|
@@ -804,20 +805,20 @@ function Je() {
|
|
|
804
805
|
size: "sm",
|
|
805
806
|
variant: "outline",
|
|
806
807
|
onClick: () => ee(T === e.id ? null : e.id),
|
|
807
|
-
children: [/* @__PURE__ */ q(
|
|
808
|
+
children: [/* @__PURE__ */ q(W, { size: 15 }), " Lessons"]
|
|
808
809
|
}),
|
|
809
810
|
e.status === "DRAFT" ? /* @__PURE__ */ J(Y, {
|
|
810
811
|
size: "sm",
|
|
811
|
-
onClick: () =>
|
|
812
|
+
onClick: () => ae(e.id),
|
|
812
813
|
disabled: x === e.id,
|
|
813
|
-
children: [/* @__PURE__ */ q(
|
|
814
|
+
children: [/* @__PURE__ */ q(_e, { size: 15 }), " Publish"]
|
|
814
815
|
}) : null,
|
|
815
816
|
e.status === "ARCHIVED" ? null : /* @__PURE__ */ J(Y, {
|
|
816
817
|
size: "sm",
|
|
817
818
|
variant: "outline",
|
|
818
|
-
onClick: () =>
|
|
819
|
+
onClick: () => oe(e.id, e.title),
|
|
819
820
|
disabled: x === e.id,
|
|
820
|
-
children: [/* @__PURE__ */ q(
|
|
821
|
+
children: [/* @__PURE__ */ q(V, { size: 15 }), " Archive"]
|
|
821
822
|
})
|
|
822
823
|
] }),
|
|
823
824
|
children: [/* @__PURE__ */ J("div", {
|
|
@@ -845,18 +846,18 @@ function Je() {
|
|
|
845
846
|
a(e.updatedAt)
|
|
846
847
|
]
|
|
847
848
|
})]
|
|
848
|
-
}), T === e.id ? /* @__PURE__ */ q(
|
|
849
|
+
}), T === e.id ? /* @__PURE__ */ q(Ke, { courseId: e.id }) : null] }, e.id))
|
|
849
850
|
})
|
|
850
851
|
]
|
|
851
852
|
});
|
|
852
853
|
}
|
|
853
|
-
function
|
|
854
|
-
let { data: e, loading: t, error: n, refetch: r } =
|
|
855
|
-
x(""), C(""), T(""), D(""), k("EASY"), te(""),
|
|
856
|
-
},
|
|
854
|
+
function Ze() {
|
|
855
|
+
let { data: e, loading: t, error: n, refetch: r } = ne({}), [a, { loading: o }] = ee(), [s] = M(), [c, l] = B(!1), [h, g] = B(null), [_, y] = B(null), [b, x] = B(""), [S, C] = B(""), [w, T] = B(""), [E, D] = B(""), [O, k] = B("EASY"), [A, te] = B(""), [j, N] = B(""), [P, re] = B(""), F = e?.tecListProblems?.items ?? [], I = () => {
|
|
856
|
+
x(""), C(""), T(""), D(""), k("EASY"), te(""), N(""), re(""), l(!1);
|
|
857
|
+
}, L = async () => {
|
|
857
858
|
let e = b.trim();
|
|
858
859
|
if (!e) return v.error("Title is required");
|
|
859
|
-
let t =
|
|
860
|
+
let t = Re(S || e);
|
|
860
861
|
if (!t) return v.error("A valid slug is required");
|
|
861
862
|
(await a({ variables: { input: {
|
|
862
863
|
title: e,
|
|
@@ -865,10 +866,10 @@ function Ye() {
|
|
|
865
866
|
topic: E.trim() || void 0,
|
|
866
867
|
difficulty: O,
|
|
867
868
|
points: Q(A),
|
|
868
|
-
languages:
|
|
869
|
-
starterCode:
|
|
870
|
-
} } })).data?.tecCreateProblem && (v.success("Problem created", `"${e}" saved as a draft.`),
|
|
871
|
-
},
|
|
869
|
+
languages: ze(j),
|
|
870
|
+
starterCode: P.trim() || void 0
|
|
871
|
+
} } })).data?.tecCreateProblem && (v.success("Problem created", `"${e}" saved as a draft.`), I(), await r());
|
|
872
|
+
}, R = async (e) => {
|
|
872
873
|
g(e);
|
|
873
874
|
try {
|
|
874
875
|
(await s({ variables: { id: e } })).data?.tecPublishProblem && (v.success("Problem published"), await r());
|
|
@@ -879,24 +880,24 @@ function Ye() {
|
|
|
879
880
|
return /* @__PURE__ */ J("div", {
|
|
880
881
|
className: "space-y-4",
|
|
881
882
|
children: [
|
|
882
|
-
/* @__PURE__ */ q(
|
|
883
|
-
summary: `${
|
|
883
|
+
/* @__PURE__ */ q(Ue, {
|
|
884
|
+
summary: `${F.length} problem${F.length === 1 ? "" : "s"}`,
|
|
884
885
|
actionLabel: "New problem",
|
|
885
886
|
open: c,
|
|
886
887
|
onToggle: () => l((e) => !e)
|
|
887
888
|
}),
|
|
888
|
-
c ? /* @__PURE__ */ J(
|
|
889
|
+
c ? /* @__PURE__ */ J(He, {
|
|
889
890
|
title: "New problem",
|
|
890
891
|
description: "Define a coding challenge learners can solve and submit.",
|
|
891
|
-
icon:
|
|
892
|
+
icon: U,
|
|
892
893
|
footer: /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Y, {
|
|
893
894
|
variant: "outline",
|
|
894
895
|
size: "sm",
|
|
895
|
-
onClick:
|
|
896
|
+
onClick: I,
|
|
896
897
|
children: "Cancel"
|
|
897
898
|
}), /* @__PURE__ */ q(Y, {
|
|
898
899
|
size: "sm",
|
|
899
|
-
onClick:
|
|
900
|
+
onClick: L,
|
|
900
901
|
disabled: o,
|
|
901
902
|
children: o ? "Creating…" : "Create problem"
|
|
902
903
|
})] }),
|
|
@@ -929,10 +930,10 @@ function Ye() {
|
|
|
929
930
|
}),
|
|
930
931
|
/* @__PURE__ */ q($, {
|
|
931
932
|
label: "Difficulty",
|
|
932
|
-
children: /* @__PURE__ */ J(
|
|
933
|
+
children: /* @__PURE__ */ J(we, {
|
|
933
934
|
value: O,
|
|
934
935
|
onValueChange: (e) => k(e),
|
|
935
|
-
children: [/* @__PURE__ */ q(
|
|
936
|
+
children: [/* @__PURE__ */ q(De, { children: /* @__PURE__ */ q(Oe, {}) }), /* @__PURE__ */ q(Te, { children: Le.map((e) => /* @__PURE__ */ q(Ee, {
|
|
936
937
|
value: e,
|
|
937
938
|
children: u(e)
|
|
938
939
|
}, e)) })]
|
|
@@ -951,8 +952,8 @@ function Ye() {
|
|
|
951
952
|
/* @__PURE__ */ q($, {
|
|
952
953
|
label: "Languages (comma-separated)",
|
|
953
954
|
children: /* @__PURE__ */ q(X, {
|
|
954
|
-
value:
|
|
955
|
-
onChange: (e) =>
|
|
955
|
+
value: j,
|
|
956
|
+
onChange: (e) => N(e.target.value),
|
|
956
957
|
placeholder: "python, typescript"
|
|
957
958
|
})
|
|
958
959
|
}),
|
|
@@ -969,25 +970,25 @@ function Ye() {
|
|
|
969
970
|
label: "Starter code",
|
|
970
971
|
className: "sm:col-span-2",
|
|
971
972
|
children: /* @__PURE__ */ q(Z, {
|
|
972
|
-
value:
|
|
973
|
-
onChange: (e) =>
|
|
973
|
+
value: P,
|
|
974
|
+
onChange: (e) => re(e.target.value),
|
|
974
975
|
className: "font-mono",
|
|
975
976
|
placeholder: "def solve(nums, target):\\n pass"
|
|
976
977
|
})
|
|
977
978
|
})
|
|
978
979
|
]
|
|
979
980
|
}) : null,
|
|
980
|
-
t && !
|
|
981
|
+
t && !F.length ? /* @__PURE__ */ q(m, { count: 4 }) : n ? /* @__PURE__ */ q(p, {
|
|
981
982
|
title: "Couldn't load problems",
|
|
982
983
|
error: n
|
|
983
|
-
}) :
|
|
984
|
-
icon: /* @__PURE__ */ q(
|
|
984
|
+
}) : F.length === 0 ? /* @__PURE__ */ q(f, {
|
|
985
|
+
icon: /* @__PURE__ */ q(U, { size: 26 }),
|
|
985
986
|
title: "No problems yet",
|
|
986
987
|
description: "Create your first coding problem with the button above. TechnoSpam is pre-launch."
|
|
987
988
|
}) : /* @__PURE__ */ q("div", {
|
|
988
989
|
className: "space-y-3",
|
|
989
|
-
children:
|
|
990
|
-
leading: /* @__PURE__ */ q(
|
|
990
|
+
children: F.map((e) => /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J(We, {
|
|
991
|
+
leading: /* @__PURE__ */ q(Ve, {
|
|
991
992
|
seed: `${e.topic ?? ""} ${e.title}`,
|
|
992
993
|
icon: i(e.topic ?? e.title)
|
|
993
994
|
}),
|
|
@@ -995,12 +996,12 @@ function Ye() {
|
|
|
995
996
|
size: "sm",
|
|
996
997
|
variant: "outline",
|
|
997
998
|
onClick: () => y(_ === e.id ? null : e.id),
|
|
998
|
-
children: [/* @__PURE__ */ q(
|
|
999
|
+
children: [/* @__PURE__ */ q(de, { size: 15 }), " Grade"]
|
|
999
1000
|
}), e.status === "DRAFT" ? /* @__PURE__ */ J(Y, {
|
|
1000
1001
|
size: "sm",
|
|
1001
|
-
onClick: () =>
|
|
1002
|
+
onClick: () => R(e.id),
|
|
1002
1003
|
disabled: h === e.id,
|
|
1003
|
-
children: [/* @__PURE__ */ q(
|
|
1004
|
+
children: [/* @__PURE__ */ q(_e, { size: 15 }), " Publish"]
|
|
1004
1005
|
}) : null] }),
|
|
1005
1006
|
children: [/* @__PURE__ */ J("div", {
|
|
1006
1007
|
className: "flex flex-wrap items-center gap-2",
|
|
@@ -1028,33 +1029,33 @@ function Ye() {
|
|
|
1028
1029
|
e.languages.length ? e.languages.join(", ") : "No languages"
|
|
1029
1030
|
]
|
|
1030
1031
|
})]
|
|
1031
|
-
}), _ === e.id ? /* @__PURE__ */ q(
|
|
1032
|
+
}), _ === e.id ? /* @__PURE__ */ q(Je, { problemId: e.id }) : null] }, e.id))
|
|
1032
1033
|
})
|
|
1033
1034
|
]
|
|
1034
1035
|
});
|
|
1035
1036
|
}
|
|
1036
|
-
function
|
|
1037
|
-
let { data: e, loading: t, error: n, refetch: r } = D({}), [a, { loading: s }] = w(), [l] = te(), [u] =
|
|
1038
|
-
O(""), A(""),
|
|
1039
|
-
},
|
|
1037
|
+
function Qe() {
|
|
1038
|
+
let { data: e, loading: t, error: n, refetch: r } = D({}), [a, { loading: s }] = w(), [l] = te(), [u] = re(), [g] = F(), [_] = x(), [y, b] = B(!1), [S, C] = B(null), [T, ee] = B(null), [E, O] = B(""), [k, A] = B(""), [ne, j] = B(""), [M, N] = B(""), [P, I] = B(""), [L, R] = B(""), [ie, z] = B(""), [ae, oe] = B(""), [se, ce] = B([]), V = e?.tecListHackathons?.items ?? [], H = () => {
|
|
1039
|
+
O(""), A(""), j(""), N(""), I(""), R(""), z(""), oe(""), ce([]), b(!1);
|
|
1040
|
+
}, U = async () => {
|
|
1040
1041
|
let e = E.trim();
|
|
1041
1042
|
if (!e) return v.error("Title is required");
|
|
1042
|
-
let t =
|
|
1043
|
+
let t = Re(k || e);
|
|
1043
1044
|
if (!t) return v.error("A valid slug is required");
|
|
1044
|
-
let n =
|
|
1045
|
+
let n = Be(P), i = Be(L);
|
|
1045
1046
|
if (!n || !i) return v.error("Start and end date/time are required");
|
|
1046
1047
|
if (new Date(i) <= new Date(n)) return v.error("End must be after the start");
|
|
1047
1048
|
(await a({ variables: { input: {
|
|
1048
1049
|
title: e,
|
|
1049
1050
|
slug: t,
|
|
1050
|
-
theme:
|
|
1051
|
-
description:
|
|
1051
|
+
theme: ne.trim() || void 0,
|
|
1052
|
+
description: M.trim() || void 0,
|
|
1052
1053
|
startAt: n,
|
|
1053
1054
|
endAt: i,
|
|
1054
|
-
prizePool: Q(
|
|
1055
|
-
maxTeamSize: Q(
|
|
1056
|
-
tags:
|
|
1057
|
-
} } })).data?.tecCreateHackathon && (v.success("Hackathon created", `"${e}" saved as a draft.`),
|
|
1055
|
+
prizePool: Q(ie),
|
|
1056
|
+
maxTeamSize: Q(ae),
|
|
1057
|
+
tags: se
|
|
1058
|
+
} } })).data?.tecCreateHackathon && (v.success("Hackathon created", `"${e}" saved as a draft.`), H(), await r());
|
|
1058
1059
|
}, ue = async (e) => {
|
|
1059
1060
|
C(e);
|
|
1060
1061
|
try {
|
|
@@ -1062,7 +1063,7 @@ function Xe() {
|
|
|
1062
1063
|
} finally {
|
|
1063
1064
|
C(null);
|
|
1064
1065
|
}
|
|
1065
|
-
},
|
|
1066
|
+
}, W = async (e, t, n) => {
|
|
1066
1067
|
C(e);
|
|
1067
1068
|
try {
|
|
1068
1069
|
(await t({ variables: { id: e } })).data && (v.success(n), await r());
|
|
@@ -1073,24 +1074,24 @@ function Xe() {
|
|
|
1073
1074
|
return /* @__PURE__ */ J("div", {
|
|
1074
1075
|
className: "space-y-4",
|
|
1075
1076
|
children: [
|
|
1076
|
-
/* @__PURE__ */ q(
|
|
1077
|
-
summary: `${
|
|
1077
|
+
/* @__PURE__ */ q(Ue, {
|
|
1078
|
+
summary: `${V.length} hackathon${V.length === 1 ? "" : "s"}`,
|
|
1078
1079
|
actionLabel: "New hackathon",
|
|
1079
1080
|
open: y,
|
|
1080
1081
|
onToggle: () => b((e) => !e)
|
|
1081
1082
|
}),
|
|
1082
|
-
y ? /* @__PURE__ */ J(
|
|
1083
|
+
y ? /* @__PURE__ */ J(He, {
|
|
1083
1084
|
title: "New hackathon",
|
|
1084
1085
|
description: "Set up an event, open registration, then run judging to completion.",
|
|
1085
|
-
icon:
|
|
1086
|
+
icon: ye,
|
|
1086
1087
|
footer: /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Y, {
|
|
1087
1088
|
variant: "outline",
|
|
1088
1089
|
size: "sm",
|
|
1089
|
-
onClick:
|
|
1090
|
+
onClick: H,
|
|
1090
1091
|
children: "Cancel"
|
|
1091
1092
|
}), /* @__PURE__ */ q(Y, {
|
|
1092
1093
|
size: "sm",
|
|
1093
|
-
onClick:
|
|
1094
|
+
onClick: U,
|
|
1094
1095
|
disabled: s,
|
|
1095
1096
|
children: s ? "Creating…" : "Create hackathon"
|
|
1096
1097
|
})] }),
|
|
@@ -1116,16 +1117,16 @@ function Xe() {
|
|
|
1116
1117
|
/* @__PURE__ */ q($, {
|
|
1117
1118
|
label: "Theme",
|
|
1118
1119
|
children: /* @__PURE__ */ q(X, {
|
|
1119
|
-
value:
|
|
1120
|
-
onChange: (e) =>
|
|
1120
|
+
value: ne,
|
|
1121
|
+
onChange: (e) => j(e.target.value),
|
|
1121
1122
|
placeholder: "AI for good"
|
|
1122
1123
|
})
|
|
1123
1124
|
}),
|
|
1124
1125
|
/* @__PURE__ */ q($, {
|
|
1125
1126
|
label: "Tags",
|
|
1126
1127
|
children: /* @__PURE__ */ q(h, {
|
|
1127
|
-
value:
|
|
1128
|
-
onChange:
|
|
1128
|
+
value: se,
|
|
1129
|
+
onChange: ce,
|
|
1129
1130
|
placeholder: "ai, web"
|
|
1130
1131
|
})
|
|
1131
1132
|
}),
|
|
@@ -1134,8 +1135,8 @@ function Xe() {
|
|
|
1134
1135
|
required: !0,
|
|
1135
1136
|
children: /* @__PURE__ */ q(X, {
|
|
1136
1137
|
type: "datetime-local",
|
|
1137
|
-
value:
|
|
1138
|
-
onChange: (e) =>
|
|
1138
|
+
value: P,
|
|
1139
|
+
onChange: (e) => I(e.target.value)
|
|
1139
1140
|
})
|
|
1140
1141
|
}),
|
|
1141
1142
|
/* @__PURE__ */ q($, {
|
|
@@ -1143,8 +1144,8 @@ function Xe() {
|
|
|
1143
1144
|
required: !0,
|
|
1144
1145
|
children: /* @__PURE__ */ q(X, {
|
|
1145
1146
|
type: "datetime-local",
|
|
1146
|
-
value:
|
|
1147
|
-
onChange: (e) =>
|
|
1147
|
+
value: L,
|
|
1148
|
+
onChange: (e) => R(e.target.value)
|
|
1148
1149
|
})
|
|
1149
1150
|
}),
|
|
1150
1151
|
/* @__PURE__ */ q($, {
|
|
@@ -1152,8 +1153,8 @@ function Xe() {
|
|
|
1152
1153
|
children: /* @__PURE__ */ q(X, {
|
|
1153
1154
|
type: "number",
|
|
1154
1155
|
min: 0,
|
|
1155
|
-
value:
|
|
1156
|
-
onChange: (e) =>
|
|
1156
|
+
value: ie,
|
|
1157
|
+
onChange: (e) => z(e.target.value),
|
|
1157
1158
|
placeholder: "5000"
|
|
1158
1159
|
})
|
|
1159
1160
|
}),
|
|
@@ -1162,8 +1163,8 @@ function Xe() {
|
|
|
1162
1163
|
children: /* @__PURE__ */ q(X, {
|
|
1163
1164
|
type: "number",
|
|
1164
1165
|
min: 1,
|
|
1165
|
-
value:
|
|
1166
|
-
onChange: (e) =>
|
|
1166
|
+
value: ae,
|
|
1167
|
+
onChange: (e) => oe(e.target.value),
|
|
1167
1168
|
placeholder: "4"
|
|
1168
1169
|
})
|
|
1169
1170
|
}),
|
|
@@ -1171,26 +1172,26 @@ function Xe() {
|
|
|
1171
1172
|
label: "Description",
|
|
1172
1173
|
className: "sm:col-span-2",
|
|
1173
1174
|
children: /* @__PURE__ */ q(Z, {
|
|
1174
|
-
value:
|
|
1175
|
-
onChange: (e) =>
|
|
1175
|
+
value: M,
|
|
1176
|
+
onChange: (e) => N(e.target.value),
|
|
1176
1177
|
placeholder: "What the hackathon is about and how judging works."
|
|
1177
1178
|
})
|
|
1178
1179
|
})
|
|
1179
1180
|
]
|
|
1180
1181
|
}) : null,
|
|
1181
|
-
t && !
|
|
1182
|
+
t && !V.length ? /* @__PURE__ */ q(m, { count: 4 }) : n ? /* @__PURE__ */ q(p, {
|
|
1182
1183
|
title: "Couldn't load hackathons",
|
|
1183
1184
|
error: n
|
|
1184
|
-
}) :
|
|
1185
|
-
icon: /* @__PURE__ */ q(
|
|
1185
|
+
}) : V.length === 0 ? /* @__PURE__ */ q(f, {
|
|
1186
|
+
icon: /* @__PURE__ */ q(ye, { size: 26 }),
|
|
1186
1187
|
title: "No hackathons yet",
|
|
1187
1188
|
description: "Create your first hackathon with the button above. TechnoSpam is pre-launch."
|
|
1188
1189
|
}) : /* @__PURE__ */ q("div", {
|
|
1189
1190
|
className: "space-y-3",
|
|
1190
|
-
children:
|
|
1191
|
-
leading: /* @__PURE__ */ q(
|
|
1191
|
+
children: V.map((e) => /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J(We, {
|
|
1192
|
+
leading: /* @__PURE__ */ q(Ve, {
|
|
1192
1193
|
seed: e.title,
|
|
1193
|
-
icon: i(e.title,
|
|
1194
|
+
icon: i(e.title, ye)
|
|
1194
1195
|
}),
|
|
1195
1196
|
actions: /* @__PURE__ */ J(K, { children: [
|
|
1196
1197
|
/* @__PURE__ */ J(Y, {
|
|
@@ -1203,25 +1204,25 @@ function Xe() {
|
|
|
1203
1204
|
size: "sm",
|
|
1204
1205
|
onClick: () => ue(e.id),
|
|
1205
1206
|
disabled: S === e.id,
|
|
1206
|
-
children: [/* @__PURE__ */ q(
|
|
1207
|
+
children: [/* @__PURE__ */ q(_e, { size: 15 }), " Open registration"]
|
|
1207
1208
|
}) : null,
|
|
1208
1209
|
e.status === "REGISTRATION_OPEN" ? /* @__PURE__ */ J(Y, {
|
|
1209
1210
|
size: "sm",
|
|
1210
|
-
onClick: () =>
|
|
1211
|
+
onClick: () => W(e.id, u, "Hackathon started"),
|
|
1211
1212
|
disabled: S === e.id,
|
|
1212
|
-
children: [/* @__PURE__ */ q(
|
|
1213
|
+
children: [/* @__PURE__ */ q(pe, { size: 15 }), " Start"]
|
|
1213
1214
|
}) : null,
|
|
1214
1215
|
e.status === "IN_PROGRESS" ? /* @__PURE__ */ J(Y, {
|
|
1215
1216
|
size: "sm",
|
|
1216
|
-
onClick: () =>
|
|
1217
|
+
onClick: () => W(e.id, g, "Judging started"),
|
|
1217
1218
|
disabled: S === e.id,
|
|
1218
|
-
children: [/* @__PURE__ */ q(
|
|
1219
|
+
children: [/* @__PURE__ */ q(de, { size: 15 }), " Start judging"]
|
|
1219
1220
|
}) : null,
|
|
1220
1221
|
e.status === "JUDGING" ? /* @__PURE__ */ J(Y, {
|
|
1221
1222
|
size: "sm",
|
|
1222
|
-
onClick: () =>
|
|
1223
|
+
onClick: () => W(e.id, _, "Hackathon completed"),
|
|
1223
1224
|
disabled: S === e.id,
|
|
1224
|
-
children: [/* @__PURE__ */ q(
|
|
1225
|
+
children: [/* @__PURE__ */ q(le, { size: 15 }), " Complete"]
|
|
1225
1226
|
}) : null
|
|
1226
1227
|
] }),
|
|
1227
1228
|
children: [/* @__PURE__ */ J("div", {
|
|
@@ -1241,13 +1242,13 @@ function Xe() {
|
|
|
1241
1242
|
e.prizePool ? ` · ${c(e.prizePool, e.currency)} prize` : ""
|
|
1242
1243
|
]
|
|
1243
1244
|
})]
|
|
1244
|
-
}), T === e.id ? /* @__PURE__ */ q(
|
|
1245
|
+
}), T === e.id ? /* @__PURE__ */ q(Ye, { hackathon: e }) : null] }, e.id))
|
|
1245
1246
|
})
|
|
1246
1247
|
]
|
|
1247
1248
|
});
|
|
1248
1249
|
}
|
|
1249
|
-
function
|
|
1250
|
-
let { data: e, loading: t, error: n, refetch: r } = A({}), [a] = y(), [o, s] =
|
|
1250
|
+
function $e() {
|
|
1251
|
+
let { data: e, loading: t, error: n, refetch: r } = A({}), [a] = y(), [o, s] = B(null), c = e?.tecListMentors?.items ?? [], u = c.filter((e) => e.status === "PENDING").length, h = async (e) => {
|
|
1251
1252
|
s(e);
|
|
1252
1253
|
try {
|
|
1253
1254
|
(await a({ variables: { id: e } })).data?.tecApproveMentor && (v.success("Mentor approved", "They can now accept mentees."), await r());
|
|
@@ -1257,7 +1258,7 @@ function Ze() {
|
|
|
1257
1258
|
};
|
|
1258
1259
|
return /* @__PURE__ */ J("div", {
|
|
1259
1260
|
className: "space-y-4",
|
|
1260
|
-
children: [/* @__PURE__ */ q(
|
|
1261
|
+
children: [/* @__PURE__ */ q(Ue, { summary: `${c.length} mentor${c.length === 1 ? "" : "s"}${u ? ` · ${u} pending approval` : ""}` }), t && !c.length ? /* @__PURE__ */ q(m, { count: 4 }) : n ? /* @__PURE__ */ q(p, {
|
|
1261
1262
|
title: "Couldn't load mentors",
|
|
1262
1263
|
error: n
|
|
1263
1264
|
}) : c.length === 0 ? /* @__PURE__ */ q(f, {
|
|
@@ -1266,8 +1267,8 @@ function Ze() {
|
|
|
1266
1267
|
description: "Mentor applications will appear here for review. TechnoSpam is pre-launch."
|
|
1267
1268
|
}) : /* @__PURE__ */ q("div", {
|
|
1268
1269
|
className: "space-y-3",
|
|
1269
|
-
children: c.map((e) => /* @__PURE__ */ J(
|
|
1270
|
-
leading: /* @__PURE__ */ q(
|
|
1270
|
+
children: c.map((e) => /* @__PURE__ */ J(We, {
|
|
1271
|
+
leading: /* @__PURE__ */ q(Ve, {
|
|
1271
1272
|
seed: e.headline,
|
|
1272
1273
|
icon: i(e.expertise[0] ?? e.headline, G)
|
|
1273
1274
|
}),
|
|
@@ -1275,7 +1276,7 @@ function Ze() {
|
|
|
1275
1276
|
size: "sm",
|
|
1276
1277
|
onClick: () => h(e.id),
|
|
1277
1278
|
disabled: o === e.id,
|
|
1278
|
-
children: [/* @__PURE__ */ q(
|
|
1279
|
+
children: [/* @__PURE__ */ q(be, { size: 15 }), " Approve"]
|
|
1279
1280
|
}) : void 0,
|
|
1280
1281
|
children: [/* @__PURE__ */ J("div", {
|
|
1281
1282
|
className: "flex flex-wrap items-center gap-2",
|
|
@@ -1285,7 +1286,7 @@ function Ze() {
|
|
|
1285
1286
|
children: e.headline
|
|
1286
1287
|
}),
|
|
1287
1288
|
/* @__PURE__ */ q(d, { status: e.status }),
|
|
1288
|
-
e.isAcceptingMentees ? /* @__PURE__ */ q(
|
|
1289
|
+
e.isAcceptingMentees ? /* @__PURE__ */ q(Se, {
|
|
1289
1290
|
variant: "secondary",
|
|
1290
1291
|
className: "text-[11px]",
|
|
1291
1292
|
children: "Accepting mentees"
|
|
@@ -1308,15 +1309,15 @@ function Ze() {
|
|
|
1308
1309
|
})]
|
|
1309
1310
|
});
|
|
1310
1311
|
}
|
|
1311
|
-
function
|
|
1312
|
-
let [t, r] =
|
|
1312
|
+
function et() {
|
|
1313
|
+
let [t, r] = B("courses"), { currentUser: i } = e(), a = (i?.role ?? "").toLowerCase();
|
|
1313
1314
|
return /* @__PURE__ */ J(n, {
|
|
1314
1315
|
hero: !0,
|
|
1315
1316
|
title: "Authoring Console",
|
|
1316
|
-
description: "Create and manage TechnoSpam content — courses, problems, hackathons, and
|
|
1317
|
-
children: [a.includes("admin") || a.includes("owner") || a.includes("instructor") ? null : /* @__PURE__ */ J(
|
|
1317
|
+
description: "Create and manage TechnoSpam content — courses, problems, hackathons, mentor applications — and enterprise integrations.",
|
|
1318
|
+
children: [a.includes("admin") || a.includes("owner") || a.includes("instructor") ? null : /* @__PURE__ */ J(Ce, {
|
|
1318
1319
|
className: "mb-5 flex items-start gap-3 border-status-warning-border p-4",
|
|
1319
|
-
children: [/* @__PURE__ */ q(
|
|
1320
|
+
children: [/* @__PURE__ */ q(ve, {
|
|
1320
1321
|
size: 18,
|
|
1321
1322
|
className: "mt-0.5 shrink-0 text-status-warning-text"
|
|
1322
1323
|
}), /* @__PURE__ */ J("div", {
|
|
@@ -1330,39 +1331,43 @@ function Qe() {
|
|
|
1330
1331
|
"You can review content here, but create/publish actions require the right permission and will be rejected at the gateway otherwise."
|
|
1331
1332
|
]
|
|
1332
1333
|
})]
|
|
1333
|
-
}), /* @__PURE__ */ J(
|
|
1334
|
+
}), /* @__PURE__ */ J(ke, {
|
|
1334
1335
|
className: "gap-0",
|
|
1335
1336
|
value: t,
|
|
1336
1337
|
onValueChange: (e) => r(e),
|
|
1337
|
-
children: [/* @__PURE__ */ J(
|
|
1338
|
+
children: [/* @__PURE__ */ J(je, {
|
|
1338
1339
|
className: "mb-5",
|
|
1339
1340
|
children: [
|
|
1340
|
-
/* @__PURE__ */ J(
|
|
1341
|
+
/* @__PURE__ */ J(Me, {
|
|
1341
1342
|
value: "courses",
|
|
1342
|
-
children: [/* @__PURE__ */ q(
|
|
1343
|
+
children: [/* @__PURE__ */ q(H, { size: 15 }), " Courses"]
|
|
1343
1344
|
}),
|
|
1344
|
-
/* @__PURE__ */ J(
|
|
1345
|
+
/* @__PURE__ */ J(Me, {
|
|
1345
1346
|
value: "problems",
|
|
1346
|
-
children: [/* @__PURE__ */ q(
|
|
1347
|
+
children: [/* @__PURE__ */ q(U, { size: 15 }), " Problems"]
|
|
1347
1348
|
}),
|
|
1348
|
-
/* @__PURE__ */ J(
|
|
1349
|
+
/* @__PURE__ */ J(Me, {
|
|
1349
1350
|
value: "hackathons",
|
|
1350
|
-
children: [/* @__PURE__ */ q(
|
|
1351
|
+
children: [/* @__PURE__ */ q(ye, { size: 15 }), " Hackathons"]
|
|
1351
1352
|
}),
|
|
1352
|
-
/* @__PURE__ */ J(
|
|
1353
|
+
/* @__PURE__ */ J(Me, {
|
|
1353
1354
|
value: "mentors",
|
|
1354
1355
|
children: [/* @__PURE__ */ q(G, { size: 15 }), " Mentors"]
|
|
1356
|
+
}),
|
|
1357
|
+
/* @__PURE__ */ J(Me, {
|
|
1358
|
+
value: "integrations",
|
|
1359
|
+
children: [/* @__PURE__ */ q(me, { size: 15 }), " Integrations"]
|
|
1355
1360
|
})
|
|
1356
1361
|
]
|
|
1357
|
-
}), /* @__PURE__ */ q(
|
|
1362
|
+
}), /* @__PURE__ */ q(Ae, {
|
|
1358
1363
|
value: t,
|
|
1359
|
-
className:
|
|
1360
|
-
children: q(t === "courses" ?
|
|
1364
|
+
className: ie,
|
|
1365
|
+
children: q(t === "courses" ? Xe : t === "problems" ? Ze : t === "hackathons" ? Qe : t === "mentors" ? $e : se, {})
|
|
1361
1366
|
})]
|
|
1362
1367
|
})]
|
|
1363
1368
|
});
|
|
1364
1369
|
}
|
|
1365
1370
|
//#endregion
|
|
1366
|
-
export {
|
|
1371
|
+
export { et as AdminAdminDashboardPagePage };
|
|
1367
1372
|
|
|
1368
1373
|
//# sourceMappingURL=AdminAdminDashboardPagePage.js.map
|