@burdenoff/microfe-crewfoundry 2026.704.4 → 2026.704.6
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/crewfoundry/pages/CommunicationsTeamsPagePage.js +1 -1
- package/dist/crewfoundry/pages/CommunicationsTeamsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/DashboardDashboardPagePage.js +4 -4
- package/dist/crewfoundry/pages/DashboardDashboardPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/DashboardEnhancedDashboardPagePage.js +4 -4
- package/dist/crewfoundry/pages/DashboardEnhancedDashboardPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HiringCreateJobPagePage.js +1 -1
- package/dist/crewfoundry/pages/HiringCreateJobPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HiringJobDetailsPagePage.js +57 -53
- package/dist/crewfoundry/pages/HiringJobDetailsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HiringJobsPagePage.js +2 -2
- package/dist/crewfoundry/pages/HiringJobsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HrLeaveManagementPagePage.js +2 -1
- package/dist/crewfoundry/pages/HrLeaveManagementPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/LearningAssessmentsPagePage.js +1 -1
- package/dist/crewfoundry/pages/LearningAssessmentsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/LearningCertificatesPagePage.js +1 -1
- package/dist/crewfoundry/pages/LearningCertificatesPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/LearningCourseDetailsPagePage.js +35 -31
- package/dist/crewfoundry/pages/LearningCourseDetailsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/LearningCourseLearningPagePage.js +2 -2
- package/dist/crewfoundry/pages/LearningCourseLearningPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/LearningCoursesPagePage.js +1 -1
- package/dist/crewfoundry/pages/LearningCoursesPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/LearningLearningPagePage.js +1 -1
- package/dist/crewfoundry/pages/LearningLearningPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.js +30 -26
- package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/LearningLearningPathsPagePage.js +1 -1
- package/dist/crewfoundry/pages/LearningLearningPathsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePageEnhancedPage.js +3 -3
- package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePageEnhancedPage.js.map +1 -1
- package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.js +2 -2
- package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.js.map +1 -1
- package/dist/crewfoundry/pages/MarketplaceMarketplacePagePage.js +1 -1
- package/dist/crewfoundry/pages/MarketplaceMarketplacePagePage.js.map +1 -1
- package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.js +1 -1
- package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/MarketplaceMyServicesPagePage.js +1 -1
- package/dist/crewfoundry/pages/MarketplaceMyServicesPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/MarketplaceProjectDetailsPagePage.js +28 -25
- package/dist/crewfoundry/pages/MarketplaceProjectDetailsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/MarketplaceServiceDetailsPagePage.js +22 -19
- package/dist/crewfoundry/pages/MarketplaceServiceDetailsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/PaymentsPaymentDashboardPagePage.js +1 -1
- package/dist/crewfoundry/pages/PaymentsPaymentDashboardPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/ProjectsCreateProjectPagePage.js +1 -1
- package/dist/crewfoundry/pages/ProjectsCreateProjectPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/ProjectsProjectDetailsPagePage.js +65 -61
- package/dist/crewfoundry/pages/ProjectsProjectDetailsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/ProjectsProjectsPagePage.js +2 -2
- package/dist/crewfoundry/pages/ProjectsProjectsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/TeamsTeamDetailPagePage.js +27 -23
- package/dist/crewfoundry/pages/TeamsTeamDetailPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/TeamsTeamDirectoryPagePage.js +1 -1
- package/dist/crewfoundry/pages/TeamsTeamDirectoryPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/TeamsTeamSettingsPagePage.js +4 -4
- package/dist/crewfoundry/pages/TeamsTeamSettingsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/TeamsTeamsPagePage.js +1 -1
- package/dist/crewfoundry/pages/TeamsTeamsPagePage.js.map +1 -1
- package/dist/crewfoundry/store/crewfoundryStore.js.map +1 -1
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ function s() {
|
|
|
25
25
|
description: "Certificates are issued when a course is completed. Once certificate issuance is available, every credential you earn will appear here with its issue date and verification link.",
|
|
26
26
|
action: /* @__PURE__ */ t(r, {
|
|
27
27
|
variant: "outline",
|
|
28
|
-
onClick: () => s("
|
|
28
|
+
onClick: () => s("../learning/courses-page"),
|
|
29
29
|
children: "Browse courses"
|
|
30
30
|
})
|
|
31
31
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LearningCertificatesPagePage.js","names":[],"sources":["../../../src/crewfoundry/pages/LearningCertificatesPagePage.tsx"],"sourcesContent":["import { Button, GradientText, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useNavigate } from 'react-router-dom';\n\nexport function LearningCertificatesPagePage() {\n const navigate = useNavigate();\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <h1 className=\"text-2xl font-semibold\">\n <GradientText>Certificates</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary\">\n Proof of completed training and validated skills\n </p>\n <PagePurpose className=\"mt-1\">\n View and manage the certificates your team has earned — proof of completed training and\n validated skills.\n </PagePurpose>\n </div>\n\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title=\"No certificates yet\"\n description=\"Certificates are issued when a course is completed. Once certificate issuance is available, every credential you earn will appear here with its issue date and verification link.\"\n action={\n <Button variant=\"outline\" onClick={() => navigate('
|
|
1
|
+
{"version":3,"file":"LearningCertificatesPagePage.js","names":[],"sources":["../../../src/crewfoundry/pages/LearningCertificatesPagePage.tsx"],"sourcesContent":["import { Button, GradientText, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useNavigate } from 'react-router-dom';\n\nexport function LearningCertificatesPagePage() {\n const navigate = useNavigate();\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <h1 className=\"text-2xl font-semibold\">\n <GradientText>Certificates</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary\">\n Proof of completed training and validated skills\n </p>\n <PagePurpose className=\"mt-1\">\n View and manage the certificates your team has earned — proof of completed training and\n validated skills.\n </PagePurpose>\n </div>\n\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title=\"No certificates yet\"\n description=\"Certificates are issued when a course is completed. Once certificate issuance is available, every credential you earn will appear here with its issue date and verification link.\"\n action={\n <Button variant=\"outline\" onClick={() => navigate('../learning/courses-page')}>\n Browse courses\n </Button>\n }\n />\n </div>\n );\n}\n"],"mappings":";;;;AAGA,SAAgB,IAA+B;CAC7C,IAAM,IAAW,GAAa;AAE9B,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD,EAAA,UAAA;GACE,kBAAC,MAAD;IAAI,WAAU;cACZ,kBAAC,GAAD,EAAA,UAAc,gBAA2B,CAAA;IACtC,CAAA;GACL,kBAAC,KAAD;IAAG,WAAU;cAA8B;IAEvC,CAAA;GACJ,kBAAC,GAAD;IAAa,WAAU;cAAO;IAGhB,CAAA;GACV,EAAA,CAAA,EAEN,kBAAC,GAAD;GACE,cAAa;GACb,OAAM;GACN,aAAY;GACZ,QACE,kBAAC,GAAD;IAAQ,SAAQ;IAAU,eAAe,EAAS,2BAA2B;cAAE;IAEtE,CAAA;GAEX,CAAA,CACE"}
|
|
@@ -4,12 +4,16 @@ import { useState as n } from "react";
|
|
|
4
4
|
import { BookOpen as r, Clock as i, GraduationCap as a, Play as o, Star as s, Users as c } from "lucide-react";
|
|
5
5
|
import { useNavigate as l, useSearchParams as u } from "react-router-dom";
|
|
6
6
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
-
import { Badge as p, Button as m, Card as h, CardContent as g, CardHeader as _, CardTitle as v, EmphasisPanel as y, GradientText as b, IllustratedEmptyState as x, NextSteps as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
|
|
8
|
-
import { useGlobalUi as
|
|
7
|
+
import { Badge as p, Button as m, Card as h, CardContent as g, CardHeader as _, CardTitle as v, EmphasisPanel as y, GradientText as b, IllustratedEmptyState as x, NextSteps as S, PagePurpose as C, Spinner as w } from "@burdenoff/fe-libs/ui";
|
|
8
|
+
import { useGlobalUi as T } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
9
|
//#region src/crewfoundry/pages/LearningCourseDetailsPagePage.tsx
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
if (!
|
|
10
|
+
function E() {
|
|
11
|
+
let E = l(), [D] = u(), { courses: O, enrollCourse: k, initialized: A } = e(), { showToast: j } = T(), [M, N] = n(!1), P = D.get("id"), F = P ? O.find((e) => e.id === P) : O[0];
|
|
12
|
+
if (!A && !F) return /* @__PURE__ */ d("div", {
|
|
13
|
+
className: "flex min-h-[60vh] items-center justify-center p-6",
|
|
14
|
+
children: /* @__PURE__ */ d(w, { size: "lg" })
|
|
15
|
+
});
|
|
16
|
+
if (!F) return /* @__PURE__ */ d("div", {
|
|
13
17
|
className: "p-6",
|
|
14
18
|
children: /* @__PURE__ */ d(x, {
|
|
15
19
|
illustration: "empty-search",
|
|
@@ -17,7 +21,7 @@ function T() {
|
|
|
17
21
|
description: "This course is no longer available."
|
|
18
22
|
})
|
|
19
23
|
});
|
|
20
|
-
let
|
|
24
|
+
let I = F.enrolled > 0 ? Math.round(F.completed / F.enrolled * 100) : 0;
|
|
21
25
|
return /* @__PURE__ */ f("div", {
|
|
22
26
|
className: "space-y-6 p-6 max-w-4xl",
|
|
23
27
|
children: [
|
|
@@ -28,19 +32,19 @@ function T() {
|
|
|
28
32
|
className: "flex items-center gap-2 mb-1",
|
|
29
33
|
children: [/* @__PURE__ */ d("h1", {
|
|
30
34
|
className: "text-2xl font-semibold",
|
|
31
|
-
children: /* @__PURE__ */ d(b, { children:
|
|
35
|
+
children: /* @__PURE__ */ d(b, { children: F.title })
|
|
32
36
|
}), /* @__PURE__ */ d(p, {
|
|
33
|
-
variant:
|
|
34
|
-
children: t(
|
|
37
|
+
variant: F.level === "beginner" ? "secondary" : F.level === "intermediate" ? "default" : "destructive",
|
|
38
|
+
children: t(F.level)
|
|
35
39
|
})]
|
|
36
40
|
}),
|
|
37
41
|
/* @__PURE__ */ f("p", {
|
|
38
42
|
className: "text-sm text-text-secondary",
|
|
39
43
|
children: [
|
|
40
44
|
"by ",
|
|
41
|
-
|
|
45
|
+
F.instructor,
|
|
42
46
|
" · ",
|
|
43
|
-
|
|
47
|
+
F.category
|
|
44
48
|
]
|
|
45
49
|
}),
|
|
46
50
|
/* @__PURE__ */ d(C, {
|
|
@@ -49,17 +53,17 @@ function T() {
|
|
|
49
53
|
})
|
|
50
54
|
] }), /* @__PURE__ */ f(m, {
|
|
51
55
|
onClick: async () => {
|
|
52
|
-
|
|
56
|
+
N(!0);
|
|
53
57
|
try {
|
|
54
|
-
await
|
|
58
|
+
await k(F.id), j("Enrolled — your course is ready", "success");
|
|
55
59
|
} catch (e) {
|
|
56
|
-
|
|
60
|
+
j(e instanceof Error ? e.message : "Unable to enroll in course", "error");
|
|
57
61
|
} finally {
|
|
58
|
-
|
|
62
|
+
N(!1);
|
|
59
63
|
}
|
|
60
64
|
},
|
|
61
|
-
disabled:
|
|
62
|
-
children: [/* @__PURE__ */ d(o, { className: "h-4 w-4 mr-1" }),
|
|
65
|
+
disabled: M,
|
|
66
|
+
children: [/* @__PURE__ */ d(o, { className: "h-4 w-4 mr-1" }), M ? "Enrolling…" : "Start Course"]
|
|
63
67
|
})]
|
|
64
68
|
}),
|
|
65
69
|
/* @__PURE__ */ d(S, {
|
|
@@ -70,21 +74,21 @@ function T() {
|
|
|
70
74
|
label: "Start the first module",
|
|
71
75
|
description: "Begin learning and track your progress as you go.",
|
|
72
76
|
icon: /* @__PURE__ */ d(o, { className: "h-4 w-4" }),
|
|
73
|
-
onClick: () =>
|
|
77
|
+
onClick: () => E(`../learning/course-learning-page?id=${encodeURIComponent(F.id)}`)
|
|
74
78
|
},
|
|
75
79
|
{
|
|
76
80
|
id: "my-learning",
|
|
77
81
|
label: "See all your learning",
|
|
78
82
|
description: "Review everything you are currently enrolled in.",
|
|
79
83
|
icon: /* @__PURE__ */ d(a, { className: "h-4 w-4" }),
|
|
80
|
-
onClick: () =>
|
|
84
|
+
onClick: () => E("../learning/my-learning-page")
|
|
81
85
|
},
|
|
82
86
|
{
|
|
83
87
|
id: "browse",
|
|
84
88
|
label: "Browse more courses",
|
|
85
89
|
description: "Find related training to round out your skills.",
|
|
86
90
|
icon: /* @__PURE__ */ d(r, { className: "h-4 w-4" }),
|
|
87
|
-
onClick: () =>
|
|
91
|
+
onClick: () => E("../learning/courses-page")
|
|
88
92
|
}
|
|
89
93
|
]
|
|
90
94
|
}),
|
|
@@ -97,7 +101,7 @@ function T() {
|
|
|
97
101
|
/* @__PURE__ */ d(i, { className: "h-5 w-5 mx-auto text-text-secondary mb-1" }),
|
|
98
102
|
/* @__PURE__ */ d("p", {
|
|
99
103
|
className: "text-lg font-bold",
|
|
100
|
-
children:
|
|
104
|
+
children: F.duration
|
|
101
105
|
}),
|
|
102
106
|
/* @__PURE__ */ d("p", {
|
|
103
107
|
className: "text-xs text-text-secondary",
|
|
@@ -111,7 +115,7 @@ function T() {
|
|
|
111
115
|
/* @__PURE__ */ d(r, { className: "h-5 w-5 mx-auto text-text-secondary mb-1" }),
|
|
112
116
|
/* @__PURE__ */ d("p", {
|
|
113
117
|
className: "text-lg font-bold",
|
|
114
|
-
children:
|
|
118
|
+
children: F.modules
|
|
115
119
|
}),
|
|
116
120
|
/* @__PURE__ */ d("p", {
|
|
117
121
|
className: "text-xs text-text-secondary",
|
|
@@ -125,7 +129,7 @@ function T() {
|
|
|
125
129
|
/* @__PURE__ */ d(c, { className: "h-5 w-5 mx-auto text-text-secondary mb-1" }),
|
|
126
130
|
/* @__PURE__ */ d("p", {
|
|
127
131
|
className: "text-lg font-bold",
|
|
128
|
-
children:
|
|
132
|
+
children: F.enrolled
|
|
129
133
|
}),
|
|
130
134
|
/* @__PURE__ */ d("p", {
|
|
131
135
|
className: "text-xs text-text-secondary",
|
|
@@ -139,7 +143,7 @@ function T() {
|
|
|
139
143
|
/* @__PURE__ */ d(s, { className: "h-5 w-5 mx-auto text-status-warning-text mb-1" }),
|
|
140
144
|
/* @__PURE__ */ f("p", {
|
|
141
145
|
className: "text-lg font-bold",
|
|
142
|
-
children: [
|
|
146
|
+
children: [F.rating, "/5"]
|
|
143
147
|
}),
|
|
144
148
|
/* @__PURE__ */ d("p", {
|
|
145
149
|
className: "text-xs text-text-secondary",
|
|
@@ -156,11 +160,11 @@ function T() {
|
|
|
156
160
|
}),
|
|
157
161
|
/* @__PURE__ */ d("p", {
|
|
158
162
|
className: "text-sm text-text-secondary",
|
|
159
|
-
children:
|
|
163
|
+
children: F.description
|
|
160
164
|
}),
|
|
161
165
|
/* @__PURE__ */ d("div", {
|
|
162
166
|
className: "flex flex-wrap gap-1 mt-3",
|
|
163
|
-
children:
|
|
167
|
+
children: F.skills.map((e) => /* @__PURE__ */ d(p, {
|
|
164
168
|
variant: "outline",
|
|
165
169
|
children: e
|
|
166
170
|
}, e))
|
|
@@ -171,19 +175,19 @@ function T() {
|
|
|
171
175
|
children: [/* @__PURE__ */ f("div", {
|
|
172
176
|
className: "flex justify-between text-sm",
|
|
173
177
|
children: [/* @__PURE__ */ f("span", { children: [
|
|
174
|
-
|
|
178
|
+
F.completed,
|
|
175
179
|
" of ",
|
|
176
|
-
|
|
180
|
+
F.enrolled,
|
|
177
181
|
" students completed"
|
|
178
182
|
] }), /* @__PURE__ */ f("span", {
|
|
179
183
|
className: "font-medium",
|
|
180
|
-
children: [
|
|
184
|
+
children: [I, "%"]
|
|
181
185
|
})]
|
|
182
186
|
}), /* @__PURE__ */ d("div", {
|
|
183
187
|
className: "h-3 bg-bg-sunken rounded overflow-hidden",
|
|
184
188
|
children: /* @__PURE__ */ d("div", {
|
|
185
189
|
className: "h-3 bg-status-success-text rounded",
|
|
186
|
-
style: { width: `${
|
|
190
|
+
style: { width: `${I}%` }
|
|
187
191
|
})
|
|
188
192
|
})]
|
|
189
193
|
}) })] })
|
|
@@ -191,6 +195,6 @@ function T() {
|
|
|
191
195
|
});
|
|
192
196
|
}
|
|
193
197
|
//#endregion
|
|
194
|
-
export {
|
|
198
|
+
export { E as LearningCourseDetailsPagePage };
|
|
195
199
|
|
|
196
200
|
//# sourceMappingURL=LearningCourseDetailsPagePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LearningCourseDetailsPagePage.js","names":[],"sources":["../../../src/crewfoundry/pages/LearningCourseDetailsPagePage.tsx"],"sourcesContent":["import {\n Badge,\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n EmphasisPanel,\n GradientText,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { BookOpen, Clock, GraduationCap, Play, Star, Users } from 'lucide-react';\nimport { useNavigate, useSearchParams } from 'react-router-dom';\nimport { useState } from 'react';\nimport { useGlobalUi } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useCrewFoundryStore } from '../store/crewfoundryStore';\nimport { formatEnumLabel } from '../utils/formatEnumLabel';\n\nexport function LearningCourseDetailsPagePage() {\n const navigate = useNavigate();\n const [searchParams] = useSearchParams();\n const { courses, enrollCourse } = useCrewFoundryStore();\n const { showToast } = useGlobalUi();\n const [enrolling, setEnrolling] = useState(false);\n const courseId = searchParams.get('id');\n const course = courseId ? courses.find((c) => c.id === courseId) : courses[0];\n if (!course)\n return (\n <div className=\"p-6\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title=\"Course not found\"\n description=\"This course is no longer available.\"\n />\n </div>\n );\n const completionRate =\n course.enrolled > 0 ? Math.round((course.completed / course.enrolled) * 100) : 0;\n\n const handleStart = async () => {\n setEnrolling(true);\n try {\n await enrollCourse(course.id);\n showToast('Enrolled — your course is ready', 'success');\n } catch (error) {\n showToast(error instanceof Error ? error.message : 'Unable to enroll in course', 'error');\n } finally {\n setEnrolling(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-4xl\">\n <div className=\"flex items-center justify-between\">\n <div>\n <div className=\"flex items-center gap-2 mb-1\">\n <h1 className=\"text-2xl font-semibold\">\n <GradientText>{course.title}</GradientText>\n </h1>\n <Badge\n variant={\n course.level === 'beginner'\n ? 'secondary'\n : course.level === 'intermediate'\n ? 'default'\n : 'destructive'\n }\n >\n {formatEnumLabel(course.level)}\n </Badge>\n </div>\n <p className=\"text-sm text-text-secondary\">\n by {course.instructor} · {course.category}\n </p>\n <PagePurpose className=\"mt-2\">\n Everything you need to decide on and start this course — what it covers, who it's\n for, and how others have done — so you can enroll with confidence and build the right\n skills.\n </PagePurpose>\n </div>\n <Button onClick={handleStart} disabled={enrolling}>\n <Play className=\"h-4 w-4 mr-1\" />\n {enrolling ? 'Enrolling…' : 'Start Course'}\n </Button>\n </div>\n\n <NextSteps\n storageKey=\"crewfoundry-course-details\"\n steps={[\n {\n id: 'start',\n label: 'Start the first module',\n description: 'Begin learning and track your progress as you go.',\n icon: <Play className=\"h-4 w-4\" />,\n onClick: () =>\n navigate(`../../learning/course-learning-page?id=${encodeURIComponent(course.id)}`),\n },\n {\n id: 'my-learning',\n label: 'See all your learning',\n description: 'Review everything you are currently enrolled in.',\n icon: <GraduationCap className=\"h-4 w-4\" />,\n onClick: () => navigate('../../learning/my-learning-page'),\n },\n {\n id: 'browse',\n label: 'Browse more courses',\n description: 'Find related training to round out your skills.',\n icon: <BookOpen className=\"h-4 w-4\" />,\n onClick: () => navigate('../../learning/courses-page'),\n },\n ]}\n />\n\n <div className=\"grid gap-4 md:grid-cols-4\">\n <Card>\n <CardContent className=\"p-4 text-center\">\n <Clock className=\"h-5 w-5 mx-auto text-text-secondary mb-1\" />\n <p className=\"text-lg font-bold\">{course.duration}</p>\n <p className=\"text-xs text-text-secondary\">Duration</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"p-4 text-center\">\n <BookOpen className=\"h-5 w-5 mx-auto text-text-secondary mb-1\" />\n <p className=\"text-lg font-bold\">{course.modules}</p>\n <p className=\"text-xs text-text-secondary\">Modules</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"p-4 text-center\">\n <Users className=\"h-5 w-5 mx-auto text-text-secondary mb-1\" />\n <p className=\"text-lg font-bold\">{course.enrolled}</p>\n <p className=\"text-xs text-text-secondary\">Enrolled</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"p-4 text-center\">\n <Star className=\"h-5 w-5 mx-auto text-status-warning-text mb-1\" />\n <p className=\"text-lg font-bold\">{course.rating}/5</p>\n <p className=\"text-xs text-text-secondary\">Rating</p>\n </CardContent>\n </Card>\n </div>\n <EmphasisPanel>\n <div className=\"mb-2 text-lg font-semibold\">About this Course</div>\n <p className=\"text-sm text-text-secondary\">{course.description}</p>\n <div className=\"flex flex-wrap gap-1 mt-3\">\n {course.skills.map((s) => (\n <Badge key={s} variant=\"outline\">\n {s}\n </Badge>\n ))}\n </div>\n </EmphasisPanel>\n <Card>\n <CardHeader>\n <CardTitle>Completion Statistics</CardTitle>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-2\">\n <div className=\"flex justify-between text-sm\">\n <span>\n {course.completed} of {course.enrolled} students completed\n </span>\n <span className=\"font-medium\">{completionRate}%</span>\n </div>\n <div className=\"h-3 bg-bg-sunken rounded overflow-hidden\">\n <div\n className=\"h-3 bg-status-success-text rounded\"\n style={{ width: `${completionRate}%` }}\n />\n </div>\n </div>\n </CardContent>\n </Card>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,IAAgC;CAC9C,IAAM,IAAW,GAAa,EACxB,CAAC,KAAgB,GAAiB,EAClC,EAAE,YAAS,oBAAiB,GAAqB,EACjD,EAAE,iBAAc,GAAa,EAC7B,CAAC,GAAW,KAAgB,EAAS,GAAM,EAC3C,IAAW,EAAa,IAAI,KAAK,EACjC,IAAS,IAAW,EAAQ,MAAM,MAAM,EAAE,OAAO,EAAS,GAAG,EAAQ;AAC3E,KAAI,CAAC,EACH,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,cAAa;GACb,OAAM;GACN,aAAY;GACZ,CAAA;EACE,CAAA;CAEV,IAAM,IACJ,EAAO,WAAW,IAAI,KAAK,MAAO,EAAO,YAAY,EAAO,WAAY,IAAI,GAAG;AAcjF,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD,EAAA,UAAA;KACE,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,MAAD;OAAI,WAAU;iBACZ,kBAAC,GAAD,EAAA,UAAe,EAAO,OAAqB,CAAA;OACxC,CAAA,EACL,kBAAC,GAAD;OACE,SACE,EAAO,UAAU,aACb,cACA,EAAO,UAAU,iBACf,YACA;iBAGP,EAAgB,EAAO,MAAM;OACxB,CAAA,CACJ;;KACN,kBAAC,KAAD;MAAG,WAAU;gBAAb;OAA2C;OACrC,EAAO;OAAW;OAAI,EAAO;OAC/B;;KACJ,kBAAC,GAAD;MAAa,WAAU;gBAAO;MAIhB,CAAA;KACV,EAAA,CAA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EAAE,OAAO,GAAG,EAAe,IAAI;MACtC,CAAA;KACE,CAAA,CACF;OACM,CAAA,CACT,EAAA,CAAA;GACH"}
|
|
1
|
+
{"version":3,"file":"LearningCourseDetailsPagePage.js","names":[],"sources":["../../../src/crewfoundry/pages/LearningCourseDetailsPagePage.tsx"],"sourcesContent":["import {\n Badge,\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n EmphasisPanel,\n GradientText,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n Spinner,\n} from '@burdenoff/fe-libs/ui';\nimport { BookOpen, Clock, GraduationCap, Play, Star, Users } from 'lucide-react';\nimport { useNavigate, useSearchParams } from 'react-router-dom';\nimport { useState } from 'react';\nimport { useGlobalUi } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useCrewFoundryStore } from '../store/crewfoundryStore';\nimport { formatEnumLabel } from '../utils/formatEnumLabel';\n\nexport function LearningCourseDetailsPagePage() {\n const navigate = useNavigate();\n const [searchParams] = useSearchParams();\n const { courses, enrollCourse, initialized } = useCrewFoundryStore();\n const { showToast } = useGlobalUi();\n const [enrolling, setEnrolling] = useState(false);\n const courseId = searchParams.get('id');\n const course = courseId ? courses.find((c) => c.id === courseId) : courses[0];\n if (!initialized && !course) {\n return (\n <div className=\"flex min-h-[60vh] items-center justify-center p-6\">\n <Spinner size=\"lg\" />\n </div>\n );\n }\n\n if (!course)\n return (\n <div className=\"p-6\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title=\"Course not found\"\n description=\"This course is no longer available.\"\n />\n </div>\n );\n const completionRate =\n course.enrolled > 0 ? Math.round((course.completed / course.enrolled) * 100) : 0;\n\n const handleStart = async () => {\n setEnrolling(true);\n try {\n await enrollCourse(course.id);\n showToast('Enrolled — your course is ready', 'success');\n } catch (error) {\n showToast(error instanceof Error ? error.message : 'Unable to enroll in course', 'error');\n } finally {\n setEnrolling(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-4xl\">\n <div className=\"flex items-center justify-between\">\n <div>\n <div className=\"flex items-center gap-2 mb-1\">\n <h1 className=\"text-2xl font-semibold\">\n <GradientText>{course.title}</GradientText>\n </h1>\n <Badge\n variant={\n course.level === 'beginner'\n ? 'secondary'\n : course.level === 'intermediate'\n ? 'default'\n : 'destructive'\n }\n >\n {formatEnumLabel(course.level)}\n </Badge>\n </div>\n <p className=\"text-sm text-text-secondary\">\n by {course.instructor} · {course.category}\n </p>\n <PagePurpose className=\"mt-2\">\n Everything you need to decide on and start this course — what it covers, who it's\n for, and how others have done — so you can enroll with confidence and build the right\n skills.\n </PagePurpose>\n </div>\n <Button onClick={handleStart} disabled={enrolling}>\n <Play className=\"h-4 w-4 mr-1\" />\n {enrolling ? 'Enrolling…' : 'Start Course'}\n </Button>\n </div>\n\n <NextSteps\n storageKey=\"crewfoundry-course-details\"\n steps={[\n {\n id: 'start',\n label: 'Start the first module',\n description: 'Begin learning and track your progress as you go.',\n icon: <Play className=\"h-4 w-4\" />,\n onClick: () =>\n navigate(`../learning/course-learning-page?id=${encodeURIComponent(course.id)}`),\n },\n {\n id: 'my-learning',\n label: 'See all your learning',\n description: 'Review everything you are currently enrolled in.',\n icon: <GraduationCap className=\"h-4 w-4\" />,\n onClick: () => navigate('../learning/my-learning-page'),\n },\n {\n id: 'browse',\n label: 'Browse more courses',\n description: 'Find related training to round out your skills.',\n icon: <BookOpen className=\"h-4 w-4\" />,\n onClick: () => navigate('../learning/courses-page'),\n },\n ]}\n />\n\n <div className=\"grid gap-4 md:grid-cols-4\">\n <Card>\n <CardContent className=\"p-4 text-center\">\n <Clock className=\"h-5 w-5 mx-auto text-text-secondary mb-1\" />\n <p className=\"text-lg font-bold\">{course.duration}</p>\n <p className=\"text-xs text-text-secondary\">Duration</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"p-4 text-center\">\n <BookOpen className=\"h-5 w-5 mx-auto text-text-secondary mb-1\" />\n <p className=\"text-lg font-bold\">{course.modules}</p>\n <p className=\"text-xs text-text-secondary\">Modules</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"p-4 text-center\">\n <Users className=\"h-5 w-5 mx-auto text-text-secondary mb-1\" />\n <p className=\"text-lg font-bold\">{course.enrolled}</p>\n <p className=\"text-xs text-text-secondary\">Enrolled</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"p-4 text-center\">\n <Star className=\"h-5 w-5 mx-auto text-status-warning-text mb-1\" />\n <p className=\"text-lg font-bold\">{course.rating}/5</p>\n <p className=\"text-xs text-text-secondary\">Rating</p>\n </CardContent>\n </Card>\n </div>\n <EmphasisPanel>\n <div className=\"mb-2 text-lg font-semibold\">About this Course</div>\n <p className=\"text-sm text-text-secondary\">{course.description}</p>\n <div className=\"flex flex-wrap gap-1 mt-3\">\n {course.skills.map((s) => (\n <Badge key={s} variant=\"outline\">\n {s}\n </Badge>\n ))}\n </div>\n </EmphasisPanel>\n <Card>\n <CardHeader>\n <CardTitle>Completion Statistics</CardTitle>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-2\">\n <div className=\"flex justify-between text-sm\">\n <span>\n {course.completed} of {course.enrolled} students completed\n </span>\n <span className=\"font-medium\">{completionRate}%</span>\n </div>\n <div className=\"h-3 bg-bg-sunken rounded overflow-hidden\">\n <div\n className=\"h-3 bg-status-success-text rounded\"\n style={{ width: `${completionRate}%` }}\n />\n </div>\n </div>\n </CardContent>\n </Card>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAqBA,SAAgB,IAAgC;CAC9C,IAAM,IAAW,GAAa,EACxB,CAAC,KAAgB,GAAiB,EAClC,EAAE,YAAS,iBAAc,mBAAgB,GAAqB,EAC9D,EAAE,iBAAc,GAAa,EAC7B,CAAC,GAAW,KAAgB,EAAS,GAAM,EAC3C,IAAW,EAAa,IAAI,KAAK,EACjC,IAAS,IAAW,EAAQ,MAAM,MAAM,EAAE,OAAO,EAAS,GAAG,EAAQ;AAC3E,KAAI,CAAC,KAAe,CAAC,EACnB,QACE,kBAAC,OAAD;EAAK,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AAC,KAAD;QAAG,WAAU;kBAA8B;QAAU,CAAA;OACzC;SACT,CAAA;KACH;;GACN,kBAAC,GAAD,EAAA,UAAA;IACE,kBAAC,OAAD;KAAK,WAAU;eAA6B;KAAuB,CAAA;IACnE,kBAAC,KAAD;KAAG,WAAU;eAA+B,EAAO;KAAgB,CAAA;IACnE,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAO,OAAO,KAAK,MAClB,kBAAC,GAAD;MAAe,SAAQ;gBACpB;MACK,EAFI,EAEJ,CACR;KACE,CAAA;IACQ,EAAA,CAAA;GAChB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UAAW,yBAAiC,CAAA,EACjC,CAAA,EACb,kBAAC,GAAD,EAAA,UACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,QAAD,EAAA,UAAA;MACG,EAAO;MAAU;MAAK,EAAO;MAAS;MAClC,EAAA,CAAA,EACP,kBAAC,QAAD;MAAM,WAAU;gBAAhB,CAA+B,GAAe,IAAQ;QAClD;QACN,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,OAAD;MACE,WAAU;MACV,OAAO,EAAE,OAAO,GAAG,EAAe,IAAI;MACtC,CAAA;KACE,CAAA,CACF;OACM,CAAA,CACT,EAAA,CAAA;GACH"}
|
|
@@ -100,7 +100,7 @@ function v() {
|
|
|
100
100
|
children: [/* @__PURE__ */ c(i, { className: "mr-1 h-4 w-4" }), "Course details"]
|
|
101
101
|
}), /* @__PURE__ */ c(d, {
|
|
102
102
|
variant: "outline",
|
|
103
|
-
onClick: () => v("
|
|
103
|
+
onClick: () => v("../learning/my-learning-page"),
|
|
104
104
|
children: "My learning"
|
|
105
105
|
})]
|
|
106
106
|
})
|
|
@@ -116,7 +116,7 @@ function v() {
|
|
|
116
116
|
description: "This course is no longer available.",
|
|
117
117
|
action: /* @__PURE__ */ c(d, {
|
|
118
118
|
variant: "outline",
|
|
119
|
-
onClick: () => v("
|
|
119
|
+
onClick: () => v("../learning/courses-page"),
|
|
120
120
|
children: "Browse courses"
|
|
121
121
|
})
|
|
122
122
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LearningCourseLearningPagePage.js","names":[],"sources":["../../../src/crewfoundry/pages/LearningCourseLearningPagePage.tsx"],"sourcesContent":["import {\n Badge,\n Button,\n Card,\n CardContent,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { BookOpen, Clock, GraduationCap, Users } from 'lucide-react';\nimport { useNavigate, useSearchParams } from 'react-router-dom';\nimport { useCrewFoundryStore } from '../store/crewfoundryStore';\nimport { formatEnumLabel } from '../utils/formatEnumLabel';\n\nexport function LearningCourseLearningPagePage() {\n const navigate = useNavigate();\n const [searchParams] = useSearchParams();\n const { courses } = useCrewFoundryStore();\n\n const courseId = searchParams.get('id');\n const course = courseId ? courses.find((c) => c.id === courseId) : courses[0];\n\n if (!course) {\n return (\n <div className=\"p-6\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title=\"Course not found\"\n description=\"This course is no longer available.\"\n action={\n <Button variant=\"outline\" onClick={() => navigate('
|
|
1
|
+
{"version":3,"file":"LearningCourseLearningPagePage.js","names":[],"sources":["../../../src/crewfoundry/pages/LearningCourseLearningPagePage.tsx"],"sourcesContent":["import {\n Badge,\n Button,\n Card,\n CardContent,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { BookOpen, Clock, GraduationCap, Users } from 'lucide-react';\nimport { useNavigate, useSearchParams } from 'react-router-dom';\nimport { useCrewFoundryStore } from '../store/crewfoundryStore';\nimport { formatEnumLabel } from '../utils/formatEnumLabel';\n\nexport function LearningCourseLearningPagePage() {\n const navigate = useNavigate();\n const [searchParams] = useSearchParams();\n const { courses } = useCrewFoundryStore();\n\n const courseId = searchParams.get('id');\n const course = courseId ? courses.find((c) => c.id === courseId) : courses[0];\n\n if (!course) {\n return (\n <div className=\"p-6\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title=\"Course not found\"\n description=\"This course is no longer available.\"\n action={\n <Button variant=\"outline\" onClick={() => navigate('../learning/courses-page')}>\n Browse courses\n </Button>\n }\n />\n </div>\n );\n }\n\n return (\n <div className=\"max-w-3xl space-y-6 p-6\">\n <div>\n <div className=\"flex items-center gap-2\">\n <h1 className=\"text-2xl font-semibold\">\n <GradientText>{course.title}</GradientText>\n </h1>\n <Badge\n variant={\n course.level === 'beginner'\n ? 'secondary'\n : course.level === 'intermediate'\n ? 'default'\n : 'destructive'\n }\n >\n {formatEnumLabel(course.level)}\n </Badge>\n </div>\n <p className=\"text-sm text-text-secondary\">\n by {course.instructor} · {course.category}\n </p>\n <PagePurpose className=\"mt-1\">\n Work through a course lesson-by-lesson — track your progress and complete modules to build\n the skill at hand.\n </PagePurpose>\n </div>\n\n <div className=\"grid gap-4 sm:grid-cols-3\">\n <Card>\n <CardContent className=\"p-4 text-center\">\n <BookOpen className=\"mx-auto mb-1 h-5 w-5 text-text-secondary\" />\n <p className=\"text-lg font-bold\">{course.modules}</p>\n <p className=\"text-xs text-text-secondary\">Modules</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"p-4 text-center\">\n <Clock className=\"mx-auto mb-1 h-5 w-5 text-text-secondary\" />\n <p className=\"text-lg font-bold\">{course.duration}</p>\n <p className=\"text-xs text-text-secondary\">Duration</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"p-4 text-center\">\n <Users className=\"mx-auto mb-1 h-5 w-5 text-text-secondary\" />\n <p className=\"text-lg font-bold\">{course.enrolled}</p>\n <p className=\"text-xs text-text-secondary\">Enrolled</p>\n </CardContent>\n </Card>\n </div>\n\n <GlassCard treatment=\"glass\" glow className=\"border-border-seam\">\n <CardContent className=\"p-6\">\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title=\"Interactive lessons are coming soon\"\n description=\"The lesson player and per-module progress tracking are being built. In the meantime you can enroll from the course page and review what this course covers.\"\n action={\n <div className=\"flex flex-wrap justify-center gap-2\">\n <Button\n variant=\"outline\"\n onClick={() =>\n navigate(\n `../../learning/course-details-page?id=${encodeURIComponent(course.id)}`\n )\n }\n >\n <GraduationCap className=\"mr-1 h-4 w-4\" />\n Course details\n </Button>\n <Button variant=\"outline\" onClick={() => navigate('../learning/my-learning-page')}>\n My learning\n </Button>\n </div>\n }\n />\n </CardContent>\n </GlassCard>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAeA,SAAgB,IAAiC;CAC/C,IAAM,IAAW,GAAa,EACxB,CAAC,KAAgB,GAAiB,EAClC,EAAE,eAAY,GAAqB,EAEnC,IAAW,EAAa,IAAI,KAAK,EACjC,IAAS,IAAW,EAAQ,MAAM,MAAM,EAAE,OAAO,EAAS,GAAG,EAAQ;AAmB3E,QAjBK,IAkBH,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD,EAAA,UAAA;IACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,MAAD;MAAI,WAAU;gBACZ,kBAAC,GAAD,EAAA,UAAe,EAAO,OAAqB,CAAA;MACxC,CAAA,EACL,kBAAC,GAAD;MACE,SACE,EAAO,UAAU,aACb,cACA,EAAO,UAAU,iBACf,YACA;gBAGP,EAAgB,EAAO,MAAM;MACxB,CAAA,CACJ;;IACN,kBAAC,KAAD;KAAG,WAAU;eAAb;MAA2C;MACrC,EAAO;MAAW;MAAI,EAAO;MAC/B;;IACJ,kBAAC,GAAD;KAAa,WAAU;eAAO;KAGhB,CAAA;IACV,EAAA,CAAA;GAEN,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;MAAa,WAAU;gBAAvB;OACE,kBAAC,GAAD,EAAU,WAAU,4CAA6C,CAAA;OACjE,kBAAC,KAAD;QAAG,WAAU;kBAAqB,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 @@ var T = [
|
|
|
98
98
|
}
|
|
99
99
|
];
|
|
100
100
|
function E() {
|
|
101
|
-
let { courses: E, addCourse: D } = e(), O = l(), [k, A] = i(""), j = r(), { page: M, pageSize: N, offset: P, setPage: F } = w({ initialPageSize: 12 }), I = E.filter((e) => `${e.title} ${e.category} ${e.instructor}`.toLowerCase().includes(k.toLowerCase())), L = I.slice(P, P + N), R = (e) => O(
|
|
101
|
+
let { courses: E, addCourse: D } = e(), O = l(), [k, A] = i(""), j = r(), { page: M, pageSize: N, offset: P, setPage: F } = w({ initialPageSize: 12 }), I = E.filter((e) => `${e.title} ${e.category} ${e.instructor}`.toLowerCase().includes(k.toLowerCase())), L = I.slice(P, P + N), R = (e) => O(`../learning/course-details-page?id=${encodeURIComponent(e)}`);
|
|
102
102
|
return /* @__PURE__ */ d("div", {
|
|
103
103
|
className: "space-y-6 p-6",
|
|
104
104
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LearningCoursesPagePage.js","names":[],"sources":["../../../src/crewfoundry/pages/LearningCoursesPagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Badge,\n Button,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n Input,\n PagePurpose,\n Pagination,\n} from '@burdenoff/fe-libs/ui';\nimport { usePagination } from '@burdenoff/fe-libs/shared/hooks';\nimport { Plus, Search, Star, Users } from 'lucide-react';\nimport { useNavigate } from 'react-router-dom';\nimport { useCrewFoundryStore, type LearningCourse } from '../store/crewfoundryStore';\nimport {\n FormModal,\n useFormModal,\n type FieldConfig,\n type FormValues,\n} from '../components/forms/FormModal';\nimport { formatEnumLabel } from '../utils/formatEnumLabel';\n\nconst COURSE_FIELDS: FieldConfig[] = [\n { name: 'title', label: 'Course Title', type: 'text', required: true, colSpan: 2 },\n { name: 'category', label: 'Category', type: 'text', required: true },\n { name: 'instructor', label: 'Instructor', type: 'text', required: true },\n {\n name: 'duration',\n label: 'Duration',\n type: 'text',\n required: true,\n placeholder: 'e.g. 6 weeks',\n },\n { name: 'modules', label: 'Modules', type: 'number', required: true, placeholder: 'e.g. 8' },\n {\n name: 'level',\n label: 'Level',\n type: 'select',\n required: true,\n options: [\n { label: 'Beginner', value: 'beginner' },\n { label: 'Intermediate', value: 'intermediate' },\n { label: 'Advanced', value: 'advanced' },\n ],\n },\n {\n name: 'status',\n label: 'Status',\n type: 'select',\n required: true,\n options: [\n { label: 'Active', value: 'active' },\n { label: 'Draft', value: 'draft' },\n { label: 'Archived', value: 'archived' },\n ],\n },\n { name: 'description', label: 'Description', type: 'textarea', required: true, colSpan: 2 },\n {\n name: 'skills',\n label: 'Skills',\n type: 'tags',\n placeholder: 'Add a skill and press Enter',\n colSpan: 2,\n },\n];\n\nexport function LearningCoursesPagePage() {\n const { courses, addCourse } = useCrewFoundryStore();\n const navigate = useNavigate();\n const [search, setSearch] = useState('');\n const createModal = useFormModal();\n const { page, pageSize, offset, setPage } = usePagination({ initialPageSize: 12 });\n const filtered = courses.filter((c) =>\n `${c.title} ${c.category} ${c.instructor}`.toLowerCase().includes(search.toLowerCase())\n );\n const paged = filtered.slice(offset, offset + pageSize);\n const openCourse = (id: string) =>\n navigate(`../../learning/course-details-page?id=${encodeURIComponent(id)}`);\n\n const handleCreate = async (values: FormValues) => {\n await addCourse({\n id: `course-${Date.now()}`,\n title: String(values.title ?? ''),\n category: String(values.category ?? ''),\n instructor: String(values.instructor ?? ''),\n duration: String(values.duration ?? ''),\n level: String(values.level ?? 'beginner') as LearningCourse['level'],\n enrolled: 0,\n completed: 0,\n rating: 0,\n status: String(values.status ?? 'draft') as LearningCourse['status'],\n description: String(values.description ?? ''),\n modules: typeof values.modules === 'number' ? values.modules : Number(values.modules) || 0,\n skills: Array.isArray(values.skills) ? values.skills : [],\n });\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div>\n <h1 className=\"text-2xl font-semibold\">\n <GradientText>Course Catalog</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary\">{courses.length} courses available</p>\n <PagePurpose className=\"mt-1\">\n Browse the course catalog — find training to grow your team's skills and enroll in\n the programs that fit your goals.\n </PagePurpose>\n </div>\n <Button onClick={() => createModal.openModal()}>\n <Plus className=\"mr-1 h-4 w-4\" />\n Create Course\n </Button>\n </div>\n <div className=\"relative max-w-sm\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary\" />\n <Input\n placeholder=\"Search courses...\"\n className=\"pl-9\"\n value={search}\n onChange={(e) => {\n setSearch(e.target.value);\n setPage(1);\n }}\n />\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-3\">\n {filtered.length === 0 ? (\n <div className=\"col-span-full\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title=\"No courses found\"\n description=\"Try a different search term to find training.\"\n />\n </div>\n ) : (\n paged.map((course, _idx) => (\n <GlassCard\n key={course.id}\n treatment={_idx === 0 ? 'glass' : 'plain'}\n glow={_idx === 0}\n role=\"button\"\n tabIndex={0}\n aria-label={`View ${course.title}`}\n onClick={() => openCourse(course.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n openCourse(course.id);\n }\n }}\n className=\"hover:shadow-md transition-shadow cursor-pointer focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)]\"\n >\n <CardHeader>\n <div className=\"flex items-center justify-between\">\n <Badge variant=\"outline\" className=\"text-[10px]\">\n {course.category}\n </Badge>\n <Badge\n variant={\n course.level === 'beginner'\n ? 'secondary'\n : course.level === 'intermediate'\n ? 'default'\n : 'destructive'\n }\n className=\"text-[10px]\"\n >\n {formatEnumLabel(course.level)}\n </Badge>\n </div>\n <CardTitle className=\"text-base mt-2\">{course.title}</CardTitle>\n <CardDescription>\n {course.instructor} · {course.duration} · {course.modules} modules\n </CardDescription>\n </CardHeader>\n <CardContent>\n <p className=\"text-sm text-text-secondary mb-3\">{course.description}</p>\n <div className=\"flex flex-wrap gap-1 mb-3\">\n {course.skills.map((s) => (\n <Badge key={s} variant=\"outline\" className=\"text-[9px]\">\n {s}\n </Badge>\n ))}\n </div>\n <div className=\"flex items-center justify-between text-xs text-text-secondary\">\n <span className=\"flex items-center gap-1\">\n <Star className=\"h-3 w-3 text-status-warning-text\" />\n {course.rating}\n </span>\n <span className=\"flex items-center gap-1\">\n <Users className=\"h-3 w-3\" />\n {course.enrolled} enrolled\n </span>\n <span>\n {course.enrolled > 0\n ? Math.round((course.completed / course.enrolled) * 100)\n : 0}\n % completion\n </span>\n </div>\n </CardContent>\n </GlassCard>\n ))\n )}\n </div>\n\n {filtered.length > pageSize && (\n <Pagination\n page={page}\n pageSize={pageSize}\n totalItems={filtered.length}\n onPageChange={setPage}\n />\n )}\n\n <FormModal\n open={createModal.open}\n onOpenChange={createModal.onOpenChange}\n title=\"Create Course\"\n description=\"Add a new course to the catalog.\"\n fields={COURSE_FIELDS}\n submitLabel=\"Create Course\"\n onSubmit={handleCreate}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AA2BA,IAAM,IAA+B;CACnC;EAAE,MAAM;EAAS,OAAO;EAAgB,MAAM;EAAQ,UAAU;EAAM,SAAS;EAAG;CAClF;EAAE,MAAM;EAAY,OAAO;EAAY,MAAM;EAAQ,UAAU;EAAM;CACrE;EAAE,MAAM;EAAc,OAAO;EAAc,MAAM;EAAQ,UAAU;EAAM;CACzE;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,UAAU;EACV,aAAa;EACd;CACD;EAAE,MAAM;EAAW,OAAO;EAAW,MAAM;EAAU,UAAU;EAAM,aAAa;EAAU;CAC5F;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,UAAU;EACV,SAAS;GACP;IAAE,OAAO;IAAY,OAAO;IAAY;GACxC;IAAE,OAAO;IAAgB,OAAO;IAAgB;GAChD;IAAE,OAAO;IAAY,OAAO;IAAY;GACzC;E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;;IAmIE,CAAA;GACE"}
|
|
1
|
+
{"version":3,"file":"LearningCoursesPagePage.js","names":[],"sources":["../../../src/crewfoundry/pages/LearningCoursesPagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Badge,\n Button,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n Input,\n PagePurpose,\n Pagination,\n} from '@burdenoff/fe-libs/ui';\nimport { usePagination } from '@burdenoff/fe-libs/shared/hooks';\nimport { Plus, Search, Star, Users } from 'lucide-react';\nimport { useNavigate } from 'react-router-dom';\nimport { useCrewFoundryStore, type LearningCourse } from '../store/crewfoundryStore';\nimport {\n FormModal,\n useFormModal,\n type FieldConfig,\n type FormValues,\n} from '../components/forms/FormModal';\nimport { formatEnumLabel } from '../utils/formatEnumLabel';\n\nconst COURSE_FIELDS: FieldConfig[] = [\n { name: 'title', label: 'Course Title', type: 'text', required: true, colSpan: 2 },\n { name: 'category', label: 'Category', type: 'text', required: true },\n { name: 'instructor', label: 'Instructor', type: 'text', required: true },\n {\n name: 'duration',\n label: 'Duration',\n type: 'text',\n required: true,\n placeholder: 'e.g. 6 weeks',\n },\n { name: 'modules', label: 'Modules', type: 'number', required: true, placeholder: 'e.g. 8' },\n {\n name: 'level',\n label: 'Level',\n type: 'select',\n required: true,\n options: [\n { label: 'Beginner', value: 'beginner' },\n { label: 'Intermediate', value: 'intermediate' },\n { label: 'Advanced', value: 'advanced' },\n ],\n },\n {\n name: 'status',\n label: 'Status',\n type: 'select',\n required: true,\n options: [\n { label: 'Active', value: 'active' },\n { label: 'Draft', value: 'draft' },\n { label: 'Archived', value: 'archived' },\n ],\n },\n { name: 'description', label: 'Description', type: 'textarea', required: true, colSpan: 2 },\n {\n name: 'skills',\n label: 'Skills',\n type: 'tags',\n placeholder: 'Add a skill and press Enter',\n colSpan: 2,\n },\n];\n\nexport function LearningCoursesPagePage() {\n const { courses, addCourse } = useCrewFoundryStore();\n const navigate = useNavigate();\n const [search, setSearch] = useState('');\n const createModal = useFormModal();\n const { page, pageSize, offset, setPage } = usePagination({ initialPageSize: 12 });\n const filtered = courses.filter((c) =>\n `${c.title} ${c.category} ${c.instructor}`.toLowerCase().includes(search.toLowerCase())\n );\n const paged = filtered.slice(offset, offset + pageSize);\n const openCourse = (id: string) =>\n navigate(`../learning/course-details-page?id=${encodeURIComponent(id)}`);\n\n const handleCreate = async (values: FormValues) => {\n await addCourse({\n id: `course-${Date.now()}`,\n title: String(values.title ?? ''),\n category: String(values.category ?? ''),\n instructor: String(values.instructor ?? ''),\n duration: String(values.duration ?? ''),\n level: String(values.level ?? 'beginner') as LearningCourse['level'],\n enrolled: 0,\n completed: 0,\n rating: 0,\n status: String(values.status ?? 'draft') as LearningCourse['status'],\n description: String(values.description ?? ''),\n modules: typeof values.modules === 'number' ? values.modules : Number(values.modules) || 0,\n skills: Array.isArray(values.skills) ? values.skills : [],\n });\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div>\n <h1 className=\"text-2xl font-semibold\">\n <GradientText>Course Catalog</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary\">{courses.length} courses available</p>\n <PagePurpose className=\"mt-1\">\n Browse the course catalog — find training to grow your team's skills and enroll in\n the programs that fit your goals.\n </PagePurpose>\n </div>\n <Button onClick={() => createModal.openModal()}>\n <Plus className=\"mr-1 h-4 w-4\" />\n Create Course\n </Button>\n </div>\n <div className=\"relative max-w-sm\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary\" />\n <Input\n placeholder=\"Search courses...\"\n className=\"pl-9\"\n value={search}\n onChange={(e) => {\n setSearch(e.target.value);\n setPage(1);\n }}\n />\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-3\">\n {filtered.length === 0 ? (\n <div className=\"col-span-full\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title=\"No courses found\"\n description=\"Try a different search term to find training.\"\n />\n </div>\n ) : (\n paged.map((course, _idx) => (\n <GlassCard\n key={course.id}\n treatment={_idx === 0 ? 'glass' : 'plain'}\n glow={_idx === 0}\n role=\"button\"\n tabIndex={0}\n aria-label={`View ${course.title}`}\n onClick={() => openCourse(course.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n openCourse(course.id);\n }\n }}\n className=\"hover:shadow-md transition-shadow cursor-pointer focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)]\"\n >\n <CardHeader>\n <div className=\"flex items-center justify-between\">\n <Badge variant=\"outline\" className=\"text-[10px]\">\n {course.category}\n </Badge>\n <Badge\n variant={\n course.level === 'beginner'\n ? 'secondary'\n : course.level === 'intermediate'\n ? 'default'\n : 'destructive'\n }\n className=\"text-[10px]\"\n >\n {formatEnumLabel(course.level)}\n </Badge>\n </div>\n <CardTitle className=\"text-base mt-2\">{course.title}</CardTitle>\n <CardDescription>\n {course.instructor} · {course.duration} · {course.modules} modules\n </CardDescription>\n </CardHeader>\n <CardContent>\n <p className=\"text-sm text-text-secondary mb-3\">{course.description}</p>\n <div className=\"flex flex-wrap gap-1 mb-3\">\n {course.skills.map((s) => (\n <Badge key={s} variant=\"outline\" className=\"text-[9px]\">\n {s}\n </Badge>\n ))}\n </div>\n <div className=\"flex items-center justify-between text-xs text-text-secondary\">\n <span className=\"flex items-center gap-1\">\n <Star className=\"h-3 w-3 text-status-warning-text\" />\n {course.rating}\n </span>\n <span className=\"flex items-center gap-1\">\n <Users className=\"h-3 w-3\" />\n {course.enrolled} enrolled\n </span>\n <span>\n {course.enrolled > 0\n ? Math.round((course.completed / course.enrolled) * 100)\n : 0}\n % completion\n </span>\n </div>\n </CardContent>\n </GlassCard>\n ))\n )}\n </div>\n\n {filtered.length > pageSize && (\n <Pagination\n page={page}\n pageSize={pageSize}\n totalItems={filtered.length}\n onPageChange={setPage}\n />\n )}\n\n <FormModal\n open={createModal.open}\n onOpenChange={createModal.onOpenChange}\n title=\"Create Course\"\n description=\"Add a new course to the catalog.\"\n fields={COURSE_FIELDS}\n submitLabel=\"Create Course\"\n onSubmit={handleCreate}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AA2BA,IAAM,IAA+B;CACnC;EAAE,MAAM;EAAS,OAAO;EAAgB,MAAM;EAAQ,UAAU;EAAM,SAAS;EAAG;CAClF;EAAE,MAAM;EAAY,OAAO;EAAY,MAAM;EAAQ,UAAU;EAAM;CACrE;EAAE,MAAM;EAAc,OAAO;EAAc,MAAM;EAAQ,UAAU;EAAM;CACzE;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,UAAU;EACV,aAAa;EACd;CACD;EAAE,MAAM;EAAW,OAAO;EAAW,MAAM;EAAU,UAAU;EAAM,aAAa;EAAU;CAC5F;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,UAAU;EACV,SAAS;GACP;IAAE,OAAO;IAAY,OAAO;IAAY;GACxC;IAAE,OAAO;IAAgB,OAAO;IAAgB;GAChD;IAAE,OAAO;IAAY,OAAO;IAAY;GACzC;EACF;CACD;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,UAAU;EACV,SAAS;GACP;IAAE,OAAO;IAAU,OAAO;IAAU;GACpC;IAAE,OAAO;IAAS,OAAO;IAAS;GAClC;IAAE,OAAO;IAAY,OAAO;IAAY;GACzC;EACF;CACD;EAAE,MAAM;EAAe,OAAO;EAAe,MAAM;EAAY,UAAU;EAAM,SAAS;EAAG;CAC3F;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS;EACV;CACF;AAED,SAAgB,IAA0B;CACxC,IAAM,EAAE,YAAS,iBAAc,GAAqB,EAC9C,IAAW,GAAa,EACxB,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,IAAc,GAAc,EAC5B,EAAE,SAAM,aAAU,WAAQ,eAAY,EAAc,EAAE,iBAAiB,IAAI,CAAC,EAC5E,IAAW,EAAQ,QAAQ,MAC/B,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AAD;IACQ;IACI;IACV,YAAY,EAAS;IACrB,cAAc;IACd,CAAA;GAGJ,kBAAC,GAAD;IACE,MAAM,EAAY;IAClB,cAAc,EAAY;IAC1B,OAAM;IACN,aAAY;IACZ,QAAQ;IACR,aAAY;IACZ,UAjJe,OAAO,MAAuB;AACjD,WAAM,EAAU;MACd,IAAI,UAAU,KAAK,KAAK;MACxB,OAAO,OAAO,EAAO,SAAS,GAAG;MACjC,UAAU,OAAO,EAAO,YAAY,GAAG;MACvC,YAAY,OAAO,EAAO,cAAc,GAAG;MAC3C,UAAU,OAAO,EAAO,YAAY,GAAG;MACvC,OAAO,OAAO,EAAO,SAAS,WAAW;MACzC,UAAU;MACV,WAAW;MACX,QAAQ;MACR,QAAQ,OAAO,EAAO,UAAU,QAAQ;MACxC,aAAa,OAAO,EAAO,eAAe,GAAG;MAC7C,SAAS,OAAO,EAAO,WAAY,WAAW,EAAO,UAAU,OAAO,EAAO,QAAQ,IAAI;MACzF,QAAQ,MAAM,QAAQ,EAAO,OAAO,GAAG,EAAO,SAAS,EAAE;MAC1D,CAAC;;IAmIE,CAAA;GACE"}
|
|
@@ -6,7 +6,7 @@ import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
|
6
6
|
import { Badge as u, Card as d, CardContent as f, CardDescription as p, CardHeader as m, CardTitle as h, GlassCard as g, GradientText as _, PagePurpose as v } from "@burdenoff/fe-libs/ui";
|
|
7
7
|
//#region src/crewfoundry/pages/LearningLearningPagePage.tsx
|
|
8
8
|
function y() {
|
|
9
|
-
let y = s(), { courses: b, learningPaths: x } = e(), S = b.reduce((e, t) => e + t.enrolled, 0), C = b.reduce((e, t) => e + t.completed, 0), w = [...b].sort((e, t) => t.rating - e.rating).slice(0, 3), T = (e) => y(
|
|
9
|
+
let y = s(), { courses: b, learningPaths: x } = e(), S = b.reduce((e, t) => e + t.enrolled, 0), C = b.reduce((e, t) => e + t.completed, 0), w = [...b].sort((e, t) => t.rating - e.rating).slice(0, 3), T = (e) => y(`../learning/course-details-page?id=${encodeURIComponent(e)}`), E = (e) => y(`../learning/learning-path-detail-page?id=${encodeURIComponent(e)}`);
|
|
10
10
|
return /* @__PURE__ */ l("div", {
|
|
11
11
|
className: "space-y-6 p-6",
|
|
12
12
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LearningLearningPagePage.js","names":[],"sources":["../../../src/crewfoundry/pages/LearningLearningPagePage.tsx"],"sourcesContent":["import {\n Badge,\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n GlassCard,\n GradientText,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { BookOpen, GraduationCap, Star, TrendingUp, Users } from 'lucide-react';\nimport { useNavigate } from 'react-router-dom';\nimport { useCrewFoundryStore } from '../store/crewfoundryStore';\nimport { formatEnumLabel } from '../utils/formatEnumLabel';\n\nexport function LearningLearningPagePage() {\n const navigate = useNavigate();\n const { courses, learningPaths } = useCrewFoundryStore();\n const totalEnrolled = courses.reduce((s, c) => s + c.enrolled, 0);\n const totalCompleted = courses.reduce((s, c) => s + c.completed, 0);\n const featuredCourses = [...courses].sort((a, b) => b.rating - a.rating).slice(0, 3);\n const openCourse = (id: string) =>\n navigate(`../../learning/course-details-page?id=${encodeURIComponent(id)}`);\n const openPath = (id: string) =>\n navigate(`../../learning/learning-path-detail-page?id=${encodeURIComponent(id)}`);\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <h1 className=\"text-2xl font-semibold\">\n <GradientText>Learning & Development</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary\">\n Explore courses, learning paths, and grow your skills\n </p>\n <PagePurpose className=\"mt-1\">\n Your learning home — discover courses, continue where you left off, and keep developing\n the skills your role needs.\n </PagePurpose>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-4\">\n <GlassCard treatment=\"glass\" glow className=\"border-border-seam\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Courses</CardTitle>\n <BookOpen className=\"h-4 w-4 text-text-secondary\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold tabular-nums\">{courses.length}</div>\n <p className=\"text-xs text-text-secondary\">Active courses</p>\n </CardContent>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"border-border-seam\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Enrolled</CardTitle>\n <Users className=\"h-4 w-4 text-text-secondary\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold tabular-nums\">{totalEnrolled}</div>\n </CardContent>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"border-border-seam\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Completed</CardTitle>\n <GraduationCap className=\"h-4 w-4 text-status-success-text\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold tabular-nums\">{totalCompleted}</div>\n </CardContent>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"border-border-seam\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Paths</CardTitle>\n <TrendingUp className=\"h-4 w-4 text-text-secondary\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold tabular-nums\">{learningPaths.length}</div>\n </CardContent>\n </GlassCard>\n </div>\n <div>\n <h2 className=\"text-lg font-medium mb-3\">Featured Courses</h2>\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-3\">\n {featuredCourses.map((course) => (\n <Card\n key={course.id}\n role=\"button\"\n tabIndex={0}\n aria-label={`View ${course.title}`}\n onClick={() => openCourse(course.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n openCourse(course.id);\n }\n }}\n className=\"cursor-pointer transition-shadow hover:shadow-md focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)]\"\n >\n <CardHeader>\n <CardTitle className=\"text-base\">{course.title}</CardTitle>\n <CardDescription>\n {course.instructor} · {course.duration}\n </CardDescription>\n </CardHeader>\n <CardContent>\n <p className=\"text-sm text-text-secondary mb-3\">{course.description}</p>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-1\">\n <Star className=\"h-3 w-3 text-status-warning-text\" />\n <span className=\"text-sm\">{course.rating}</span>\n </div>\n <div className=\"flex gap-1\">\n <Badge variant=\"outline\" className=\"text-[10px]\">\n {formatEnumLabel(course.level)}\n </Badge>\n <Badge variant=\"outline\" className=\"text-[10px]\">\n {course.category}\n </Badge>\n </div>\n </div>\n <div className=\"mt-2 text-xs text-text-secondary\">\n {course.enrolled} enrolled · {course.completed} completed\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n <div>\n <h2 className=\"text-lg font-medium mb-3\">Learning Paths</h2>\n <div className=\"grid gap-4 md:grid-cols-3\">\n {learningPaths.map((path) => (\n <Card\n key={path.id}\n role=\"button\"\n tabIndex={0}\n aria-label={`View ${path.title}`}\n onClick={() => openPath(path.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n openPath(path.id);\n }\n }}\n className=\"cursor-pointer transition-shadow hover:shadow-md focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)]\"\n >\n <CardHeader>\n <CardTitle className=\"text-base\">{path.title}</CardTitle>\n <CardDescription>{path.description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"flex items-center justify-between text-sm text-text-secondary\">\n <span>\n {path.courses.length} courses · {path.duration}\n </span>\n <Badge variant=\"outline\" className=\"text-[10px]\">\n {formatEnumLabel(path.level)}\n </Badge>\n </div>\n <div className=\"mt-2 space-y-1\">\n <div className=\"flex justify-between text-xs\">\n <span>{path.enrolled} enrolled</span>\n <span>{path.completionRate}%</span>\n </div>\n <div className=\"h-2 bg-bg-sunken rounded overflow-hidden\">\n <div\n className=\"h-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AW,WAAU;gBAAa,EAAK;MAAkB,CAAA,EACzD,kBAAC,GAAD,EAAA,UAAkB,EAAK,aAA8B,CAAA,CAC1C,EAAA,CAAA,EACb,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,QAAD,EAAA,UAAA;OACG,EAAK,QAAQ;OAAO;OAAY,EAAK;OACjC,EAAA,CAAA,EACP,kBAAC,GAAD;OAAO,SAAQ;OAAU,WAAU;iBAChC,EAAgB,EAAK,MAAM;OACtB,CAAA,CACJ;SACN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,QAAD,EAAA,UAAA,CAAO,EAAK,UAAS,YAAgB,EAAA,CAAA,EACrC,kBAAC,QAAD,EAAA,UAAA,CAAO,EAAK,gBAAe,IAAQ,EAAA,CAAA,CAC/B;UACN,kBAAC,OAAD;OAAK,WAAU;iBACb,kBAAC,OAAD;QACE,WAAU;QACV,OAAO,EAAE,OAAO,GAAG,EAAK,eAAe,IAAI;QAC3C,CAAA;OACE,CAAA,CACF;QACM,EAAA,CAAA,CACT;OAvCA,EAAK,GAuCL,CACP;IACE,CAAA,CACF,EAAA,CAAA;GACF"}
|
|
1
|
+
{"version":3,"file":"LearningLearningPagePage.js","names":[],"sources":["../../../src/crewfoundry/pages/LearningLearningPagePage.tsx"],"sourcesContent":["import {\n Badge,\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n GlassCard,\n GradientText,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { BookOpen, GraduationCap, Star, TrendingUp, Users } from 'lucide-react';\nimport { useNavigate } from 'react-router-dom';\nimport { useCrewFoundryStore } from '../store/crewfoundryStore';\nimport { formatEnumLabel } from '../utils/formatEnumLabel';\n\nexport function LearningLearningPagePage() {\n const navigate = useNavigate();\n const { courses, learningPaths } = useCrewFoundryStore();\n const totalEnrolled = courses.reduce((s, c) => s + c.enrolled, 0);\n const totalCompleted = courses.reduce((s, c) => s + c.completed, 0);\n const featuredCourses = [...courses].sort((a, b) => b.rating - a.rating).slice(0, 3);\n const openCourse = (id: string) =>\n navigate(`../learning/course-details-page?id=${encodeURIComponent(id)}`);\n const openPath = (id: string) =>\n navigate(`../learning/learning-path-detail-page?id=${encodeURIComponent(id)}`);\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <h1 className=\"text-2xl font-semibold\">\n <GradientText>Learning & Development</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary\">\n Explore courses, learning paths, and grow your skills\n </p>\n <PagePurpose className=\"mt-1\">\n Your learning home — discover courses, continue where you left off, and keep developing\n the skills your role needs.\n </PagePurpose>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-4\">\n <GlassCard treatment=\"glass\" glow className=\"border-border-seam\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Courses</CardTitle>\n <BookOpen className=\"h-4 w-4 text-text-secondary\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold tabular-nums\">{courses.length}</div>\n <p className=\"text-xs text-text-secondary\">Active courses</p>\n </CardContent>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"border-border-seam\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Enrolled</CardTitle>\n <Users className=\"h-4 w-4 text-text-secondary\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold tabular-nums\">{totalEnrolled}</div>\n </CardContent>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"border-border-seam\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Completed</CardTitle>\n <GraduationCap className=\"h-4 w-4 text-status-success-text\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold tabular-nums\">{totalCompleted}</div>\n </CardContent>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"border-border-seam\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Paths</CardTitle>\n <TrendingUp className=\"h-4 w-4 text-text-secondary\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold tabular-nums\">{learningPaths.length}</div>\n </CardContent>\n </GlassCard>\n </div>\n <div>\n <h2 className=\"text-lg font-medium mb-3\">Featured Courses</h2>\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-3\">\n {featuredCourses.map((course) => (\n <Card\n key={course.id}\n role=\"button\"\n tabIndex={0}\n aria-label={`View ${course.title}`}\n onClick={() => openCourse(course.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n openCourse(course.id);\n }\n }}\n className=\"cursor-pointer transition-shadow hover:shadow-md focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)]\"\n >\n <CardHeader>\n <CardTitle className=\"text-base\">{course.title}</CardTitle>\n <CardDescription>\n {course.instructor} · {course.duration}\n </CardDescription>\n </CardHeader>\n <CardContent>\n <p className=\"text-sm text-text-secondary mb-3\">{course.description}</p>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-1\">\n <Star className=\"h-3 w-3 text-status-warning-text\" />\n <span className=\"text-sm\">{course.rating}</span>\n </div>\n <div className=\"flex gap-1\">\n <Badge variant=\"outline\" className=\"text-[10px]\">\n {formatEnumLabel(course.level)}\n </Badge>\n <Badge variant=\"outline\" className=\"text-[10px]\">\n {course.category}\n </Badge>\n </div>\n </div>\n <div className=\"mt-2 text-xs text-text-secondary\">\n {course.enrolled} enrolled · {course.completed} completed\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n <div>\n <h2 className=\"text-lg font-medium mb-3\">Learning Paths</h2>\n <div className=\"grid gap-4 md:grid-cols-3\">\n {learningPaths.map((path) => (\n <Card\n key={path.id}\n role=\"button\"\n tabIndex={0}\n aria-label={`View ${path.title}`}\n onClick={() => openPath(path.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n openPath(path.id);\n }\n }}\n className=\"cursor-pointer transition-shadow hover:shadow-md focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)]\"\n >\n <CardHeader>\n <CardTitle className=\"text-base\">{path.title}</CardTitle>\n <CardDescription>{path.description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"flex items-center justify-between text-sm text-text-secondary\">\n <span>\n {path.courses.length} courses · {path.duration}\n </span>\n <Badge variant=\"outline\" className=\"text-[10px]\">\n {formatEnumLabel(path.level)}\n </Badge>\n </div>\n <div className=\"mt-2 space-y-1\">\n <div className=\"flex justify-between text-xs\">\n <span>{path.enrolled} enrolled</span>\n <span>{path.completionRate}%</span>\n </div>\n <div className=\"h-2 bg-bg-sunken rounded overflow-hidden\">\n <div\n className=\"h-2 bg-action-primary-bg rounded\"\n style={{ width: `${path.completionRate}%` }}\n />\n </div>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,IAA2B;CACzC,IAAM,IAAW,GAAa,EACxB,EAAE,YAAS,qBAAkB,GAAqB,EAClD,IAAgB,EAAQ,QAAQ,GAAG,MAAM,IAAI,EAAE,UAAU,EAAE,EAC3D,IAAiB,EAAQ,QAAQ,GAAG,MAAM,IAAI,EAAE,WAAW,EAAE,EAC7D,IAAkB,CAAC,GAAG,EAAQ,CAAC,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,GAAG,EAAE,EAC9E,KAAc,MAClB,EAAS,sCAAsC,mBAAmB,EAAG,GAAG,EACpE,KAAY,MAChB,EAAS,4CAA4C,mBAAmB,EAAG,GAAG;AAEhF,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD,EAAA,UAAA;IACE,kBAAC,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,EAAE,OAAO,GAAG,EAAK,eAAe,IAAI;QAC3C,CAAA;OACE,CAAA,CACF;QACM,EAAA,CAAA,CACT;OAvCA,EAAK,GAuCL,CACP;IACE,CAAA,CACF,EAAA,CAAA;GACF"}
|
|
@@ -4,12 +4,16 @@ import { useState as n } from "react";
|
|
|
4
4
|
import { BookOpen as r, CheckCircle as i, Clock as a, Star as o, Users as s } from "lucide-react";
|
|
5
5
|
import { useSearchParams as c } from "react-router-dom";
|
|
6
6
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
-
import { Badge as d, Button as f, Card as p, CardContent as m, EmphasisPanel as h, GradientText as g, IllustratedEmptyState as _, PagePurpose as v } from "@burdenoff/fe-libs/ui";
|
|
8
|
-
import { useGlobalUi as
|
|
7
|
+
import { Badge as d, Button as f, Card as p, CardContent as m, EmphasisPanel as h, GradientText as g, IllustratedEmptyState as _, PagePurpose as v, Spinner as y } from "@burdenoff/fe-libs/ui";
|
|
8
|
+
import { useGlobalUi as b } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
9
|
//#region src/crewfoundry/pages/LearningLearningPathDetailPagePage.tsx
|
|
10
|
-
function
|
|
11
|
-
let [
|
|
12
|
-
if (!
|
|
10
|
+
function x() {
|
|
11
|
+
let [x] = c(), { learningPaths: S, courses: C, enrollCourse: w, initialized: T } = e(), { showToast: E } = b(), [D, O] = n(!1), k = x.get("id"), A = k ? S.find((e) => e.id === k) : S[0];
|
|
12
|
+
if (!T && !A) return /* @__PURE__ */ l("div", {
|
|
13
|
+
className: "flex min-h-[60vh] items-center justify-center p-6",
|
|
14
|
+
children: /* @__PURE__ */ l(y, { size: "lg" })
|
|
15
|
+
});
|
|
16
|
+
if (!A) return /* @__PURE__ */ l("div", {
|
|
13
17
|
className: "p-6",
|
|
14
18
|
children: /* @__PURE__ */ l(_, {
|
|
15
19
|
illustration: "empty-search",
|
|
@@ -17,7 +21,7 @@ function b() {
|
|
|
17
21
|
description: "This learning path is no longer available."
|
|
18
22
|
})
|
|
19
23
|
});
|
|
20
|
-
let
|
|
24
|
+
let j = C.filter((e) => A.courses.includes(e.id));
|
|
21
25
|
return /* @__PURE__ */ u("div", {
|
|
22
26
|
className: "space-y-6 p-6 max-w-4xl",
|
|
23
27
|
children: [
|
|
@@ -26,11 +30,11 @@ function b() {
|
|
|
26
30
|
children: [/* @__PURE__ */ u("div", { children: [
|
|
27
31
|
/* @__PURE__ */ l("h1", {
|
|
28
32
|
className: "text-2xl font-semibold",
|
|
29
|
-
children: /* @__PURE__ */ l(g, { children:
|
|
33
|
+
children: /* @__PURE__ */ l(g, { children: A.title })
|
|
30
34
|
}),
|
|
31
35
|
/* @__PURE__ */ l("p", {
|
|
32
36
|
className: "text-sm text-text-secondary",
|
|
33
|
-
children:
|
|
37
|
+
children: A.description
|
|
34
38
|
}),
|
|
35
39
|
/* @__PURE__ */ l(v, {
|
|
36
40
|
className: "mt-1",
|
|
@@ -38,22 +42,22 @@ function b() {
|
|
|
38
42
|
})
|
|
39
43
|
] }), /* @__PURE__ */ l(f, {
|
|
40
44
|
onClick: async () => {
|
|
41
|
-
if (
|
|
42
|
-
|
|
45
|
+
if (j.length === 0) {
|
|
46
|
+
E("No courses in this path yet", "warning");
|
|
43
47
|
return;
|
|
44
48
|
}
|
|
45
|
-
|
|
49
|
+
O(!0);
|
|
46
50
|
try {
|
|
47
|
-
for (let e of
|
|
48
|
-
|
|
51
|
+
for (let e of j) await w(e.id);
|
|
52
|
+
E(`Enrolled in ${j.length} course${j.length > 1 ? "s" : ""}`, "success");
|
|
49
53
|
} catch (e) {
|
|
50
|
-
|
|
54
|
+
E(e instanceof Error ? e.message : "Unable to enroll in path", "error");
|
|
51
55
|
} finally {
|
|
52
|
-
|
|
56
|
+
O(!1);
|
|
53
57
|
}
|
|
54
58
|
},
|
|
55
|
-
disabled:
|
|
56
|
-
children:
|
|
59
|
+
disabled: D,
|
|
60
|
+
children: D ? "Enrolling…" : "Enroll Now"
|
|
57
61
|
})]
|
|
58
62
|
}),
|
|
59
63
|
/* @__PURE__ */ u("div", {
|
|
@@ -65,7 +69,7 @@ function b() {
|
|
|
65
69
|
/* @__PURE__ */ l(r, { className: "h-5 w-5 mx-auto text-text-secondary mb-1" }),
|
|
66
70
|
/* @__PURE__ */ l("p", {
|
|
67
71
|
className: "text-lg font-bold",
|
|
68
|
-
children:
|
|
72
|
+
children: A.courses.length
|
|
69
73
|
}),
|
|
70
74
|
/* @__PURE__ */ l("p", {
|
|
71
75
|
className: "text-xs text-text-secondary",
|
|
@@ -79,7 +83,7 @@ function b() {
|
|
|
79
83
|
/* @__PURE__ */ l(a, { className: "h-5 w-5 mx-auto text-text-secondary mb-1" }),
|
|
80
84
|
/* @__PURE__ */ l("p", {
|
|
81
85
|
className: "text-lg font-bold",
|
|
82
|
-
children:
|
|
86
|
+
children: A.duration
|
|
83
87
|
}),
|
|
84
88
|
/* @__PURE__ */ l("p", {
|
|
85
89
|
className: "text-xs text-text-secondary",
|
|
@@ -93,7 +97,7 @@ function b() {
|
|
|
93
97
|
/* @__PURE__ */ l(s, { className: "h-5 w-5 mx-auto text-text-secondary mb-1" }),
|
|
94
98
|
/* @__PURE__ */ l("p", {
|
|
95
99
|
className: "text-lg font-bold",
|
|
96
|
-
children:
|
|
100
|
+
children: A.enrolled
|
|
97
101
|
}),
|
|
98
102
|
/* @__PURE__ */ l("p", {
|
|
99
103
|
className: "text-xs text-text-secondary",
|
|
@@ -107,7 +111,7 @@ function b() {
|
|
|
107
111
|
/* @__PURE__ */ l(i, { className: "h-5 w-5 mx-auto text-status-success-text mb-1" }),
|
|
108
112
|
/* @__PURE__ */ u("p", {
|
|
109
113
|
className: "text-lg font-bold",
|
|
110
|
-
children: [
|
|
114
|
+
children: [A.completionRate, "%"]
|
|
111
115
|
}),
|
|
112
116
|
/* @__PURE__ */ l("p", {
|
|
113
117
|
className: "text-xs text-text-secondary",
|
|
@@ -125,18 +129,18 @@ function b() {
|
|
|
125
129
|
/* @__PURE__ */ u("p", {
|
|
126
130
|
className: "mb-4 text-sm text-text-secondary",
|
|
127
131
|
children: [
|
|
128
|
-
|
|
132
|
+
j.length,
|
|
129
133
|
" courses · ",
|
|
130
|
-
|
|
134
|
+
A.level
|
|
131
135
|
]
|
|
132
136
|
}),
|
|
133
137
|
/* @__PURE__ */ l("div", {
|
|
134
138
|
className: "space-y-3",
|
|
135
|
-
children:
|
|
139
|
+
children: j.length === 0 ? /* @__PURE__ */ l(_, {
|
|
136
140
|
illustration: "empty-generic",
|
|
137
141
|
title: "No courses in this path yet",
|
|
138
142
|
description: "Courses added to this path will appear here in order."
|
|
139
|
-
}) :
|
|
143
|
+
}) : j.map((e, n) => /* @__PURE__ */ u("div", {
|
|
140
144
|
className: "flex items-center gap-3 rounded border p-4",
|
|
141
145
|
children: [
|
|
142
146
|
/* @__PURE__ */ l("div", {
|
|
@@ -182,6 +186,6 @@ function b() {
|
|
|
182
186
|
});
|
|
183
187
|
}
|
|
184
188
|
//#endregion
|
|
185
|
-
export {
|
|
189
|
+
export { x as LearningLearningPathDetailPagePage };
|
|
186
190
|
|
|
187
191
|
//# sourceMappingURL=LearningLearningPathDetailPagePage.js.map
|