analytica-frontend-lib 1.2.47 → 1.2.49
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/ActivityCardQuestionBanks/index.css +28 -2
- package/dist/ActivityCardQuestionBanks/index.css.map +1 -1
- package/dist/ActivityCardQuestionPreview/index.css +28 -2
- package/dist/ActivityCardQuestionPreview/index.css.map +1 -1
- package/dist/ActivityDetails/index.css +28 -2
- package/dist/ActivityDetails/index.css.map +1 -1
- package/dist/ActivityFilters/index.css +28 -2
- package/dist/ActivityFilters/index.css.map +1 -1
- package/dist/ActivityPreview/index.css +28 -2
- package/dist/ActivityPreview/index.css.map +1 -1
- package/dist/AlertManager/index.css +28 -2
- package/dist/AlertManager/index.css.map +1 -1
- package/dist/ProgressCircle/index.d.ts.map +1 -1
- package/dist/ProgressCircle/index.js +8 -8
- package/dist/ProgressCircle/index.js.map +1 -1
- package/dist/ProgressCircle/index.mjs +8 -8
- package/dist/ProgressCircle/index.mjs.map +1 -1
- package/dist/RecommendedLessonDetails/index.d.ts +4 -0
- package/dist/RecommendedLessonDetails/index.d.ts.map +1 -0
- package/dist/RecommendedLessonDetails/index.js +2250 -0
- package/dist/RecommendedLessonDetails/index.js.map +1 -0
- package/dist/RecommendedLessonDetails/index.mjs +2242 -0
- package/dist/RecommendedLessonDetails/index.mjs.map +1 -0
- package/dist/RecommendedLessonsHistory/index.css +28 -2
- package/dist/RecommendedLessonsHistory/index.css.map +1 -1
- package/dist/RecommendedLessonsHistory/index.js +3 -5
- package/dist/RecommendedLessonsHistory/index.js.map +1 -1
- package/dist/RecommendedLessonsHistory/index.mjs +3 -5
- package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
- package/dist/SendActivityModal/SendActivityModal.css +19353 -0
- package/dist/SendActivityModal/SendActivityModal.css.map +1 -0
- package/dist/SendActivityModal/SendActivityModal.d.ts +12 -0
- package/dist/SendActivityModal/SendActivityModal.d.ts.map +1 -0
- package/dist/SendActivityModal/SendActivityModal.js +6446 -0
- package/dist/SendActivityModal/SendActivityModal.js.map +1 -0
- package/dist/SendActivityModal/SendActivityModal.mjs +6486 -0
- package/dist/SendActivityModal/SendActivityModal.mjs.map +1 -0
- package/dist/SendActivityModal/hooks/useSendActivityModal.d.ts +43 -0
- package/dist/SendActivityModal/hooks/useSendActivityModal.d.ts.map +1 -0
- package/dist/SendActivityModal/hooks/useSendActivityModal.js +269 -0
- package/dist/SendActivityModal/hooks/useSendActivityModal.js.map +1 -0
- package/dist/SendActivityModal/hooks/useSendActivityModal.mjs +243 -0
- package/dist/SendActivityModal/hooks/useSendActivityModal.mjs.map +1 -0
- package/dist/SendActivityModal/index.css +28 -2
- package/dist/SendActivityModal/index.css.map +1 -1
- package/dist/SendActivityModal/types.d.ts +95 -0
- package/dist/SendActivityModal/types.d.ts.map +1 -0
- package/dist/SendActivityModal/types.js +35 -0
- package/dist/SendActivityModal/types.js.map +1 -0
- package/dist/SendActivityModal/types.mjs +10 -0
- package/dist/SendActivityModal/types.mjs.map +1 -0
- package/dist/SendActivityModal/validation.d.ts +133 -0
- package/dist/SendActivityModal/validation.d.ts.map +1 -0
- package/dist/SendActivityModal/validation.js +178 -0
- package/dist/SendActivityModal/validation.js.map +1 -0
- package/dist/SendActivityModal/validation.mjs +144 -0
- package/dist/SendActivityModal/validation.mjs.map +1 -0
- package/dist/TableProvider/index.css +28 -2
- package/dist/TableProvider/index.css.map +1 -1
- package/dist/hooks/useRecommendedLessonDetails/index.d.ts +780 -0
- package/dist/hooks/useRecommendedLessonDetails/index.d.ts.map +1 -0
- package/dist/hooks/useRecommendedLessonDetails/index.js +204 -0
- package/dist/hooks/useRecommendedLessonDetails/index.js.map +1 -0
- package/dist/hooks/useRecommendedLessonDetails/index.mjs +174 -0
- package/dist/hooks/useRecommendedLessonDetails/index.mjs.map +1 -0
- package/dist/hooks/useRecommendedLessonDetails.d.ts +780 -0
- package/dist/hooks/useRecommendedLessonDetails.d.ts.map +1 -0
- package/dist/index.css +28 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +657 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +645 -10
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +28 -2
- package/dist/styles.css.map +1 -1
- package/dist/types/recommendedLessons/index.d.ts +156 -0
- package/dist/types/recommendedLessons/index.d.ts.map +1 -1
- package/dist/types/recommendedLessons/index.js +47 -2
- package/dist/types/recommendedLessons/index.js.map +1 -1
- package/dist/types/recommendedLessons/index.mjs +41 -1
- package/dist/types/recommendedLessons/index.mjs.map +1 -1
- package/dist/types/recommendedLessons.d.ts +156 -0
- package/dist/types/recommendedLessons.d.ts.map +1 -1
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -143,6 +143,7 @@ __export(src_exports, {
|
|
|
143
143
|
Radio: () => Radio_default,
|
|
144
144
|
RadioGroup: () => RadioGroup,
|
|
145
145
|
RadioGroupItem: () => RadioGroupItem,
|
|
146
|
+
RecommendedLessonDetails: () => RecommendedLessonDetails_default,
|
|
146
147
|
RecommendedLessonsHistory: () => RecommendedLessonsHistory,
|
|
147
148
|
STUDENT_ACTIVITY_STATUS: () => STUDENT_ACTIVITY_STATUS,
|
|
148
149
|
SUBTYPE_ENUM: () => SUBTYPE_ENUM,
|
|
@@ -164,6 +165,7 @@ __export(src_exports, {
|
|
|
164
165
|
SkeletonText: () => SkeletonText,
|
|
165
166
|
StatisticsCard: () => StatisticsCard,
|
|
166
167
|
Stepper: () => Stepper_default,
|
|
168
|
+
StudentLessonStatus: () => StudentLessonStatus,
|
|
167
169
|
SubjectEnum: () => SubjectEnum,
|
|
168
170
|
SubjectInfo: () => SubjectInfo,
|
|
169
171
|
Support: () => Support_default,
|
|
@@ -192,15 +194,19 @@ __export(src_exports, {
|
|
|
192
194
|
createNotificationStore: () => createNotificationStore,
|
|
193
195
|
createNotificationsHook: () => createNotificationsHook,
|
|
194
196
|
createQuestionsListHook: () => createQuestionsListHook,
|
|
197
|
+
createRecommendedLessonDetailsHook: () => createRecommendedLessonDetailsHook,
|
|
195
198
|
createRecommendedLessonsHistoryHook: () => createRecommendedLessonsHistoryHook,
|
|
196
199
|
createUseActivityFiltersData: () => createUseActivityFiltersData,
|
|
197
200
|
createUseNotificationStore: () => createUseNotificationStore,
|
|
198
201
|
createUseNotifications: () => createUseNotifications,
|
|
199
202
|
createUseQuestionsList: () => createUseQuestionsList,
|
|
203
|
+
createUseRecommendedLessonDetails: () => createUseRecommendedLessonDetails,
|
|
200
204
|
createUseRecommendedLessonsHistory: () => createUseRecommendedLessonsHistory,
|
|
201
205
|
createZustandAuthAdapter: () => createZustandAuthAdapter,
|
|
206
|
+
deriveStudentStatus: () => deriveStudentStatus,
|
|
202
207
|
determineGoalStatus: () => determineGoalStatus,
|
|
203
208
|
formatDateToBrazilian: () => formatDateToBrazilian,
|
|
209
|
+
formatDaysToComplete: () => formatDaysToComplete,
|
|
204
210
|
formatFileSize: () => formatFileSize,
|
|
205
211
|
formatQuestionNumbers: () => formatQuestionNumbers,
|
|
206
212
|
formatTimeAgo: () => formatTimeAgo,
|
|
@@ -217,13 +223,19 @@ __export(src_exports, {
|
|
|
217
223
|
getStatusBadgeAction: () => getStatusBadgeAction,
|
|
218
224
|
getStatusBadgeConfig: () => getStatusBadgeConfig,
|
|
219
225
|
getStatusText: () => getStatusText,
|
|
226
|
+
getStudentStatusBadgeAction: () => getStudentStatusBadgeAction,
|
|
220
227
|
getSubjectColorClass: () => getSubjectColorClass,
|
|
221
228
|
getSubjectColorWithOpacity: () => getSubjectColorWithOpacity,
|
|
222
229
|
getSubjectIcon: () => getSubjectIcon,
|
|
223
230
|
getSubjectInfo: () => getSubjectInfo,
|
|
224
231
|
getSubjectName: () => getSubjectName,
|
|
232
|
+
goalApiResponseSchema: () => goalApiResponseSchema,
|
|
233
|
+
goalDetailsApiResponseSchema: () => goalDetailsApiResponseSchema,
|
|
225
234
|
goalsHistoryApiResponseSchema: () => goalsHistoryApiResponseSchema,
|
|
226
235
|
handleGoalFetchError: () => handleGoalFetchError,
|
|
236
|
+
handleLessonDetailsFetchError: () => handleLessonDetailsFetchError,
|
|
237
|
+
historyApiResponseSchema: () => historyApiResponseSchema,
|
|
238
|
+
isDeadlinePassed: () => isDeadlinePassed,
|
|
227
239
|
isFormValid: () => isFormValid,
|
|
228
240
|
isStepValid: () => isStepValid,
|
|
229
241
|
mapApiStatusToInternal: () => mapApiStatusToInternal,
|
|
@@ -3961,7 +3973,7 @@ var AlertsManagerView = ({
|
|
|
3961
3973
|
const handleClose = () => {
|
|
3962
3974
|
onClose?.();
|
|
3963
3975
|
};
|
|
3964
|
-
const
|
|
3976
|
+
const formatDate2 = (dateInput) => {
|
|
3965
3977
|
const date = dateInput instanceof Date ? dateInput : new Date(dateInput);
|
|
3966
3978
|
if (Number.isNaN(date.getTime())) return String(dateInput);
|
|
3967
3979
|
return date.toLocaleDateString("pt-BR", {
|
|
@@ -3995,7 +4007,7 @@ var AlertsManagerView = ({
|
|
|
3995
4007
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Divider_default, { className: "my-4" }),
|
|
3996
4008
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
3997
4009
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-700", children: "Enviado em" }),
|
|
3998
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children:
|
|
4010
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children: formatDate2(alertData.sentAt) })
|
|
3999
4011
|
] }),
|
|
4000
4012
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Divider_default, { className: "my-4" }),
|
|
4001
4013
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Table_default, { variant: "borderless", className: "table-fixed", children: [
|
|
@@ -6090,8 +6102,8 @@ var ProgressBar_default = ProgressBar;
|
|
|
6090
6102
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6091
6103
|
var SIZE_CLASSES9 = {
|
|
6092
6104
|
small: {
|
|
6093
|
-
container: "w-[
|
|
6094
|
-
//
|
|
6105
|
+
container: "w-[107px] h-[107px]",
|
|
6106
|
+
// 107px circle to fit labels like "CONCLUÍDO"
|
|
6095
6107
|
strokeWidth: 4,
|
|
6096
6108
|
// 4px stroke width - matches ProgressBar small (h-1)
|
|
6097
6109
|
textSize: "2xl",
|
|
@@ -6099,13 +6111,13 @@ var SIZE_CLASSES9 = {
|
|
|
6099
6111
|
textWeight: "medium",
|
|
6100
6112
|
// font-weight: 500
|
|
6101
6113
|
labelSize: "2xs",
|
|
6102
|
-
//
|
|
6114
|
+
// 10px for status label
|
|
6103
6115
|
labelWeight: "bold",
|
|
6104
6116
|
// font-weight: 700
|
|
6105
6117
|
spacing: "gap-0",
|
|
6106
6118
|
// Reduced gap between percentage and label for better spacing
|
|
6107
|
-
contentWidth: "max-w-[
|
|
6108
|
-
//
|
|
6119
|
+
contentWidth: "max-w-[85px]"
|
|
6120
|
+
// Width to fit labels like "CONCLUÍDO" inside circle
|
|
6109
6121
|
},
|
|
6110
6122
|
medium: {
|
|
6111
6123
|
container: "w-[152px] h-[152px]",
|
|
@@ -6164,11 +6176,11 @@ var ProgressCircle = ({
|
|
|
6164
6176
|
const percentage = max === 0 ? 0 : clampedValue / max * 100;
|
|
6165
6177
|
const sizeClasses = SIZE_CLASSES9[size];
|
|
6166
6178
|
const variantClasses = VARIANT_CLASSES3[variant];
|
|
6167
|
-
const radius = size === "small" ?
|
|
6179
|
+
const radius = size === "small" ? 49 : 64;
|
|
6168
6180
|
const circumference = 2 * Math.PI * radius;
|
|
6169
6181
|
const strokeDashoffset = circumference - percentage / 100 * circumference;
|
|
6170
|
-
const center = size === "small" ?
|
|
6171
|
-
const svgSize = size === "small" ?
|
|
6182
|
+
const center = size === "small" ? 53.5 : 76;
|
|
6183
|
+
const svgSize = size === "small" ? 107 : 152;
|
|
6172
6184
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
6173
6185
|
"div",
|
|
6174
6186
|
{
|
|
@@ -21099,6 +21111,41 @@ var GOAL_STATUS_OPTIONS = [
|
|
|
21099
21111
|
{ id: "VENCIDA" /* VENCIDA */, name: "Vencida" },
|
|
21100
21112
|
{ id: "CONCLUIDA" /* CONCLUIDA */, name: "Conclu\xEDda" }
|
|
21101
21113
|
];
|
|
21114
|
+
var StudentLessonStatus = /* @__PURE__ */ ((StudentLessonStatus2) => {
|
|
21115
|
+
StudentLessonStatus2["A_INICIAR"] = "A INICIAR";
|
|
21116
|
+
StudentLessonStatus2["EM_ANDAMENTO"] = "EM ANDAMENTO";
|
|
21117
|
+
StudentLessonStatus2["NAO_FINALIZADO"] = "N\xC3O FINALIZADO";
|
|
21118
|
+
StudentLessonStatus2["CONCLUIDO"] = "CONCLU\xCDDO";
|
|
21119
|
+
return StudentLessonStatus2;
|
|
21120
|
+
})(StudentLessonStatus || {});
|
|
21121
|
+
var getStudentStatusBadgeAction = (status) => {
|
|
21122
|
+
const actionMap = {
|
|
21123
|
+
["CONCLU\xCDDO" /* CONCLUIDO */]: "success",
|
|
21124
|
+
["EM ANDAMENTO" /* EM_ANDAMENTO */]: "info",
|
|
21125
|
+
["A INICIAR" /* A_INICIAR */]: "warning",
|
|
21126
|
+
["N\xC3O FINALIZADO" /* NAO_FINALIZADO */]: "error"
|
|
21127
|
+
};
|
|
21128
|
+
return actionMap[status] ?? "warning";
|
|
21129
|
+
};
|
|
21130
|
+
var isDeadlinePassed = (deadline) => {
|
|
21131
|
+
if (!deadline) return false;
|
|
21132
|
+
return new Date(deadline) < /* @__PURE__ */ new Date();
|
|
21133
|
+
};
|
|
21134
|
+
var deriveStudentStatus = (progress, completedAt, deadline) => {
|
|
21135
|
+
if (completedAt) return "CONCLU\xCDDO" /* CONCLUIDO */;
|
|
21136
|
+
if (progress === 100) return "CONCLU\xCDDO" /* CONCLUIDO */;
|
|
21137
|
+
if (isDeadlinePassed(deadline ?? null) && progress < 100) {
|
|
21138
|
+
return "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
|
|
21139
|
+
}
|
|
21140
|
+
if (progress === 0) return "A INICIAR" /* A_INICIAR */;
|
|
21141
|
+
if (progress > 0) return "EM ANDAMENTO" /* EM_ANDAMENTO */;
|
|
21142
|
+
return "A INICIAR" /* A_INICIAR */;
|
|
21143
|
+
};
|
|
21144
|
+
var formatDaysToComplete = (daysToComplete) => {
|
|
21145
|
+
if (daysToComplete === null) return null;
|
|
21146
|
+
if (daysToComplete === 1) return "1 dia";
|
|
21147
|
+
return `${daysToComplete} dias`;
|
|
21148
|
+
};
|
|
21102
21149
|
|
|
21103
21150
|
// src/hooks/useRecommendedLessons.ts
|
|
21104
21151
|
var import_react68 = require("react");
|
|
@@ -21730,6 +21777,594 @@ var RecommendedLessonsHistory = ({
|
|
|
21730
21777
|
}
|
|
21731
21778
|
);
|
|
21732
21779
|
};
|
|
21780
|
+
|
|
21781
|
+
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
21782
|
+
var import_react75 = require("react");
|
|
21783
|
+
|
|
21784
|
+
// src/components/RecommendedLessonDetails/components/Breadcrumb.tsx
|
|
21785
|
+
var import_react70 = require("@phosphor-icons/react");
|
|
21786
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
21787
|
+
var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("nav", { className: "flex items-center gap-2 text-sm", "aria-label": "Breadcrumb", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
21788
|
+
Text_default,
|
|
21789
|
+
{
|
|
21790
|
+
as: "span",
|
|
21791
|
+
className: "flex items-center gap-2",
|
|
21792
|
+
children: [
|
|
21793
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react70.CaretRightIcon, { size: 14, className: "text-text-500" }),
|
|
21794
|
+
item.path ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
21795
|
+
"button",
|
|
21796
|
+
{
|
|
21797
|
+
type: "button",
|
|
21798
|
+
onClick: () => onItemClick?.(item.path),
|
|
21799
|
+
className: "text-text-600 hover:text-primary-700 transition-colors",
|
|
21800
|
+
children: item.label
|
|
21801
|
+
}
|
|
21802
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Text_default, { as: "span", className: "text-text-950 font-medium", children: item.label })
|
|
21803
|
+
]
|
|
21804
|
+
},
|
|
21805
|
+
item.path ?? item.label
|
|
21806
|
+
)) });
|
|
21807
|
+
|
|
21808
|
+
// src/components/RecommendedLessonDetails/components/LessonHeader.tsx
|
|
21809
|
+
var import_react71 = require("@phosphor-icons/react");
|
|
21810
|
+
|
|
21811
|
+
// src/components/RecommendedLessonDetails/utils/lessonDetailsUtils.ts
|
|
21812
|
+
var formatDate = (dateString) => {
|
|
21813
|
+
if (!dateString) return "-";
|
|
21814
|
+
const date = new Date(dateString);
|
|
21815
|
+
if (Number.isNaN(date.getTime())) return "-";
|
|
21816
|
+
return date.toLocaleDateString("pt-BR", {
|
|
21817
|
+
day: "2-digit",
|
|
21818
|
+
month: "2-digit",
|
|
21819
|
+
year: "numeric"
|
|
21820
|
+
});
|
|
21821
|
+
};
|
|
21822
|
+
var transformStudentForDisplay = (student, deadline) => ({
|
|
21823
|
+
id: student.userInstitutionId,
|
|
21824
|
+
name: student.name,
|
|
21825
|
+
status: deriveStudentStatus(student.progress, student.completedAt, deadline),
|
|
21826
|
+
completionPercentage: student.progress,
|
|
21827
|
+
duration: formatDaysToComplete(student.daysToComplete)
|
|
21828
|
+
});
|
|
21829
|
+
|
|
21830
|
+
// src/components/RecommendedLessonDetails/components/LessonHeader.tsx
|
|
21831
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
21832
|
+
var LessonHeader = ({
|
|
21833
|
+
data,
|
|
21834
|
+
onViewLesson,
|
|
21835
|
+
mapSubjectNameToEnum,
|
|
21836
|
+
viewLessonLabel
|
|
21837
|
+
}) => {
|
|
21838
|
+
const { goal, breakdown } = data;
|
|
21839
|
+
const subjectName = goal.lessonsGoals[0]?.supLessonsProgress?.lesson?.subject?.name || "";
|
|
21840
|
+
const subjectEnum = mapSubjectNameToEnum?.(subjectName);
|
|
21841
|
+
const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
|
|
21842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4", children: [
|
|
21843
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
21844
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
21845
|
+
Text_default,
|
|
21846
|
+
{
|
|
21847
|
+
as: "h1",
|
|
21848
|
+
size: "xl",
|
|
21849
|
+
weight: "bold",
|
|
21850
|
+
className: "text-text-950 lg:text-2xl",
|
|
21851
|
+
children: goal.title
|
|
21852
|
+
}
|
|
21853
|
+
),
|
|
21854
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-wrap items-center gap-2 text-sm text-text-600", children: [
|
|
21855
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
21856
|
+
"In\xEDcio em ",
|
|
21857
|
+
formatDate(goal.startDate)
|
|
21858
|
+
] }),
|
|
21859
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
21860
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
21861
|
+
"Prazo final ",
|
|
21862
|
+
formatDate(goal.finalDate)
|
|
21863
|
+
] }),
|
|
21864
|
+
breakdown?.schoolName && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
21865
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
21866
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.schoolName })
|
|
21867
|
+
] }),
|
|
21868
|
+
subjectName && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
21869
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
21870
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Text_default, { as: "span", size: "sm", className: "flex items-center gap-1", children: [
|
|
21871
|
+
subjectInfo && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
21872
|
+
Text_default,
|
|
21873
|
+
{
|
|
21874
|
+
as: "span",
|
|
21875
|
+
className: cn(
|
|
21876
|
+
"size-5 rounded flex items-center justify-center text-white",
|
|
21877
|
+
subjectInfo.colorClass
|
|
21878
|
+
),
|
|
21879
|
+
children: subjectInfo.icon
|
|
21880
|
+
}
|
|
21881
|
+
),
|
|
21882
|
+
subjectName
|
|
21883
|
+
] })
|
|
21884
|
+
] }),
|
|
21885
|
+
breakdown?.className && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
21886
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
21887
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.className })
|
|
21888
|
+
] })
|
|
21889
|
+
] })
|
|
21890
|
+
] }),
|
|
21891
|
+
onViewLesson && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
21892
|
+
Button_default,
|
|
21893
|
+
{
|
|
21894
|
+
variant: "solid",
|
|
21895
|
+
action: "primary",
|
|
21896
|
+
size: "small",
|
|
21897
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react71.BookBookmarkIcon, { size: 16 }),
|
|
21898
|
+
onClick: onViewLesson,
|
|
21899
|
+
children: viewLessonLabel
|
|
21900
|
+
}
|
|
21901
|
+
)
|
|
21902
|
+
] }) });
|
|
21903
|
+
};
|
|
21904
|
+
|
|
21905
|
+
// src/components/RecommendedLessonDetails/components/LoadingSkeleton.tsx
|
|
21906
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
21907
|
+
var LoadingSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
21908
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SkeletonText, { width: 256 }),
|
|
21909
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
21910
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SkeletonText, { width: "75%", height: 28 }),
|
|
21911
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SkeletonText, { width: "50%" })
|
|
21912
|
+
] }) }),
|
|
21913
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
21914
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SkeletonText, { width: 192, height: 20 }),
|
|
21915
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
|
|
21916
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SkeletonRounded, { height: 140 }),
|
|
21917
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SkeletonRounded, { height: 140 }),
|
|
21918
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SkeletonRounded, { height: 140 })
|
|
21919
|
+
] })
|
|
21920
|
+
] }),
|
|
21921
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SkeletonTable, { rows: 4, columns: 5 }) })
|
|
21922
|
+
] });
|
|
21923
|
+
|
|
21924
|
+
// src/components/RecommendedLessonDetails/components/ResultsSection.tsx
|
|
21925
|
+
var import_react72 = require("@phosphor-icons/react");
|
|
21926
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
21927
|
+
var ResultsSection = ({ data, labels }) => {
|
|
21928
|
+
const { details } = data;
|
|
21929
|
+
const { aggregated, contentPerformance } = details;
|
|
21930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
21931
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Text_default, { as: "h2", size: "md", weight: "semibold", className: "text-text-950", children: labels.resultsTitle }),
|
|
21932
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
|
|
21933
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-primary-50", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
21934
|
+
ProgressCircle_default,
|
|
21935
|
+
{
|
|
21936
|
+
value: aggregated.completionPercentage,
|
|
21937
|
+
size: "small",
|
|
21938
|
+
variant: "blue",
|
|
21939
|
+
label: labels.completedLabel,
|
|
21940
|
+
showPercentage: true
|
|
21941
|
+
}
|
|
21942
|
+
) }),
|
|
21943
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-success-200", children: [
|
|
21944
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
21945
|
+
Text_default,
|
|
21946
|
+
{
|
|
21947
|
+
as: "span",
|
|
21948
|
+
className: "size-8 rounded-full flex items-center justify-center bg-warning-300 mb-2",
|
|
21949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react72.TrophyIcon, { size: 18, weight: "fill", className: "text-white" })
|
|
21950
|
+
}
|
|
21951
|
+
),
|
|
21952
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
21953
|
+
Text_default,
|
|
21954
|
+
{
|
|
21955
|
+
size: "2xs",
|
|
21956
|
+
weight: "bold",
|
|
21957
|
+
className: "text-text-700 uppercase text-center leading-none mb-1",
|
|
21958
|
+
children: labels.bestResultLabel
|
|
21959
|
+
}
|
|
21960
|
+
),
|
|
21961
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
21962
|
+
Text_default,
|
|
21963
|
+
{
|
|
21964
|
+
size: "xl",
|
|
21965
|
+
weight: "bold",
|
|
21966
|
+
className: "text-success-700 text-center leading-none tracking-wide",
|
|
21967
|
+
children: contentPerformance.best?.contentName || "-"
|
|
21968
|
+
}
|
|
21969
|
+
)
|
|
21970
|
+
] }),
|
|
21971
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-error-100", children: [
|
|
21972
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
21973
|
+
Text_default,
|
|
21974
|
+
{
|
|
21975
|
+
as: "span",
|
|
21976
|
+
className: "size-8 rounded-full flex items-center justify-center bg-error-300 mb-2",
|
|
21977
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react72.WarningIcon, { size: 18, weight: "fill", className: "text-error-700" })
|
|
21978
|
+
}
|
|
21979
|
+
),
|
|
21980
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
21981
|
+
Text_default,
|
|
21982
|
+
{
|
|
21983
|
+
size: "2xs",
|
|
21984
|
+
weight: "bold",
|
|
21985
|
+
className: "text-text-700 uppercase text-center leading-none mb-1",
|
|
21986
|
+
children: labels.hardestTopicLabel
|
|
21987
|
+
}
|
|
21988
|
+
),
|
|
21989
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
21990
|
+
Text_default,
|
|
21991
|
+
{
|
|
21992
|
+
size: "xl",
|
|
21993
|
+
weight: "bold",
|
|
21994
|
+
className: "text-error-700 text-center leading-none tracking-wide",
|
|
21995
|
+
children: contentPerformance.worst?.contentName || "-"
|
|
21996
|
+
}
|
|
21997
|
+
)
|
|
21998
|
+
] })
|
|
21999
|
+
] }) })
|
|
22000
|
+
] });
|
|
22001
|
+
};
|
|
22002
|
+
|
|
22003
|
+
// src/components/RecommendedLessonDetails/components/StudentsTable.tsx
|
|
22004
|
+
var import_react73 = require("react");
|
|
22005
|
+
var import_react74 = require("@phosphor-icons/react");
|
|
22006
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
22007
|
+
var StudentsTable = ({
|
|
22008
|
+
students,
|
|
22009
|
+
onViewPerformance,
|
|
22010
|
+
labels,
|
|
22011
|
+
emptyMessage = "Nenhum aluno encontrado"
|
|
22012
|
+
}) => {
|
|
22013
|
+
const { sortedData, sortColumn, sortDirection, handleSort } = useTableSort(students);
|
|
22014
|
+
const canViewPerformance = (0, import_react73.useCallback)((student) => {
|
|
22015
|
+
return student.status === "CONCLU\xCDDO" /* CONCLUIDO */ || student.status === "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
|
|
22016
|
+
}, []);
|
|
22017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "bg-background rounded-xl border border-border-50 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Table_default, { children: [
|
|
22018
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(TableRow, { children: [
|
|
22019
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
22020
|
+
TableHead,
|
|
22021
|
+
{
|
|
22022
|
+
sortable: true,
|
|
22023
|
+
sortDirection: sortColumn === "name" ? sortDirection : void 0,
|
|
22024
|
+
onSort: () => handleSort("name"),
|
|
22025
|
+
children: labels.studentColumn
|
|
22026
|
+
}
|
|
22027
|
+
),
|
|
22028
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
22029
|
+
TableHead,
|
|
22030
|
+
{
|
|
22031
|
+
sortable: true,
|
|
22032
|
+
sortDirection: sortColumn === "status" ? sortDirection : void 0,
|
|
22033
|
+
onSort: () => handleSort("status"),
|
|
22034
|
+
children: labels.statusColumn
|
|
22035
|
+
}
|
|
22036
|
+
),
|
|
22037
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
22038
|
+
TableHead,
|
|
22039
|
+
{
|
|
22040
|
+
sortable: true,
|
|
22041
|
+
sortDirection: sortColumn === "completionPercentage" ? sortDirection : void 0,
|
|
22042
|
+
onSort: () => handleSort("completionPercentage"),
|
|
22043
|
+
children: labels.completionColumn
|
|
22044
|
+
}
|
|
22045
|
+
),
|
|
22046
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableHead, { children: labels.durationColumn }),
|
|
22047
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableHead, { className: "w-[140px]" })
|
|
22048
|
+
] }) }),
|
|
22049
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableBody, { children: sortedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableCell, { colSpan: 5, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Text_default, { size: "sm", className: "text-text-500", children: emptyMessage }) }) }) : sortedData.map((student) => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(TableRow, { children: [
|
|
22050
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
22051
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
22052
|
+
Text_default,
|
|
22053
|
+
{
|
|
22054
|
+
as: "span",
|
|
22055
|
+
className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
|
|
22056
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react74.UserIcon, { size: 16, className: "text-text-500" })
|
|
22057
|
+
}
|
|
22058
|
+
),
|
|
22059
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Text_default, { size: "sm", className: "text-text-950", children: student.name })
|
|
22060
|
+
] }) }),
|
|
22061
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
22062
|
+
Badge_default,
|
|
22063
|
+
{
|
|
22064
|
+
variant: "solid",
|
|
22065
|
+
action: getStudentStatusBadgeAction(student.status),
|
|
22066
|
+
size: "small",
|
|
22067
|
+
children: student.status
|
|
22068
|
+
}
|
|
22069
|
+
) }),
|
|
22070
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex flex-col gap-1 min-w-[120px]", children: [
|
|
22071
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Text_default, { size: "sm", className: "text-primary-700 font-medium", children: [
|
|
22072
|
+
student.completionPercentage,
|
|
22073
|
+
"%"
|
|
22074
|
+
] }),
|
|
22075
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
22076
|
+
ProgressBar_default,
|
|
22077
|
+
{
|
|
22078
|
+
value: student.completionPercentage,
|
|
22079
|
+
size: "small",
|
|
22080
|
+
variant: "blue",
|
|
22081
|
+
className: "w-full max-w-[100px]"
|
|
22082
|
+
}
|
|
22083
|
+
)
|
|
22084
|
+
] }) }),
|
|
22085
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Text_default, { size: "sm", className: "text-text-700", children: student.duration ?? "-" }) }),
|
|
22086
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TableCell, { children: canViewPerformance(student) ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
22087
|
+
Button_default,
|
|
22088
|
+
{
|
|
22089
|
+
variant: "outline",
|
|
22090
|
+
size: "extra-small",
|
|
22091
|
+
onClick: () => onViewPerformance?.(student.id),
|
|
22092
|
+
children: labels.viewPerformance
|
|
22093
|
+
}
|
|
22094
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Button_default, { variant: "outline", size: "extra-small", disabled: true, children: labels.viewPerformance }) })
|
|
22095
|
+
] }, student.id)) })
|
|
22096
|
+
] }) });
|
|
22097
|
+
};
|
|
22098
|
+
|
|
22099
|
+
// src/components/RecommendedLessonDetails/types.ts
|
|
22100
|
+
var DEFAULT_LABELS = {
|
|
22101
|
+
viewLesson: "Ver aula",
|
|
22102
|
+
viewPerformance: "Ver desempenho",
|
|
22103
|
+
resultsTitle: "Resultados da aula recomendada",
|
|
22104
|
+
completedLabel: "CONCLU\xCDDO",
|
|
22105
|
+
bestResultLabel: "MELHOR RESULTADO",
|
|
22106
|
+
hardestTopicLabel: "MAIOR DIFICULDADE",
|
|
22107
|
+
studentColumn: "Aluno",
|
|
22108
|
+
statusColumn: "Status",
|
|
22109
|
+
completionColumn: "Conclus\xE3o",
|
|
22110
|
+
durationColumn: "Dura\xE7\xE3o"
|
|
22111
|
+
};
|
|
22112
|
+
|
|
22113
|
+
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
22114
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
22115
|
+
var RecommendedLessonDetails = ({
|
|
22116
|
+
data,
|
|
22117
|
+
loading = false,
|
|
22118
|
+
error = null,
|
|
22119
|
+
onViewLesson,
|
|
22120
|
+
onViewStudentPerformance,
|
|
22121
|
+
onBreadcrumbClick,
|
|
22122
|
+
mapSubjectNameToEnum,
|
|
22123
|
+
breadcrumbs,
|
|
22124
|
+
labels: customLabels,
|
|
22125
|
+
className
|
|
22126
|
+
}) => {
|
|
22127
|
+
const labels = (0, import_react75.useMemo)(
|
|
22128
|
+
() => ({ ...DEFAULT_LABELS, ...customLabels }),
|
|
22129
|
+
[customLabels]
|
|
22130
|
+
);
|
|
22131
|
+
const defaultBreadcrumbs = (0, import_react75.useMemo)(
|
|
22132
|
+
() => [
|
|
22133
|
+
{ label: "Aulas recomendadas", path: "/aulas-recomendadas" },
|
|
22134
|
+
{ label: data?.goal.title || "Detalhes" }
|
|
22135
|
+
],
|
|
22136
|
+
[data?.goal.title]
|
|
22137
|
+
);
|
|
22138
|
+
const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
|
|
22139
|
+
const displayStudents = (0, import_react75.useMemo)(() => {
|
|
22140
|
+
if (!data?.details.students) return [];
|
|
22141
|
+
const deadline = data?.goal.finalDate;
|
|
22142
|
+
return data.details.students.map(
|
|
22143
|
+
(student) => transformStudentForDisplay(student, deadline)
|
|
22144
|
+
);
|
|
22145
|
+
}, [data?.details.students, data?.goal.finalDate]);
|
|
22146
|
+
if (loading) {
|
|
22147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
22148
|
+
"div",
|
|
22149
|
+
{
|
|
22150
|
+
className: cn("flex flex-col gap-6", className),
|
|
22151
|
+
"data-testid": "lesson-details-loading",
|
|
22152
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(LoadingSkeleton, {})
|
|
22153
|
+
}
|
|
22154
|
+
);
|
|
22155
|
+
}
|
|
22156
|
+
if (error) {
|
|
22157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
22158
|
+
"div",
|
|
22159
|
+
{
|
|
22160
|
+
className: cn(
|
|
22161
|
+
"flex flex-col items-center justify-center py-12",
|
|
22162
|
+
className
|
|
22163
|
+
),
|
|
22164
|
+
"data-testid": "lesson-details-error",
|
|
22165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Text_default, { size: "md", className: "text-error-700", children: error })
|
|
22166
|
+
}
|
|
22167
|
+
);
|
|
22168
|
+
}
|
|
22169
|
+
if (!data) {
|
|
22170
|
+
return null;
|
|
22171
|
+
}
|
|
22172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
22173
|
+
"div",
|
|
22174
|
+
{
|
|
22175
|
+
className: cn("flex flex-col gap-6", className),
|
|
22176
|
+
"data-testid": "recommended-lesson-details",
|
|
22177
|
+
children: [
|
|
22178
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
|
|
22179
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
22180
|
+
LessonHeader,
|
|
22181
|
+
{
|
|
22182
|
+
data,
|
|
22183
|
+
onViewLesson,
|
|
22184
|
+
mapSubjectNameToEnum,
|
|
22185
|
+
viewLessonLabel: labels.viewLesson
|
|
22186
|
+
}
|
|
22187
|
+
),
|
|
22188
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ResultsSection, { data, labels }),
|
|
22189
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
22190
|
+
StudentsTable,
|
|
22191
|
+
{
|
|
22192
|
+
students: displayStudents,
|
|
22193
|
+
onViewPerformance: onViewStudentPerformance,
|
|
22194
|
+
labels
|
|
22195
|
+
}
|
|
22196
|
+
)
|
|
22197
|
+
]
|
|
22198
|
+
}
|
|
22199
|
+
);
|
|
22200
|
+
};
|
|
22201
|
+
var RecommendedLessonDetails_default = RecommendedLessonDetails;
|
|
22202
|
+
|
|
22203
|
+
// src/hooks/useRecommendedLessonDetails.ts
|
|
22204
|
+
var import_react76 = require("react");
|
|
22205
|
+
var import_zod5 = require("zod");
|
|
22206
|
+
var goalLessonSubjectSchema = import_zod5.z.object({
|
|
22207
|
+
id: import_zod5.z.string(),
|
|
22208
|
+
name: import_zod5.z.string(),
|
|
22209
|
+
color: import_zod5.z.string(),
|
|
22210
|
+
icon: import_zod5.z.string()
|
|
22211
|
+
});
|
|
22212
|
+
var lessonContentSchema = import_zod5.z.object({
|
|
22213
|
+
id: import_zod5.z.string(),
|
|
22214
|
+
name: import_zod5.z.string()
|
|
22215
|
+
});
|
|
22216
|
+
var goalLessonSchema = import_zod5.z.object({
|
|
22217
|
+
id: import_zod5.z.string(),
|
|
22218
|
+
content: lessonContentSchema,
|
|
22219
|
+
subtopic: lessonContentSchema,
|
|
22220
|
+
topic: lessonContentSchema,
|
|
22221
|
+
subject: goalLessonSubjectSchema
|
|
22222
|
+
});
|
|
22223
|
+
var goalLessonProgressSchema = import_zod5.z.object({
|
|
22224
|
+
id: import_zod5.z.string(),
|
|
22225
|
+
userId: import_zod5.z.string(),
|
|
22226
|
+
lessonId: import_zod5.z.string(),
|
|
22227
|
+
progress: import_zod5.z.number(),
|
|
22228
|
+
lesson: goalLessonSchema
|
|
22229
|
+
});
|
|
22230
|
+
var goalLessonGoalItemSchema = import_zod5.z.object({
|
|
22231
|
+
goalId: import_zod5.z.string(),
|
|
22232
|
+
supLessonsProgressId: import_zod5.z.string(),
|
|
22233
|
+
supLessonsProgress: goalLessonProgressSchema
|
|
22234
|
+
});
|
|
22235
|
+
var goalMetadataSchema = import_zod5.z.object({
|
|
22236
|
+
id: import_zod5.z.string(),
|
|
22237
|
+
title: import_zod5.z.string(),
|
|
22238
|
+
startDate: import_zod5.z.string(),
|
|
22239
|
+
finalDate: import_zod5.z.string(),
|
|
22240
|
+
progress: import_zod5.z.number(),
|
|
22241
|
+
lessonsGoals: import_zod5.z.array(goalLessonGoalItemSchema)
|
|
22242
|
+
});
|
|
22243
|
+
var goalApiResponseSchema = import_zod5.z.object({
|
|
22244
|
+
message: import_zod5.z.string(),
|
|
22245
|
+
data: goalMetadataSchema
|
|
22246
|
+
});
|
|
22247
|
+
var goalDetailStudentSchema = import_zod5.z.object({
|
|
22248
|
+
userInstitutionId: import_zod5.z.string(),
|
|
22249
|
+
userId: import_zod5.z.string(),
|
|
22250
|
+
name: import_zod5.z.string(),
|
|
22251
|
+
progress: import_zod5.z.number(),
|
|
22252
|
+
completedAt: import_zod5.z.string().nullable(),
|
|
22253
|
+
avgScore: import_zod5.z.number().nullable(),
|
|
22254
|
+
daysToComplete: import_zod5.z.number().nullable()
|
|
22255
|
+
});
|
|
22256
|
+
var goalDetailAggregatedSchema = import_zod5.z.object({
|
|
22257
|
+
completionPercentage: import_zod5.z.number(),
|
|
22258
|
+
avgScore: import_zod5.z.number().nullable()
|
|
22259
|
+
});
|
|
22260
|
+
var goalDetailContentPerformanceItemSchema = import_zod5.z.object({
|
|
22261
|
+
contentId: import_zod5.z.string(),
|
|
22262
|
+
contentName: import_zod5.z.string(),
|
|
22263
|
+
rate: import_zod5.z.number()
|
|
22264
|
+
}).nullable();
|
|
22265
|
+
var goalDetailContentPerformanceSchema = import_zod5.z.object({
|
|
22266
|
+
best: goalDetailContentPerformanceItemSchema,
|
|
22267
|
+
worst: goalDetailContentPerformanceItemSchema
|
|
22268
|
+
});
|
|
22269
|
+
var goalDetailsDataSchema = import_zod5.z.object({
|
|
22270
|
+
students: import_zod5.z.array(goalDetailStudentSchema),
|
|
22271
|
+
aggregated: goalDetailAggregatedSchema,
|
|
22272
|
+
contentPerformance: goalDetailContentPerformanceSchema
|
|
22273
|
+
});
|
|
22274
|
+
var goalDetailsApiResponseSchema = import_zod5.z.object({
|
|
22275
|
+
message: import_zod5.z.string(),
|
|
22276
|
+
data: goalDetailsDataSchema
|
|
22277
|
+
});
|
|
22278
|
+
var goalBreakdownSchema2 = import_zod5.z.object({
|
|
22279
|
+
classId: import_zod5.z.string().uuid(),
|
|
22280
|
+
className: import_zod5.z.string(),
|
|
22281
|
+
schoolId: import_zod5.z.string(),
|
|
22282
|
+
schoolName: import_zod5.z.string(),
|
|
22283
|
+
studentCount: import_zod5.z.number(),
|
|
22284
|
+
completedCount: import_zod5.z.number()
|
|
22285
|
+
});
|
|
22286
|
+
var historyGoalItemSchema = import_zod5.z.object({
|
|
22287
|
+
goal: import_zod5.z.object({ id: import_zod5.z.string().uuid() }),
|
|
22288
|
+
breakdown: import_zod5.z.array(goalBreakdownSchema2)
|
|
22289
|
+
});
|
|
22290
|
+
var historyApiResponseSchema = import_zod5.z.object({
|
|
22291
|
+
message: import_zod5.z.string(),
|
|
22292
|
+
data: import_zod5.z.object({
|
|
22293
|
+
goals: import_zod5.z.array(historyGoalItemSchema),
|
|
22294
|
+
total: import_zod5.z.number()
|
|
22295
|
+
})
|
|
22296
|
+
});
|
|
22297
|
+
var handleLessonDetailsFetchError = (error) => {
|
|
22298
|
+
if (error instanceof import_zod5.z.ZodError) {
|
|
22299
|
+
console.error("Erro ao validar dados dos detalhes da aula:", error);
|
|
22300
|
+
return "Erro ao validar dados dos detalhes da aula";
|
|
22301
|
+
}
|
|
22302
|
+
console.error("Erro ao carregar detalhes da aula:", error);
|
|
22303
|
+
return "Erro ao carregar detalhes da aula";
|
|
22304
|
+
};
|
|
22305
|
+
var createUseRecommendedLessonDetails = (apiClient) => {
|
|
22306
|
+
return (lessonId) => {
|
|
22307
|
+
const [state, setState] = (0, import_react76.useState)({
|
|
22308
|
+
data: null,
|
|
22309
|
+
loading: true,
|
|
22310
|
+
error: null
|
|
22311
|
+
});
|
|
22312
|
+
const fetchLessonDetails = (0, import_react76.useCallback)(async () => {
|
|
22313
|
+
if (!lessonId) {
|
|
22314
|
+
setState({
|
|
22315
|
+
data: null,
|
|
22316
|
+
loading: false,
|
|
22317
|
+
error: "ID da aula n\xE3o encontrado"
|
|
22318
|
+
});
|
|
22319
|
+
return;
|
|
22320
|
+
}
|
|
22321
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
22322
|
+
try {
|
|
22323
|
+
const promises = [
|
|
22324
|
+
apiClient.fetchGoal(lessonId),
|
|
22325
|
+
apiClient.fetchGoalDetails(lessonId),
|
|
22326
|
+
apiClient.fetchBreakdown ? apiClient.fetchBreakdown(lessonId) : Promise.resolve(null)
|
|
22327
|
+
];
|
|
22328
|
+
const [goalResponse, detailsResponse, historyResponse] = await Promise.all(promises);
|
|
22329
|
+
const validatedGoal = goalApiResponseSchema.parse(goalResponse);
|
|
22330
|
+
const validatedDetails = goalDetailsApiResponseSchema.parse(detailsResponse);
|
|
22331
|
+
let breakdown;
|
|
22332
|
+
if (historyResponse) {
|
|
22333
|
+
const validatedHistory = historyApiResponseSchema.parse(historyResponse);
|
|
22334
|
+
const historyItem = validatedHistory.data.goals.find(
|
|
22335
|
+
(g) => g.goal.id === lessonId
|
|
22336
|
+
);
|
|
22337
|
+
breakdown = historyItem?.breakdown[0];
|
|
22338
|
+
}
|
|
22339
|
+
const lessonData = {
|
|
22340
|
+
goal: validatedGoal.data,
|
|
22341
|
+
details: validatedDetails.data,
|
|
22342
|
+
breakdown
|
|
22343
|
+
};
|
|
22344
|
+
setState({
|
|
22345
|
+
data: lessonData,
|
|
22346
|
+
loading: false,
|
|
22347
|
+
error: null
|
|
22348
|
+
});
|
|
22349
|
+
} catch (error) {
|
|
22350
|
+
const errorMessage = handleLessonDetailsFetchError(error);
|
|
22351
|
+
setState({
|
|
22352
|
+
data: null,
|
|
22353
|
+
loading: false,
|
|
22354
|
+
error: errorMessage
|
|
22355
|
+
});
|
|
22356
|
+
}
|
|
22357
|
+
}, [lessonId]);
|
|
22358
|
+
(0, import_react76.useEffect)(() => {
|
|
22359
|
+
fetchLessonDetails();
|
|
22360
|
+
}, [fetchLessonDetails]);
|
|
22361
|
+
return {
|
|
22362
|
+
...state,
|
|
22363
|
+
refetch: fetchLessonDetails
|
|
22364
|
+
};
|
|
22365
|
+
};
|
|
22366
|
+
};
|
|
22367
|
+
var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
21733
22368
|
// Annotate the CommonJS export names for ESM import in node:
|
|
21734
22369
|
0 && (module.exports = {
|
|
21735
22370
|
ACTIVITY_AVAILABILITY,
|
|
@@ -21845,6 +22480,7 @@ var RecommendedLessonsHistory = ({
|
|
|
21845
22480
|
Radio,
|
|
21846
22481
|
RadioGroup,
|
|
21847
22482
|
RadioGroupItem,
|
|
22483
|
+
RecommendedLessonDetails,
|
|
21848
22484
|
RecommendedLessonsHistory,
|
|
21849
22485
|
STUDENT_ACTIVITY_STATUS,
|
|
21850
22486
|
SUBTYPE_ENUM,
|
|
@@ -21866,6 +22502,7 @@ var RecommendedLessonsHistory = ({
|
|
|
21866
22502
|
SkeletonText,
|
|
21867
22503
|
StatisticsCard,
|
|
21868
22504
|
Stepper,
|
|
22505
|
+
StudentLessonStatus,
|
|
21869
22506
|
SubjectEnum,
|
|
21870
22507
|
SubjectInfo,
|
|
21871
22508
|
Support,
|
|
@@ -21894,15 +22531,19 @@ var RecommendedLessonsHistory = ({
|
|
|
21894
22531
|
createNotificationStore,
|
|
21895
22532
|
createNotificationsHook,
|
|
21896
22533
|
createQuestionsListHook,
|
|
22534
|
+
createRecommendedLessonDetailsHook,
|
|
21897
22535
|
createRecommendedLessonsHistoryHook,
|
|
21898
22536
|
createUseActivityFiltersData,
|
|
21899
22537
|
createUseNotificationStore,
|
|
21900
22538
|
createUseNotifications,
|
|
21901
22539
|
createUseQuestionsList,
|
|
22540
|
+
createUseRecommendedLessonDetails,
|
|
21902
22541
|
createUseRecommendedLessonsHistory,
|
|
21903
22542
|
createZustandAuthAdapter,
|
|
22543
|
+
deriveStudentStatus,
|
|
21904
22544
|
determineGoalStatus,
|
|
21905
22545
|
formatDateToBrazilian,
|
|
22546
|
+
formatDaysToComplete,
|
|
21906
22547
|
formatFileSize,
|
|
21907
22548
|
formatQuestionNumbers,
|
|
21908
22549
|
formatTimeAgo,
|
|
@@ -21919,13 +22560,19 @@ var RecommendedLessonsHistory = ({
|
|
|
21919
22560
|
getStatusBadgeAction,
|
|
21920
22561
|
getStatusBadgeConfig,
|
|
21921
22562
|
getStatusText,
|
|
22563
|
+
getStudentStatusBadgeAction,
|
|
21922
22564
|
getSubjectColorClass,
|
|
21923
22565
|
getSubjectColorWithOpacity,
|
|
21924
22566
|
getSubjectIcon,
|
|
21925
22567
|
getSubjectInfo,
|
|
21926
22568
|
getSubjectName,
|
|
22569
|
+
goalApiResponseSchema,
|
|
22570
|
+
goalDetailsApiResponseSchema,
|
|
21927
22571
|
goalsHistoryApiResponseSchema,
|
|
21928
22572
|
handleGoalFetchError,
|
|
22573
|
+
handleLessonDetailsFetchError,
|
|
22574
|
+
historyApiResponseSchema,
|
|
22575
|
+
isDeadlinePassed,
|
|
21929
22576
|
isFormValid,
|
|
21930
22577
|
isStepValid,
|
|
21931
22578
|
mapApiStatusToInternal,
|