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