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