@burdenoff/microfe-technospam 2026.730.1 → 2026.730.3
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 +46 -0
- package/dist/technospam/api/technospamApi.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.js +190 -139
- package/dist/technospam/api/technospamApi.js.map +1 -1
- package/dist/technospam/pages/AdminAdminDashboardPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/AdminAdminDashboardPagePage.js +256 -256
- package/dist/technospam/pages/AdminAdminDashboardPagePage.js.map +1 -1
- package/dist/technospam/pages/MentorshipMentorProfilePagePage.d.ts.map +1 -1
- package/dist/technospam/pages/MentorshipMentorProfilePagePage.js +152 -111
- package/dist/technospam/pages/MentorshipMentorProfilePagePage.js.map +1 -1
- package/dist/technospam/pages/MentorshipMentorsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/MentorshipMentorsPagePage.js +6 -5
- package/dist/technospam/pages/MentorshipMentorsPagePage.js.map +1 -1
- package/dist/technospam/utils/format.d.ts +12 -0
- package/dist/technospam/utils/format.d.ts.map +1 -1
- package/dist/technospam/utils/format.js +14 -3
- package/dist/technospam/utils/format.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,52 +2,52 @@ import { useTechnoSpam as e } from "../providers/TechnoSpamProvider.js";
|
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { PageLayout as n } from "../components/PageLayout.js";
|
|
4
4
|
import { coverGradient as r, topicIcon as i } from "../components/MediaCover.js";
|
|
5
|
-
import { formatDateTime as a, formatDuration as o, formatMoney as s,
|
|
6
|
-
import { StatusBadge as
|
|
7
|
-
import { EmptyView as
|
|
8
|
-
import { TagInput as
|
|
5
|
+
import { formatDateTime as a, formatDuration as o, formatMoney as s, formatMoneyFromMinorUnits as c, humanizeEnum as l } from "../utils/format.js";
|
|
6
|
+
import { StatusBadge as u } from "../components/StatusBadge.js";
|
|
7
|
+
import { EmptyView as d, ErrorView as f, LoadingRows as p } from "../components/StateViews.js";
|
|
8
|
+
import { TagInput as m } from "../components/TagInput.js";
|
|
9
9
|
import "../components/index.js";
|
|
10
|
-
import { notify as
|
|
11
|
-
import { useApproveMentor as
|
|
10
|
+
import { notify as h } from "../lib/toast.js";
|
|
11
|
+
import { useApproveMentor as g, useArchiveCourse as _, useCompleteHackathon as v, useCoursesQuery as y, useCreateCourse as b, useCreateHackathon as ee, useCreateLesson as x, useCreateProblem as S, useGradeSubmission as C, useHackathonsQuery as te, useLessonsQuery as w, useMentorsQuery as T, useOpenRegistration as E, useProblemsQuery as D, usePublishCourse as O, usePublishProblem as k, useScoreTeam as A, useStartHackathon as ne, useStartJudging as j, useSubmissionsQuery as M, useTeamsQuery as N } from "../api/technospamApi.js";
|
|
12
12
|
import { useState as P } from "react";
|
|
13
|
-
import { Archive as
|
|
13
|
+
import { Archive as F, Award as I, BookOpen as L, Code2 as R, Gavel as re, ListChecks as z, Play as ie, Plus as B, Rocket as ae, ShieldAlert as V, Trophy as H, UserCheck as oe, Users as U, X as se } from "lucide-react";
|
|
14
14
|
import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
15
|
-
import { Badge as q, Button as J, GlassCard as Y, Input as X, Select as
|
|
16
|
-
import { nativeConfirm as
|
|
15
|
+
import { Badge as q, Button as J, GlassCard as Y, Input as X, Select as Z, SelectContent as ce, SelectItem as Q, SelectTrigger as le, SelectValue as ue, Tabs as de, TabsList as fe, TabsTrigger as pe, Textarea as me } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
import { nativeConfirm as he } from "@burdenoff/fe-libs/shared/native";
|
|
17
17
|
//#region src/technospam/pages/AdminAdminDashboardPagePage.tsx
|
|
18
|
-
var
|
|
18
|
+
var ge = [
|
|
19
19
|
"ARTICLE",
|
|
20
20
|
"VIDEO",
|
|
21
21
|
"INTERACTIVE",
|
|
22
22
|
"QUIZ",
|
|
23
23
|
"PROJECT"
|
|
24
|
-
],
|
|
24
|
+
], _e = [
|
|
25
25
|
"ACCEPTED",
|
|
26
26
|
"WRONG_ANSWER",
|
|
27
27
|
"TIME_LIMIT_EXCEEDED",
|
|
28
28
|
"RUNTIME_ERROR",
|
|
29
29
|
"COMPILE_ERROR"
|
|
30
|
-
],
|
|
30
|
+
], ve = [
|
|
31
31
|
"BEGINNER",
|
|
32
32
|
"INTERMEDIATE",
|
|
33
33
|
"ADVANCED",
|
|
34
34
|
"EXPERT"
|
|
35
|
-
],
|
|
35
|
+
], ye = [
|
|
36
36
|
"EASY",
|
|
37
37
|
"MEDIUM",
|
|
38
38
|
"HARD"
|
|
39
39
|
];
|
|
40
|
-
function
|
|
40
|
+
function be(e) {
|
|
41
41
|
return e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function xe(e) {
|
|
44
44
|
return e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Se(e) {
|
|
47
47
|
let t = Number.parseInt(e, 10);
|
|
48
48
|
return Number.isFinite(t) ? t : void 0;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Ce(e) {
|
|
51
51
|
if (!e) return null;
|
|
52
52
|
let t = new Date(e);
|
|
53
53
|
return Number.isNaN(t.getTime()) ? null : t.toISOString();
|
|
@@ -64,7 +64,7 @@ function $({ label: e, required: t, className: n, children: r }) {
|
|
|
64
64
|
}), r]
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function we({ seed: e, icon: n }) {
|
|
68
68
|
return /* @__PURE__ */ G("span", {
|
|
69
69
|
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)),
|
|
70
70
|
children: /* @__PURE__ */ G(n, {
|
|
@@ -73,7 +73,7 @@ function Ce({ seed: e, icon: n }) {
|
|
|
73
73
|
})
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Te({ title: e, description: t, icon: n, children: r, footer: i }) {
|
|
77
77
|
return /* @__PURE__ */ K(Y, {
|
|
78
78
|
className: "space-y-4 p-4 sm:p-5",
|
|
79
79
|
children: [
|
|
@@ -104,7 +104,7 @@ function we({ title: e, description: t, icon: n, children: r, footer: i }) {
|
|
|
104
104
|
]
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function Ee({ summary: e, actionLabel: t, open: n, onToggle: r }) {
|
|
108
108
|
return /* @__PURE__ */ K("div", {
|
|
109
109
|
className: "flex items-center justify-between gap-3",
|
|
110
110
|
children: [/* @__PURE__ */ G("p", {
|
|
@@ -114,11 +114,11 @@ function Te({ summary: e, actionLabel: t, open: n, onToggle: r }) {
|
|
|
114
114
|
size: "sm",
|
|
115
115
|
variant: n ? "outline" : "default",
|
|
116
116
|
onClick: r,
|
|
117
|
-
children: [G(n ?
|
|
117
|
+
children: [G(n ? se : B, { size: 15 }), n ? "Close" : t]
|
|
118
118
|
}) : null]
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function De({ leading: e, children: t, actions: n }) {
|
|
122
122
|
return /* @__PURE__ */ K(Y, {
|
|
123
123
|
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",
|
|
124
124
|
children: [/* @__PURE__ */ K("div", {
|
|
@@ -133,8 +133,8 @@ function Ee({ leading: e, children: t, actions: n }) {
|
|
|
133
133
|
}) : null]
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
let { data: t, loading: n, refetch: r } =
|
|
136
|
+
function Oe({ courseId: e }) {
|
|
137
|
+
let { data: t, loading: n, refetch: r } = w(e), [i, { loading: a }] = x(), [s, c] = P(""), [u, d] = P("ARTICLE"), [f, m] = P(""), [g, _] = P(""), [v, y] = P(!1), b = [...t?.tecListLessons.items ?? []].sort((e, t) => e.position - t.position);
|
|
138
138
|
return /* @__PURE__ */ K("div", {
|
|
139
139
|
className: "mt-3 rounded-xl border border-border-seam bg-bg-sunken p-4",
|
|
140
140
|
children: [
|
|
@@ -142,7 +142,7 @@ function De({ courseId: e }) {
|
|
|
142
142
|
className: "mb-3 flex items-center gap-2",
|
|
143
143
|
children: [/* @__PURE__ */ G("span", {
|
|
144
144
|
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",
|
|
145
|
-
children: /* @__PURE__ */ G(
|
|
145
|
+
children: /* @__PURE__ */ G(z, { size: 15 })
|
|
146
146
|
}), /* @__PURE__ */ K("span", {
|
|
147
147
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
148
148
|
children: [
|
|
@@ -152,7 +152,7 @@ function De({ courseId: e }) {
|
|
|
152
152
|
]
|
|
153
153
|
})]
|
|
154
154
|
}),
|
|
155
|
-
n && b.length === 0 ? /* @__PURE__ */ G(
|
|
155
|
+
n && b.length === 0 ? /* @__PURE__ */ G(p, {
|
|
156
156
|
count: 2,
|
|
157
157
|
height: "h-10"
|
|
158
158
|
}) : b.length === 0 ? /* @__PURE__ */ G("p", {
|
|
@@ -174,7 +174,7 @@ function De({ courseId: e }) {
|
|
|
174
174
|
/* @__PURE__ */ G(q, {
|
|
175
175
|
variant: "secondary",
|
|
176
176
|
className: "text-[11px]",
|
|
177
|
-
children:
|
|
177
|
+
children: l(e.kind)
|
|
178
178
|
}),
|
|
179
179
|
e.isPreview ? /* @__PURE__ */ G(q, {
|
|
180
180
|
variant: "outline",
|
|
@@ -193,21 +193,21 @@ function De({ courseId: e }) {
|
|
|
193
193
|
children: [/* @__PURE__ */ G(X, {
|
|
194
194
|
placeholder: "Lesson title",
|
|
195
195
|
value: s,
|
|
196
|
-
onChange: (e) =>
|
|
197
|
-
}), /* @__PURE__ */ K(
|
|
196
|
+
onChange: (e) => c(e.target.value)
|
|
197
|
+
}), /* @__PURE__ */ K(Z, {
|
|
198
198
|
value: u,
|
|
199
199
|
onValueChange: (e) => d(e),
|
|
200
|
-
children: [/* @__PURE__ */ G(
|
|
200
|
+
children: [/* @__PURE__ */ G(le, { children: /* @__PURE__ */ G(ue, {}) }), /* @__PURE__ */ G(ce, { children: ge.map((e) => /* @__PURE__ */ G(Q, {
|
|
201
201
|
value: e,
|
|
202
|
-
children:
|
|
202
|
+
children: l(e)
|
|
203
203
|
}, e)) })]
|
|
204
204
|
})]
|
|
205
205
|
}),
|
|
206
|
-
/* @__PURE__ */ G(
|
|
206
|
+
/* @__PURE__ */ G(me, {
|
|
207
207
|
className: "mt-2",
|
|
208
208
|
placeholder: "Lesson content (markdown / notes)",
|
|
209
|
-
value:
|
|
210
|
-
onChange: (e) =>
|
|
209
|
+
value: f,
|
|
210
|
+
onChange: (e) => m(e.target.value)
|
|
211
211
|
}),
|
|
212
212
|
/* @__PURE__ */ K("div", {
|
|
213
213
|
className: "mt-2 flex flex-wrap items-center gap-3",
|
|
@@ -231,16 +231,16 @@ function De({ courseId: e }) {
|
|
|
231
231
|
size: "sm",
|
|
232
232
|
onClick: async () => {
|
|
233
233
|
let t = s.trim();
|
|
234
|
-
if (!t) return
|
|
234
|
+
if (!t) return h.error("Lesson title is required");
|
|
235
235
|
(await i({ variables: { input: {
|
|
236
236
|
courseId: e,
|
|
237
237
|
title: t,
|
|
238
238
|
kind: u,
|
|
239
|
-
content:
|
|
239
|
+
content: f.trim() || void 0,
|
|
240
240
|
position: b.length + 1,
|
|
241
|
-
estimatedMinutes:
|
|
241
|
+
estimatedMinutes: Se(g),
|
|
242
242
|
isPreview: v
|
|
243
|
-
} } })).data?.tecCreateLesson && (
|
|
243
|
+
} } })).data?.tecCreateLesson && (h.success("Lesson added", t), c(""), m(""), _(""), y(!1), await r());
|
|
244
244
|
},
|
|
245
245
|
disabled: a,
|
|
246
246
|
className: "ml-auto",
|
|
@@ -251,14 +251,14 @@ function De({ courseId: e }) {
|
|
|
251
251
|
]
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
let { data: t, loading: n, refetch: r } = M({ problemId: e }), [i] = C(), [o, s] = P(null),
|
|
254
|
+
function ke({ problemId: e }) {
|
|
255
|
+
let { data: t, loading: n, refetch: r } = M({ problemId: e }), [i] = C(), [o, s] = P(null), c = t?.tecListSubmissions.items ?? [], d = async (e, t) => {
|
|
256
256
|
s(e);
|
|
257
257
|
try {
|
|
258
258
|
(await i({ variables: {
|
|
259
259
|
id: e,
|
|
260
260
|
verdict: t
|
|
261
|
-
} })).data?.tecGradeSubmission && (
|
|
261
|
+
} })).data?.tecGradeSubmission && (h.success("Submission graded", l(t)), await r());
|
|
262
262
|
} finally {
|
|
263
263
|
s(null);
|
|
264
264
|
}
|
|
@@ -269,27 +269,27 @@ function Oe({ problemId: e }) {
|
|
|
269
269
|
className: "mb-3 flex items-center gap-2",
|
|
270
270
|
children: [/* @__PURE__ */ G("span", {
|
|
271
271
|
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",
|
|
272
|
-
children: /* @__PURE__ */ G(
|
|
272
|
+
children: /* @__PURE__ */ G(re, { size: 15 })
|
|
273
273
|
}), /* @__PURE__ */ K("span", {
|
|
274
274
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
275
275
|
children: [
|
|
276
276
|
"Submissions (",
|
|
277
|
-
|
|
277
|
+
c.length,
|
|
278
278
|
")"
|
|
279
279
|
]
|
|
280
280
|
})]
|
|
281
|
-
}), n &&
|
|
281
|
+
}), n && c.length === 0 ? /* @__PURE__ */ G(p, {
|
|
282
282
|
count: 2,
|
|
283
283
|
height: "h-10"
|
|
284
|
-
}) :
|
|
284
|
+
}) : c.length === 0 ? /* @__PURE__ */ G("p", {
|
|
285
285
|
className: "text-xs text-text-muted",
|
|
286
286
|
children: "No submissions yet."
|
|
287
287
|
}) : /* @__PURE__ */ G("div", {
|
|
288
288
|
className: "space-y-2",
|
|
289
|
-
children:
|
|
289
|
+
children: c.map((e) => /* @__PURE__ */ K("div", {
|
|
290
290
|
className: "flex flex-wrap items-center gap-2 rounded-lg bg-bg-surface px-3 py-2 text-sm",
|
|
291
291
|
children: [
|
|
292
|
-
/* @__PURE__ */ G(
|
|
292
|
+
/* @__PURE__ */ G(u, { status: e.verdict }),
|
|
293
293
|
/* @__PURE__ */ G("span", {
|
|
294
294
|
className: "text-xs text-text-muted",
|
|
295
295
|
children: e.language
|
|
@@ -300,12 +300,12 @@ function Oe({ problemId: e }) {
|
|
|
300
300
|
}),
|
|
301
301
|
e.verdict === "PENDING" ? /* @__PURE__ */ G("div", {
|
|
302
302
|
className: "ml-auto flex flex-wrap gap-1",
|
|
303
|
-
children:
|
|
303
|
+
children: _e.map((t) => /* @__PURE__ */ G(J, {
|
|
304
304
|
size: "sm",
|
|
305
305
|
variant: t === "ACCEPTED" ? "default" : "outline",
|
|
306
306
|
onClick: () => d(e.id, t),
|
|
307
307
|
disabled: o === e.id,
|
|
308
|
-
children: t === "ACCEPTED" ? "Accept" :
|
|
308
|
+
children: t === "ACCEPTED" ? "Accept" : l(t)
|
|
309
309
|
}, t))
|
|
310
310
|
}) : /* @__PURE__ */ K("span", {
|
|
311
311
|
className: "ml-auto text-xs text-text-muted",
|
|
@@ -316,8 +316,8 @@ function Oe({ problemId: e }) {
|
|
|
316
316
|
})]
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
let { data: t, loading: n, refetch: r } = N(e.id), [i] =
|
|
319
|
+
function Ae({ hackathon: e }) {
|
|
320
|
+
let { data: t, loading: n, refetch: r } = N(e.id), [i] = A(), [a, o] = P(null), [s, c] = P({}), l = t?.tecListTeams.items ?? [], d = async (e, t) => {
|
|
321
321
|
let n = Math.max(0, Number(s[e] ?? "0") || 0);
|
|
322
322
|
o(e);
|
|
323
323
|
try {
|
|
@@ -325,7 +325,7 @@ function ke({ hackathon: e }) {
|
|
|
325
325
|
id: e,
|
|
326
326
|
score: n,
|
|
327
327
|
winner: t
|
|
328
|
-
} })).data?.tecScoreTeam && (
|
|
328
|
+
} })).data?.tecScoreTeam && (h.success("Team scored", `${n} pts${t ? " · winner" : ""}`), await r());
|
|
329
329
|
} finally {
|
|
330
330
|
o(null);
|
|
331
331
|
}
|
|
@@ -341,26 +341,26 @@ function ke({ hackathon: e }) {
|
|
|
341
341
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
342
342
|
children: [
|
|
343
343
|
"Teams (",
|
|
344
|
-
|
|
344
|
+
l.length,
|
|
345
345
|
")"
|
|
346
346
|
]
|
|
347
347
|
})]
|
|
348
|
-
}), n &&
|
|
348
|
+
}), n && l.length === 0 ? /* @__PURE__ */ G(p, {
|
|
349
349
|
count: 2,
|
|
350
350
|
height: "h-10"
|
|
351
|
-
}) :
|
|
351
|
+
}) : l.length === 0 ? /* @__PURE__ */ G("p", {
|
|
352
352
|
className: "text-xs text-text-muted",
|
|
353
353
|
children: "No teams registered yet."
|
|
354
354
|
}) : /* @__PURE__ */ G("div", {
|
|
355
355
|
className: "space-y-2",
|
|
356
|
-
children:
|
|
356
|
+
children: l.map((t) => /* @__PURE__ */ K("div", {
|
|
357
357
|
className: "flex flex-wrap items-center gap-2 rounded-lg bg-bg-surface px-3 py-2 text-sm",
|
|
358
358
|
children: [
|
|
359
359
|
/* @__PURE__ */ G("span", {
|
|
360
360
|
className: "truncate font-medium text-text-primary",
|
|
361
361
|
children: t.name
|
|
362
362
|
}),
|
|
363
|
-
/* @__PURE__ */ G(
|
|
363
|
+
/* @__PURE__ */ G(u, { status: t.status }),
|
|
364
364
|
t.projectName ? /* @__PURE__ */ G("span", {
|
|
365
365
|
className: "text-xs text-text-muted",
|
|
366
366
|
children: t.projectName
|
|
@@ -401,66 +401,66 @@ function ke({ hackathon: e }) {
|
|
|
401
401
|
})]
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
let { data: e, loading: t, error: n, refetch: r } =
|
|
406
|
-
|
|
407
|
-
},
|
|
408
|
-
let e =
|
|
409
|
-
if (!e) return
|
|
410
|
-
let t =
|
|
411
|
-
if (!t) return
|
|
404
|
+
function je() {
|
|
405
|
+
let { data: e, loading: t, error: n, refetch: r } = y({}), [a, { loading: s }] = b(), [c] = O(), [g] = _(), [v, ee] = P(!1), [x, S] = P(null), [C, te] = P(null), [w, T] = P(""), [E, D] = P(""), [k, A] = P(""), [ne, j] = P(""), [M, N] = P("BEGINNER"), [I, R] = P(""), [re, ie] = P([]), B = e?.tecListCourses.items ?? [], V = () => {
|
|
406
|
+
T(""), D(""), A(""), j(""), N("BEGINNER"), R(""), ie([]), ee(!1);
|
|
407
|
+
}, H = async () => {
|
|
408
|
+
let e = w.trim();
|
|
409
|
+
if (!e) return h.error("Title is required");
|
|
410
|
+
let t = be(E || e);
|
|
411
|
+
if (!t) return h.error("A valid slug is required");
|
|
412
412
|
(await a({ variables: { input: {
|
|
413
413
|
title: e,
|
|
414
414
|
slug: t,
|
|
415
415
|
summary: k.trim() || void 0,
|
|
416
|
-
topic:
|
|
417
|
-
level:
|
|
418
|
-
estimatedMinutes:
|
|
419
|
-
tags:
|
|
420
|
-
} } })).data?.tecCreateCourse && (
|
|
421
|
-
},
|
|
422
|
-
|
|
416
|
+
topic: ne.trim() || void 0,
|
|
417
|
+
level: M,
|
|
418
|
+
estimatedMinutes: Se(I),
|
|
419
|
+
tags: re
|
|
420
|
+
} } })).data?.tecCreateCourse && (h.success("Course created", `"${e}" saved as a draft.`), V(), await r());
|
|
421
|
+
}, oe = async (e) => {
|
|
422
|
+
S(e);
|
|
423
423
|
try {
|
|
424
|
-
(await
|
|
424
|
+
(await c({ variables: { id: e } })).data?.tecPublishCourse && (h.success("Course published"), await r());
|
|
425
425
|
} finally {
|
|
426
|
-
|
|
426
|
+
S(null);
|
|
427
427
|
}
|
|
428
|
-
},
|
|
429
|
-
if (await
|
|
428
|
+
}, U = async (e, t) => {
|
|
429
|
+
if (await he({
|
|
430
430
|
title: "Archive course",
|
|
431
431
|
message: `Archive "${t}"? Learners will no longer be able to enroll.`,
|
|
432
432
|
okButtonTitle: "Archive",
|
|
433
433
|
cancelButtonTitle: "Cancel"
|
|
434
434
|
})) {
|
|
435
|
-
|
|
435
|
+
S(e);
|
|
436
436
|
try {
|
|
437
|
-
(await
|
|
437
|
+
(await g({ variables: { id: e } })).data?.tecArchiveCourse && (h.success("Course archived"), await r());
|
|
438
438
|
} finally {
|
|
439
|
-
|
|
439
|
+
S(null);
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
};
|
|
443
443
|
return /* @__PURE__ */ K("div", {
|
|
444
444
|
className: "space-y-4",
|
|
445
445
|
children: [
|
|
446
|
-
/* @__PURE__ */ G(
|
|
447
|
-
summary: `${
|
|
446
|
+
/* @__PURE__ */ G(Ee, {
|
|
447
|
+
summary: `${B.length} course${B.length === 1 ? "" : "s"}`,
|
|
448
448
|
actionLabel: "New course",
|
|
449
|
-
open:
|
|
450
|
-
onToggle: () =>
|
|
449
|
+
open: v,
|
|
450
|
+
onToggle: () => ee((e) => !e)
|
|
451
451
|
}),
|
|
452
|
-
|
|
452
|
+
v ? /* @__PURE__ */ K(Te, {
|
|
453
453
|
title: "New course",
|
|
454
454
|
description: "Draft a course, then add lessons and publish when it's ready.",
|
|
455
|
-
icon:
|
|
455
|
+
icon: L,
|
|
456
456
|
footer: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(J, {
|
|
457
457
|
variant: "outline",
|
|
458
458
|
size: "sm",
|
|
459
|
-
onClick:
|
|
459
|
+
onClick: V,
|
|
460
460
|
children: "Cancel"
|
|
461
461
|
}), /* @__PURE__ */ G(J, {
|
|
462
462
|
size: "sm",
|
|
463
|
-
onClick:
|
|
463
|
+
onClick: H,
|
|
464
464
|
disabled: s,
|
|
465
465
|
children: s ? "Creating…" : "Create course"
|
|
466
466
|
})] }),
|
|
@@ -469,8 +469,8 @@ function Ae() {
|
|
|
469
469
|
label: "Title",
|
|
470
470
|
required: !0,
|
|
471
471
|
children: /* @__PURE__ */ G(X, {
|
|
472
|
-
value:
|
|
473
|
-
onChange: (e) =>
|
|
472
|
+
value: w,
|
|
473
|
+
onChange: (e) => T(e.target.value),
|
|
474
474
|
placeholder: "Intro to TypeScript"
|
|
475
475
|
})
|
|
476
476
|
}),
|
|
@@ -478,27 +478,27 @@ function Ae() {
|
|
|
478
478
|
label: "Slug",
|
|
479
479
|
required: !0,
|
|
480
480
|
children: /* @__PURE__ */ G(X, {
|
|
481
|
-
value:
|
|
482
|
-
onChange: (e) =>
|
|
481
|
+
value: E,
|
|
482
|
+
onChange: (e) => D(e.target.value),
|
|
483
483
|
placeholder: "auto from title if blank"
|
|
484
484
|
})
|
|
485
485
|
}),
|
|
486
486
|
/* @__PURE__ */ G($, {
|
|
487
487
|
label: "Topic",
|
|
488
488
|
children: /* @__PURE__ */ G(X, {
|
|
489
|
-
value:
|
|
490
|
-
onChange: (e) =>
|
|
489
|
+
value: ne,
|
|
490
|
+
onChange: (e) => j(e.target.value),
|
|
491
491
|
placeholder: "e.g. Web, AI, Data, Cloud"
|
|
492
492
|
})
|
|
493
493
|
}),
|
|
494
494
|
/* @__PURE__ */ G($, {
|
|
495
495
|
label: "Level",
|
|
496
|
-
children: /* @__PURE__ */ K(
|
|
497
|
-
value:
|
|
498
|
-
onValueChange: (e) =>
|
|
499
|
-
children: [/* @__PURE__ */ G(
|
|
496
|
+
children: /* @__PURE__ */ K(Z, {
|
|
497
|
+
value: M,
|
|
498
|
+
onValueChange: (e) => N(e),
|
|
499
|
+
children: [/* @__PURE__ */ G(le, { children: /* @__PURE__ */ G(ue, {}) }), /* @__PURE__ */ G(ce, { children: ve.map((e) => /* @__PURE__ */ G(Q, {
|
|
500
500
|
value: e,
|
|
501
|
-
children:
|
|
501
|
+
children: l(e)
|
|
502
502
|
}, e)) })]
|
|
503
503
|
})
|
|
504
504
|
}),
|
|
@@ -508,22 +508,22 @@ function Ae() {
|
|
|
508
508
|
type: "number",
|
|
509
509
|
min: 0,
|
|
510
510
|
value: I,
|
|
511
|
-
onChange: (e) =>
|
|
511
|
+
onChange: (e) => R(e.target.value),
|
|
512
512
|
placeholder: "120"
|
|
513
513
|
})
|
|
514
514
|
}),
|
|
515
515
|
/* @__PURE__ */ G($, {
|
|
516
516
|
label: "Tags",
|
|
517
|
-
children: /* @__PURE__ */ G(
|
|
518
|
-
value:
|
|
519
|
-
onChange:
|
|
517
|
+
children: /* @__PURE__ */ G(m, {
|
|
518
|
+
value: re,
|
|
519
|
+
onChange: ie,
|
|
520
520
|
placeholder: "typescript, basics"
|
|
521
521
|
})
|
|
522
522
|
}),
|
|
523
523
|
/* @__PURE__ */ G($, {
|
|
524
524
|
label: "Summary",
|
|
525
525
|
className: "sm:col-span-2",
|
|
526
|
-
children: /* @__PURE__ */ G(
|
|
526
|
+
children: /* @__PURE__ */ G(me, {
|
|
527
527
|
value: k,
|
|
528
528
|
onChange: (e) => A(e.target.value),
|
|
529
529
|
placeholder: "What learners will build and take away."
|
|
@@ -531,17 +531,17 @@ function Ae() {
|
|
|
531
531
|
})
|
|
532
532
|
]
|
|
533
533
|
}) : null,
|
|
534
|
-
t && !
|
|
534
|
+
t && !B.length ? /* @__PURE__ */ G(p, { count: 4 }) : n ? /* @__PURE__ */ G(f, {
|
|
535
535
|
title: "Couldn't load courses",
|
|
536
536
|
error: n
|
|
537
|
-
}) :
|
|
538
|
-
icon: /* @__PURE__ */ G(
|
|
537
|
+
}) : B.length === 0 ? /* @__PURE__ */ G(d, {
|
|
538
|
+
icon: /* @__PURE__ */ G(L, { size: 26 }),
|
|
539
539
|
title: "No courses yet",
|
|
540
540
|
description: "Create your first course with the button above. TechnoSpam is pre-launch."
|
|
541
541
|
}) : /* @__PURE__ */ G("div", {
|
|
542
542
|
className: "space-y-3",
|
|
543
|
-
children:
|
|
544
|
-
leading: /* @__PURE__ */ G(
|
|
543
|
+
children: B.map((e) => /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K(De, {
|
|
544
|
+
leading: /* @__PURE__ */ G(we, {
|
|
545
545
|
seed: `${e.topic ?? ""} ${e.title}`,
|
|
546
546
|
icon: i(e.topic ?? e.title)
|
|
547
547
|
}),
|
|
@@ -549,21 +549,21 @@ function Ae() {
|
|
|
549
549
|
/* @__PURE__ */ K(J, {
|
|
550
550
|
size: "sm",
|
|
551
551
|
variant: "outline",
|
|
552
|
-
onClick: () =>
|
|
553
|
-
children: [/* @__PURE__ */ G(
|
|
552
|
+
onClick: () => te(C === e.id ? null : e.id),
|
|
553
|
+
children: [/* @__PURE__ */ G(z, { size: 15 }), " Lessons"]
|
|
554
554
|
}),
|
|
555
555
|
e.status === "DRAFT" ? /* @__PURE__ */ K(J, {
|
|
556
556
|
size: "sm",
|
|
557
|
-
onClick: () =>
|
|
558
|
-
disabled:
|
|
559
|
-
children: [/* @__PURE__ */ G(
|
|
557
|
+
onClick: () => oe(e.id),
|
|
558
|
+
disabled: x === e.id,
|
|
559
|
+
children: [/* @__PURE__ */ G(ae, { size: 15 }), " Publish"]
|
|
560
560
|
}) : null,
|
|
561
561
|
e.status === "ARCHIVED" ? null : /* @__PURE__ */ K(J, {
|
|
562
562
|
size: "sm",
|
|
563
563
|
variant: "outline",
|
|
564
|
-
onClick: () =>
|
|
565
|
-
disabled:
|
|
566
|
-
children: [/* @__PURE__ */ G(
|
|
564
|
+
onClick: () => U(e.id, e.title),
|
|
565
|
+
disabled: x === e.id,
|
|
566
|
+
children: [/* @__PURE__ */ G(F, { size: 15 }), " Archive"]
|
|
567
567
|
})
|
|
568
568
|
] }),
|
|
569
569
|
children: [/* @__PURE__ */ K("div", {
|
|
@@ -573,8 +573,8 @@ function Ae() {
|
|
|
573
573
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
574
574
|
children: e.title
|
|
575
575
|
}),
|
|
576
|
-
/* @__PURE__ */ G(
|
|
577
|
-
/* @__PURE__ */ G(
|
|
576
|
+
/* @__PURE__ */ G(u, { status: e.status }),
|
|
577
|
+
/* @__PURE__ */ G(u, {
|
|
578
578
|
status: e.level,
|
|
579
579
|
kind: "level"
|
|
580
580
|
})
|
|
@@ -589,33 +589,33 @@ function Ae() {
|
|
|
589
589
|
o(e.estimatedMinutes)
|
|
590
590
|
]
|
|
591
591
|
})]
|
|
592
|
-
}),
|
|
592
|
+
}), C === e.id ? /* @__PURE__ */ G(Oe, { courseId: e.id }) : null] }, e.id))
|
|
593
593
|
})
|
|
594
594
|
]
|
|
595
595
|
});
|
|
596
596
|
}
|
|
597
|
-
function
|
|
598
|
-
let { data: e, loading: t, error: n, refetch: r } =
|
|
599
|
-
|
|
600
|
-
},
|
|
597
|
+
function Me() {
|
|
598
|
+
let { data: e, loading: t, error: n, refetch: r } = D({}), [a, { loading: o }] = S(), [s] = k(), [c, m] = P(!1), [g, _] = P(null), [v, y] = P(null), [b, ee] = P(""), [x, C] = P(""), [te, w] = P(""), [T, E] = P(""), [O, A] = P("EASY"), [ne, j] = P(""), [M, N] = P(""), [F, I] = P(""), L = e?.tecListProblems.items ?? [], z = () => {
|
|
599
|
+
ee(""), C(""), w(""), E(""), A("EASY"), j(""), N(""), I(""), m(!1);
|
|
600
|
+
}, ie = async () => {
|
|
601
601
|
let e = b.trim();
|
|
602
|
-
if (!e) return
|
|
603
|
-
let t =
|
|
604
|
-
if (!t) return
|
|
602
|
+
if (!e) return h.error("Title is required");
|
|
603
|
+
let t = be(x || e);
|
|
604
|
+
if (!t) return h.error("A valid slug is required");
|
|
605
605
|
(await a({ variables: { input: {
|
|
606
606
|
title: e,
|
|
607
607
|
slug: t,
|
|
608
|
-
statement:
|
|
609
|
-
topic:
|
|
610
|
-
difficulty:
|
|
611
|
-
points:
|
|
612
|
-
languages:
|
|
613
|
-
starterCode:
|
|
614
|
-
} } })).data?.tecCreateProblem && (
|
|
615
|
-
},
|
|
608
|
+
statement: te.trim() || void 0,
|
|
609
|
+
topic: T.trim() || void 0,
|
|
610
|
+
difficulty: O,
|
|
611
|
+
points: Se(ne),
|
|
612
|
+
languages: xe(M),
|
|
613
|
+
starterCode: F.trim() || void 0
|
|
614
|
+
} } })).data?.tecCreateProblem && (h.success("Problem created", `"${e}" saved as a draft.`), z(), await r());
|
|
615
|
+
}, B = async (e) => {
|
|
616
616
|
_(e);
|
|
617
617
|
try {
|
|
618
|
-
(await s({ variables: { id: e } })).data?.tecPublishProblem && (
|
|
618
|
+
(await s({ variables: { id: e } })).data?.tecPublishProblem && (h.success("Problem published"), await r());
|
|
619
619
|
} finally {
|
|
620
620
|
_(null);
|
|
621
621
|
}
|
|
@@ -623,16 +623,16 @@ function je() {
|
|
|
623
623
|
return /* @__PURE__ */ K("div", {
|
|
624
624
|
className: "space-y-4",
|
|
625
625
|
children: [
|
|
626
|
-
/* @__PURE__ */ G(
|
|
627
|
-
summary: `${
|
|
626
|
+
/* @__PURE__ */ G(Ee, {
|
|
627
|
+
summary: `${L.length} problem${L.length === 1 ? "" : "s"}`,
|
|
628
628
|
actionLabel: "New problem",
|
|
629
|
-
open:
|
|
630
|
-
onToggle: () =>
|
|
629
|
+
open: c,
|
|
630
|
+
onToggle: () => m((e) => !e)
|
|
631
631
|
}),
|
|
632
|
-
|
|
632
|
+
c ? /* @__PURE__ */ K(Te, {
|
|
633
633
|
title: "New problem",
|
|
634
634
|
description: "Define a coding challenge learners can solve and submit.",
|
|
635
|
-
icon:
|
|
635
|
+
icon: R,
|
|
636
636
|
footer: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(J, {
|
|
637
637
|
variant: "outline",
|
|
638
638
|
size: "sm",
|
|
@@ -640,7 +640,7 @@ function je() {
|
|
|
640
640
|
children: "Cancel"
|
|
641
641
|
}), /* @__PURE__ */ G(J, {
|
|
642
642
|
size: "sm",
|
|
643
|
-
onClick:
|
|
643
|
+
onClick: ie,
|
|
644
644
|
disabled: o,
|
|
645
645
|
children: o ? "Creating…" : "Create problem"
|
|
646
646
|
})] }),
|
|
@@ -650,7 +650,7 @@ function je() {
|
|
|
650
650
|
required: !0,
|
|
651
651
|
children: /* @__PURE__ */ G(X, {
|
|
652
652
|
value: b,
|
|
653
|
-
onChange: (e) =>
|
|
653
|
+
onChange: (e) => ee(e.target.value),
|
|
654
654
|
placeholder: "Two Sum"
|
|
655
655
|
})
|
|
656
656
|
}),
|
|
@@ -658,27 +658,27 @@ function je() {
|
|
|
658
658
|
label: "Slug",
|
|
659
659
|
required: !0,
|
|
660
660
|
children: /* @__PURE__ */ G(X, {
|
|
661
|
-
value:
|
|
662
|
-
onChange: (e) =>
|
|
661
|
+
value: x,
|
|
662
|
+
onChange: (e) => C(e.target.value),
|
|
663
663
|
placeholder: "auto from title if blank"
|
|
664
664
|
})
|
|
665
665
|
}),
|
|
666
666
|
/* @__PURE__ */ G($, {
|
|
667
667
|
label: "Topic",
|
|
668
668
|
children: /* @__PURE__ */ G(X, {
|
|
669
|
-
value:
|
|
670
|
-
onChange: (e) =>
|
|
669
|
+
value: T,
|
|
670
|
+
onChange: (e) => E(e.target.value),
|
|
671
671
|
placeholder: "Arrays"
|
|
672
672
|
})
|
|
673
673
|
}),
|
|
674
674
|
/* @__PURE__ */ G($, {
|
|
675
675
|
label: "Difficulty",
|
|
676
|
-
children: /* @__PURE__ */ K(
|
|
677
|
-
value:
|
|
676
|
+
children: /* @__PURE__ */ K(Z, {
|
|
677
|
+
value: O,
|
|
678
678
|
onValueChange: (e) => A(e),
|
|
679
|
-
children: [/* @__PURE__ */ G(
|
|
679
|
+
children: [/* @__PURE__ */ G(le, { children: /* @__PURE__ */ G(ue, {}) }), /* @__PURE__ */ G(ce, { children: ye.map((e) => /* @__PURE__ */ G(Q, {
|
|
680
680
|
value: e,
|
|
681
|
-
children:
|
|
681
|
+
children: l(e)
|
|
682
682
|
}, e)) })]
|
|
683
683
|
})
|
|
684
684
|
}),
|
|
@@ -687,51 +687,51 @@ function je() {
|
|
|
687
687
|
children: /* @__PURE__ */ G(X, {
|
|
688
688
|
type: "number",
|
|
689
689
|
min: 0,
|
|
690
|
-
value:
|
|
691
|
-
onChange: (e) =>
|
|
690
|
+
value: ne,
|
|
691
|
+
onChange: (e) => j(e.target.value),
|
|
692
692
|
placeholder: "100"
|
|
693
693
|
})
|
|
694
694
|
}),
|
|
695
695
|
/* @__PURE__ */ G($, {
|
|
696
696
|
label: "Languages (comma-separated)",
|
|
697
697
|
children: /* @__PURE__ */ G(X, {
|
|
698
|
-
value:
|
|
699
|
-
onChange: (e) =>
|
|
698
|
+
value: M,
|
|
699
|
+
onChange: (e) => N(e.target.value),
|
|
700
700
|
placeholder: "python, typescript"
|
|
701
701
|
})
|
|
702
702
|
}),
|
|
703
703
|
/* @__PURE__ */ G($, {
|
|
704
704
|
label: "Statement",
|
|
705
705
|
className: "sm:col-span-2",
|
|
706
|
-
children: /* @__PURE__ */ G(
|
|
707
|
-
value:
|
|
708
|
-
onChange: (e) =>
|
|
706
|
+
children: /* @__PURE__ */ G(me, {
|
|
707
|
+
value: te,
|
|
708
|
+
onChange: (e) => w(e.target.value),
|
|
709
709
|
placeholder: "Describe the problem and constraints."
|
|
710
710
|
})
|
|
711
711
|
}),
|
|
712
712
|
/* @__PURE__ */ G($, {
|
|
713
713
|
label: "Starter code",
|
|
714
714
|
className: "sm:col-span-2",
|
|
715
|
-
children: /* @__PURE__ */ G(
|
|
716
|
-
value:
|
|
717
|
-
onChange: (e) =>
|
|
715
|
+
children: /* @__PURE__ */ G(me, {
|
|
716
|
+
value: F,
|
|
717
|
+
onChange: (e) => I(e.target.value),
|
|
718
718
|
className: "font-mono",
|
|
719
719
|
placeholder: "def solve(nums, target):\\n pass"
|
|
720
720
|
})
|
|
721
721
|
})
|
|
722
722
|
]
|
|
723
723
|
}) : null,
|
|
724
|
-
t && !
|
|
724
|
+
t && !L.length ? /* @__PURE__ */ G(p, { count: 4 }) : n ? /* @__PURE__ */ G(f, {
|
|
725
725
|
title: "Couldn't load problems",
|
|
726
726
|
error: n
|
|
727
|
-
}) :
|
|
728
|
-
icon: /* @__PURE__ */ G(
|
|
727
|
+
}) : L.length === 0 ? /* @__PURE__ */ G(d, {
|
|
728
|
+
icon: /* @__PURE__ */ G(R, { size: 26 }),
|
|
729
729
|
title: "No problems yet",
|
|
730
730
|
description: "Create your first coding problem with the button above. TechnoSpam is pre-launch."
|
|
731
731
|
}) : /* @__PURE__ */ G("div", {
|
|
732
732
|
className: "space-y-3",
|
|
733
|
-
children:
|
|
734
|
-
leading: /* @__PURE__ */ G(
|
|
733
|
+
children: L.map((e) => /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K(De, {
|
|
734
|
+
leading: /* @__PURE__ */ G(we, {
|
|
735
735
|
seed: `${e.topic ?? ""} ${e.title}`,
|
|
736
736
|
icon: i(e.topic ?? e.title)
|
|
737
737
|
}),
|
|
@@ -739,12 +739,12 @@ function je() {
|
|
|
739
739
|
size: "sm",
|
|
740
740
|
variant: "outline",
|
|
741
741
|
onClick: () => y(v === e.id ? null : e.id),
|
|
742
|
-
children: [/* @__PURE__ */ G(
|
|
742
|
+
children: [/* @__PURE__ */ G(re, { size: 15 }), " Grade"]
|
|
743
743
|
}), e.status === "DRAFT" ? /* @__PURE__ */ K(J, {
|
|
744
744
|
size: "sm",
|
|
745
|
-
onClick: () =>
|
|
745
|
+
onClick: () => B(e.id),
|
|
746
746
|
disabled: g === e.id,
|
|
747
|
-
children: [/* @__PURE__ */ G(
|
|
747
|
+
children: [/* @__PURE__ */ G(ae, { size: 15 }), " Publish"]
|
|
748
748
|
}) : null] }),
|
|
749
749
|
children: [/* @__PURE__ */ K("div", {
|
|
750
750
|
className: "flex flex-wrap items-center gap-2",
|
|
@@ -753,8 +753,8 @@ function je() {
|
|
|
753
753
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
754
754
|
children: e.title
|
|
755
755
|
}),
|
|
756
|
-
/* @__PURE__ */ G(
|
|
757
|
-
/* @__PURE__ */ G(
|
|
756
|
+
/* @__PURE__ */ G(u, { status: e.status }),
|
|
757
|
+
/* @__PURE__ */ G(u, {
|
|
758
758
|
status: e.difficulty,
|
|
759
759
|
kind: "level"
|
|
760
760
|
})
|
|
@@ -772,69 +772,69 @@ function je() {
|
|
|
772
772
|
e.languages.length ? e.languages.join(", ") : "No languages"
|
|
773
773
|
]
|
|
774
774
|
})]
|
|
775
|
-
}), v === e.id ? /* @__PURE__ */ G(
|
|
775
|
+
}), v === e.id ? /* @__PURE__ */ G(ke, { problemId: e.id }) : null] }, e.id))
|
|
776
776
|
})
|
|
777
777
|
]
|
|
778
778
|
});
|
|
779
779
|
}
|
|
780
|
-
function
|
|
781
|
-
let { data: e, loading: t, error: n, refetch: r } =
|
|
782
|
-
O(""),
|
|
783
|
-
},
|
|
780
|
+
function Ne() {
|
|
781
|
+
let { data: e, loading: t, error: n, refetch: r } = te({}), [o, { loading: c }] = ee(), [l] = E(), [g] = ne(), [_] = j(), [y] = v(), [b, x] = P(!1), [S, C] = P(null), [w, T] = P(null), [D, O] = P(""), [k, A] = P(""), [M, N] = P(""), [F, L] = P(""), [R, z] = P(""), [B, V] = P(""), [oe, se] = P(""), [q, Y] = P(""), [Z, ce] = P([]), Q = e?.tecListHackathons.items ?? [], le = () => {
|
|
782
|
+
O(""), A(""), N(""), L(""), z(""), V(""), se(""), Y(""), ce([]), x(!1);
|
|
783
|
+
}, ue = async () => {
|
|
784
784
|
let e = D.trim();
|
|
785
|
-
if (!e) return
|
|
786
|
-
let t =
|
|
787
|
-
if (!t) return
|
|
788
|
-
let n =
|
|
789
|
-
if (!n || !i) return
|
|
790
|
-
if (new Date(i) <= new Date(n)) return
|
|
785
|
+
if (!e) return h.error("Title is required");
|
|
786
|
+
let t = be(k || e);
|
|
787
|
+
if (!t) return h.error("A valid slug is required");
|
|
788
|
+
let n = Ce(R), i = Ce(B);
|
|
789
|
+
if (!n || !i) return h.error("Start and end date/time are required");
|
|
790
|
+
if (new Date(i) <= new Date(n)) return h.error("End must be after the start");
|
|
791
791
|
(await o({ variables: { input: {
|
|
792
792
|
title: e,
|
|
793
793
|
slug: t,
|
|
794
|
-
theme:
|
|
794
|
+
theme: M.trim() || void 0,
|
|
795
795
|
description: F.trim() || void 0,
|
|
796
796
|
startAt: n,
|
|
797
797
|
endAt: i,
|
|
798
|
-
prizePool:
|
|
799
|
-
maxTeamSize:
|
|
800
|
-
tags:
|
|
801
|
-
} } })).data?.tecCreateHackathon && (
|
|
802
|
-
},
|
|
803
|
-
|
|
798
|
+
prizePool: Se(oe),
|
|
799
|
+
maxTeamSize: Se(q),
|
|
800
|
+
tags: Z
|
|
801
|
+
} } })).data?.tecCreateHackathon && (h.success("Hackathon created", `"${e}" saved as a draft.`), le(), await r());
|
|
802
|
+
}, de = async (e) => {
|
|
803
|
+
C(e);
|
|
804
804
|
try {
|
|
805
|
-
(await
|
|
805
|
+
(await l({ variables: { id: e } })).data?.tecOpenRegistration && (h.success("Registration open", "Teams can now register."), await r());
|
|
806
806
|
} finally {
|
|
807
|
-
|
|
807
|
+
C(null);
|
|
808
808
|
}
|
|
809
|
-
},
|
|
810
|
-
|
|
809
|
+
}, fe = async (e, t, n) => {
|
|
810
|
+
C(e);
|
|
811
811
|
try {
|
|
812
|
-
(await t({ variables: { id: e } })).data && (
|
|
812
|
+
(await t({ variables: { id: e } })).data && (h.success(n), await r());
|
|
813
813
|
} finally {
|
|
814
|
-
|
|
814
|
+
C(null);
|
|
815
815
|
}
|
|
816
816
|
};
|
|
817
817
|
return /* @__PURE__ */ K("div", {
|
|
818
818
|
className: "space-y-4",
|
|
819
819
|
children: [
|
|
820
|
-
/* @__PURE__ */ G(
|
|
821
|
-
summary: `${
|
|
820
|
+
/* @__PURE__ */ G(Ee, {
|
|
821
|
+
summary: `${Q.length} hackathon${Q.length === 1 ? "" : "s"}`,
|
|
822
822
|
actionLabel: "New hackathon",
|
|
823
|
-
open:
|
|
824
|
-
onToggle: () =>
|
|
823
|
+
open: b,
|
|
824
|
+
onToggle: () => x((e) => !e)
|
|
825
825
|
}),
|
|
826
|
-
|
|
826
|
+
b ? /* @__PURE__ */ K(Te, {
|
|
827
827
|
title: "New hackathon",
|
|
828
828
|
description: "Set up an event, open registration, then run judging to completion.",
|
|
829
829
|
icon: H,
|
|
830
830
|
footer: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(J, {
|
|
831
831
|
variant: "outline",
|
|
832
832
|
size: "sm",
|
|
833
|
-
onClick:
|
|
833
|
+
onClick: le,
|
|
834
834
|
children: "Cancel"
|
|
835
835
|
}), /* @__PURE__ */ G(J, {
|
|
836
836
|
size: "sm",
|
|
837
|
-
onClick:
|
|
837
|
+
onClick: ue,
|
|
838
838
|
disabled: c,
|
|
839
839
|
children: c ? "Creating…" : "Create hackathon"
|
|
840
840
|
})] }),
|
|
@@ -853,23 +853,23 @@ function Me() {
|
|
|
853
853
|
required: !0,
|
|
854
854
|
children: /* @__PURE__ */ G(X, {
|
|
855
855
|
value: k,
|
|
856
|
-
onChange: (e) =>
|
|
856
|
+
onChange: (e) => A(e.target.value),
|
|
857
857
|
placeholder: "auto from title if blank"
|
|
858
858
|
})
|
|
859
859
|
}),
|
|
860
860
|
/* @__PURE__ */ G($, {
|
|
861
861
|
label: "Theme",
|
|
862
862
|
children: /* @__PURE__ */ G(X, {
|
|
863
|
-
value:
|
|
864
|
-
onChange: (e) =>
|
|
863
|
+
value: M,
|
|
864
|
+
onChange: (e) => N(e.target.value),
|
|
865
865
|
placeholder: "AI for good"
|
|
866
866
|
})
|
|
867
867
|
}),
|
|
868
868
|
/* @__PURE__ */ G($, {
|
|
869
869
|
label: "Tags",
|
|
870
|
-
children: /* @__PURE__ */ G(
|
|
871
|
-
value:
|
|
872
|
-
onChange:
|
|
870
|
+
children: /* @__PURE__ */ G(m, {
|
|
871
|
+
value: Z,
|
|
872
|
+
onChange: ce,
|
|
873
873
|
placeholder: "ai, web"
|
|
874
874
|
})
|
|
875
875
|
}),
|
|
@@ -879,7 +879,7 @@ function Me() {
|
|
|
879
879
|
children: /* @__PURE__ */ G(X, {
|
|
880
880
|
type: "datetime-local",
|
|
881
881
|
value: R,
|
|
882
|
-
onChange: (e) =>
|
|
882
|
+
onChange: (e) => z(e.target.value)
|
|
883
883
|
})
|
|
884
884
|
}),
|
|
885
885
|
/* @__PURE__ */ G($, {
|
|
@@ -887,8 +887,8 @@ function Me() {
|
|
|
887
887
|
required: !0,
|
|
888
888
|
children: /* @__PURE__ */ G(X, {
|
|
889
889
|
type: "datetime-local",
|
|
890
|
-
value:
|
|
891
|
-
onChange: (e) =>
|
|
890
|
+
value: B,
|
|
891
|
+
onChange: (e) => V(e.target.value)
|
|
892
892
|
})
|
|
893
893
|
}),
|
|
894
894
|
/* @__PURE__ */ G($, {
|
|
@@ -897,7 +897,7 @@ function Me() {
|
|
|
897
897
|
type: "number",
|
|
898
898
|
min: 0,
|
|
899
899
|
value: oe,
|
|
900
|
-
onChange: (e) =>
|
|
900
|
+
onChange: (e) => se(e.target.value),
|
|
901
901
|
placeholder: "5000"
|
|
902
902
|
})
|
|
903
903
|
}),
|
|
@@ -906,33 +906,33 @@ function Me() {
|
|
|
906
906
|
children: /* @__PURE__ */ G(X, {
|
|
907
907
|
type: "number",
|
|
908
908
|
min: 1,
|
|
909
|
-
value:
|
|
910
|
-
onChange: (e) =>
|
|
909
|
+
value: q,
|
|
910
|
+
onChange: (e) => Y(e.target.value),
|
|
911
911
|
placeholder: "4"
|
|
912
912
|
})
|
|
913
913
|
}),
|
|
914
914
|
/* @__PURE__ */ G($, {
|
|
915
915
|
label: "Description",
|
|
916
916
|
className: "sm:col-span-2",
|
|
917
|
-
children: /* @__PURE__ */ G(
|
|
917
|
+
children: /* @__PURE__ */ G(me, {
|
|
918
918
|
value: F,
|
|
919
|
-
onChange: (e) =>
|
|
919
|
+
onChange: (e) => L(e.target.value),
|
|
920
920
|
placeholder: "What the hackathon is about and how judging works."
|
|
921
921
|
})
|
|
922
922
|
})
|
|
923
923
|
]
|
|
924
924
|
}) : null,
|
|
925
|
-
t && !
|
|
925
|
+
t && !Q.length ? /* @__PURE__ */ G(p, { count: 4 }) : n ? /* @__PURE__ */ G(f, {
|
|
926
926
|
title: "Couldn't load hackathons",
|
|
927
927
|
error: n
|
|
928
|
-
}) :
|
|
928
|
+
}) : Q.length === 0 ? /* @__PURE__ */ G(d, {
|
|
929
929
|
icon: /* @__PURE__ */ G(H, { size: 26 }),
|
|
930
930
|
title: "No hackathons yet",
|
|
931
931
|
description: "Create your first hackathon with the button above. TechnoSpam is pre-launch."
|
|
932
932
|
}) : /* @__PURE__ */ G("div", {
|
|
933
933
|
className: "space-y-3",
|
|
934
|
-
children:
|
|
935
|
-
leading: /* @__PURE__ */ G(
|
|
934
|
+
children: Q.map((e) => /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K(De, {
|
|
935
|
+
leading: /* @__PURE__ */ G(we, {
|
|
936
936
|
seed: e.title,
|
|
937
937
|
icon: i(e.title, H)
|
|
938
938
|
}),
|
|
@@ -940,32 +940,32 @@ function Me() {
|
|
|
940
940
|
/* @__PURE__ */ K(J, {
|
|
941
941
|
size: "sm",
|
|
942
942
|
variant: "outline",
|
|
943
|
-
onClick: () =>
|
|
943
|
+
onClick: () => T(w === e.id ? null : e.id),
|
|
944
944
|
children: [/* @__PURE__ */ G(U, { size: 15 }), " Teams"]
|
|
945
945
|
}),
|
|
946
946
|
e.status === "DRAFT" ? /* @__PURE__ */ K(J, {
|
|
947
947
|
size: "sm",
|
|
948
|
-
onClick: () =>
|
|
949
|
-
disabled:
|
|
950
|
-
children: [/* @__PURE__ */ G(
|
|
948
|
+
onClick: () => de(e.id),
|
|
949
|
+
disabled: S === e.id,
|
|
950
|
+
children: [/* @__PURE__ */ G(ae, { size: 15 }), " Open registration"]
|
|
951
951
|
}) : null,
|
|
952
952
|
e.status === "REGISTRATION_OPEN" ? /* @__PURE__ */ K(J, {
|
|
953
953
|
size: "sm",
|
|
954
|
-
onClick: () =>
|
|
955
|
-
disabled:
|
|
956
|
-
children: [/* @__PURE__ */ G(
|
|
954
|
+
onClick: () => fe(e.id, g, "Hackathon started"),
|
|
955
|
+
disabled: S === e.id,
|
|
956
|
+
children: [/* @__PURE__ */ G(ie, { size: 15 }), " Start"]
|
|
957
957
|
}) : null,
|
|
958
958
|
e.status === "IN_PROGRESS" ? /* @__PURE__ */ K(J, {
|
|
959
959
|
size: "sm",
|
|
960
|
-
onClick: () =>
|
|
961
|
-
disabled:
|
|
962
|
-
children: [/* @__PURE__ */ G(
|
|
960
|
+
onClick: () => fe(e.id, _, "Judging started"),
|
|
961
|
+
disabled: S === e.id,
|
|
962
|
+
children: [/* @__PURE__ */ G(re, { size: 15 }), " Start judging"]
|
|
963
963
|
}) : null,
|
|
964
964
|
e.status === "JUDGING" ? /* @__PURE__ */ K(J, {
|
|
965
965
|
size: "sm",
|
|
966
|
-
onClick: () =>
|
|
967
|
-
disabled:
|
|
968
|
-
children: [/* @__PURE__ */ G(
|
|
966
|
+
onClick: () => fe(e.id, y, "Hackathon completed"),
|
|
967
|
+
disabled: S === e.id,
|
|
968
|
+
children: [/* @__PURE__ */ G(I, { size: 15 }), " Complete"]
|
|
969
969
|
}) : null
|
|
970
970
|
] }),
|
|
971
971
|
children: [/* @__PURE__ */ K("div", {
|
|
@@ -973,7 +973,7 @@ function Me() {
|
|
|
973
973
|
children: [/* @__PURE__ */ G("span", {
|
|
974
974
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
975
975
|
children: e.title
|
|
976
|
-
}), /* @__PURE__ */ G(
|
|
976
|
+
}), /* @__PURE__ */ G(u, { status: e.status })]
|
|
977
977
|
}), /* @__PURE__ */ K("div", {
|
|
978
978
|
className: "mt-1 truncate text-xs text-text-muted",
|
|
979
979
|
children: [
|
|
@@ -985,33 +985,33 @@ function Me() {
|
|
|
985
985
|
e.prizePool ? ` · ${s(e.prizePool, e.currency)} prize` : ""
|
|
986
986
|
]
|
|
987
987
|
})]
|
|
988
|
-
}),
|
|
988
|
+
}), w === e.id ? /* @__PURE__ */ G(Ae, { hackathon: e }) : null] }, e.id))
|
|
989
989
|
})
|
|
990
990
|
]
|
|
991
991
|
});
|
|
992
992
|
}
|
|
993
|
-
function
|
|
994
|
-
let { data: e, loading: t, error: n, refetch: r } =
|
|
995
|
-
|
|
993
|
+
function Pe() {
|
|
994
|
+
let { data: e, loading: t, error: n, refetch: r } = T({}), [a] = g(), [o, s] = P(null), l = e?.tecListMentors.items ?? [], m = l.filter((e) => e.status === "PENDING").length, _ = async (e) => {
|
|
995
|
+
s(e);
|
|
996
996
|
try {
|
|
997
|
-
(await a({ variables: { id: e } })).data?.tecApproveMentor && (
|
|
997
|
+
(await a({ variables: { id: e } })).data?.tecApproveMentor && (h.success("Mentor approved", "They can now accept mentees."), await r());
|
|
998
998
|
} finally {
|
|
999
|
-
|
|
999
|
+
s(null);
|
|
1000
1000
|
}
|
|
1001
1001
|
};
|
|
1002
1002
|
return /* @__PURE__ */ K("div", {
|
|
1003
1003
|
className: "space-y-4",
|
|
1004
|
-
children: [/* @__PURE__ */ G(
|
|
1004
|
+
children: [/* @__PURE__ */ G(Ee, { summary: `${l.length} mentor${l.length === 1 ? "" : "s"}${m ? ` · ${m} pending approval` : ""}` }), t && !l.length ? /* @__PURE__ */ G(p, { count: 4 }) : n ? /* @__PURE__ */ G(f, {
|
|
1005
1005
|
title: "Couldn't load mentors",
|
|
1006
1006
|
error: n
|
|
1007
|
-
}) :
|
|
1007
|
+
}) : l.length === 0 ? /* @__PURE__ */ G(d, {
|
|
1008
1008
|
icon: /* @__PURE__ */ G(U, { size: 26 }),
|
|
1009
1009
|
title: "No mentors yet",
|
|
1010
1010
|
description: "Mentor applications will appear here for review. TechnoSpam is pre-launch."
|
|
1011
1011
|
}) : /* @__PURE__ */ G("div", {
|
|
1012
1012
|
className: "space-y-3",
|
|
1013
|
-
children:
|
|
1014
|
-
leading: /* @__PURE__ */ G(
|
|
1013
|
+
children: l.map((e) => /* @__PURE__ */ K(De, {
|
|
1014
|
+
leading: /* @__PURE__ */ G(we, {
|
|
1015
1015
|
seed: e.headline,
|
|
1016
1016
|
icon: i(e.expertise[0] ?? e.headline, U)
|
|
1017
1017
|
}),
|
|
@@ -1019,7 +1019,7 @@ function Ne() {
|
|
|
1019
1019
|
size: "sm",
|
|
1020
1020
|
onClick: () => _(e.id),
|
|
1021
1021
|
disabled: o === e.id,
|
|
1022
|
-
children: [/* @__PURE__ */ G(
|
|
1022
|
+
children: [/* @__PURE__ */ G(oe, { size: 15 }), " Approve"]
|
|
1023
1023
|
}) : void 0,
|
|
1024
1024
|
children: [/* @__PURE__ */ K("div", {
|
|
1025
1025
|
className: "flex flex-wrap items-center gap-2",
|
|
@@ -1028,7 +1028,7 @@ function Ne() {
|
|
|
1028
1028
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
1029
1029
|
children: e.headline
|
|
1030
1030
|
}),
|
|
1031
|
-
/* @__PURE__ */ G(
|
|
1031
|
+
/* @__PURE__ */ G(u, { status: e.status }),
|
|
1032
1032
|
e.isAcceptingMentees ? /* @__PURE__ */ G(q, {
|
|
1033
1033
|
variant: "secondary",
|
|
1034
1034
|
className: "text-[11px]",
|
|
@@ -1041,7 +1041,7 @@ function Ne() {
|
|
|
1041
1041
|
e.expertise.length ? e.expertise.slice(0, 4).join(", ") : "No expertise listed",
|
|
1042
1042
|
" ·",
|
|
1043
1043
|
" ",
|
|
1044
|
-
|
|
1044
|
+
c(e.hourlyRate, e.currency),
|
|
1045
1045
|
"/hr · ",
|
|
1046
1046
|
e.sessionsCount,
|
|
1047
1047
|
" sessions"
|
|
@@ -1051,7 +1051,7 @@ function Ne() {
|
|
|
1051
1051
|
})]
|
|
1052
1052
|
});
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1054
|
+
function Fe() {
|
|
1055
1055
|
let [t, r] = P("courses"), { currentUser: i } = e(), a = (i?.role ?? "").toLowerCase();
|
|
1056
1056
|
return /* @__PURE__ */ K(n, {
|
|
1057
1057
|
hero: !0,
|
|
@@ -1081,30 +1081,30 @@ function Pe() {
|
|
|
1081
1081
|
children: /* @__PURE__ */ K(fe, {
|
|
1082
1082
|
className: "mb-5",
|
|
1083
1083
|
children: [
|
|
1084
|
-
/* @__PURE__ */ K(
|
|
1084
|
+
/* @__PURE__ */ K(pe, {
|
|
1085
1085
|
value: "courses",
|
|
1086
|
-
children: [/* @__PURE__ */ G(
|
|
1086
|
+
children: [/* @__PURE__ */ G(L, { size: 15 }), " Courses"]
|
|
1087
1087
|
}),
|
|
1088
|
-
/* @__PURE__ */ K(
|
|
1088
|
+
/* @__PURE__ */ K(pe, {
|
|
1089
1089
|
value: "problems",
|
|
1090
|
-
children: [/* @__PURE__ */ G(
|
|
1090
|
+
children: [/* @__PURE__ */ G(R, { size: 15 }), " Problems"]
|
|
1091
1091
|
}),
|
|
1092
|
-
/* @__PURE__ */ K(
|
|
1092
|
+
/* @__PURE__ */ K(pe, {
|
|
1093
1093
|
value: "hackathons",
|
|
1094
1094
|
children: [/* @__PURE__ */ G(H, { size: 15 }), " Hackathons"]
|
|
1095
1095
|
}),
|
|
1096
|
-
/* @__PURE__ */ K(
|
|
1096
|
+
/* @__PURE__ */ K(pe, {
|
|
1097
1097
|
value: "mentors",
|
|
1098
1098
|
children: [/* @__PURE__ */ G(U, { size: 15 }), " Mentors"]
|
|
1099
1099
|
})
|
|
1100
1100
|
]
|
|
1101
1101
|
})
|
|
1102
1102
|
}),
|
|
1103
|
-
G(t === "courses" ?
|
|
1103
|
+
G(t === "courses" ? je : t === "problems" ? Me : t === "hackathons" ? Ne : Pe, {})
|
|
1104
1104
|
]
|
|
1105
1105
|
});
|
|
1106
1106
|
}
|
|
1107
1107
|
//#endregion
|
|
1108
|
-
export {
|
|
1108
|
+
export { Fe as AdminAdminDashboardPagePage };
|
|
1109
1109
|
|
|
1110
1110
|
//# sourceMappingURL=AdminAdminDashboardPagePage.js.map
|