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