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