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.mjs
CHANGED
|
@@ -3729,7 +3729,7 @@ var AlertsManagerView = ({
|
|
|
3729
3729
|
const handleClose = () => {
|
|
3730
3730
|
onClose?.();
|
|
3731
3731
|
};
|
|
3732
|
-
const
|
|
3732
|
+
const formatDate2 = (dateInput) => {
|
|
3733
3733
|
const date = dateInput instanceof Date ? dateInput : new Date(dateInput);
|
|
3734
3734
|
if (Number.isNaN(date.getTime())) return String(dateInput);
|
|
3735
3735
|
return date.toLocaleDateString("pt-BR", {
|
|
@@ -3763,7 +3763,7 @@ var AlertsManagerView = ({
|
|
|
3763
3763
|
/* @__PURE__ */ jsx28(Divider_default, { className: "my-4" }),
|
|
3764
3764
|
/* @__PURE__ */ jsxs23("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
3765
3765
|
/* @__PURE__ */ jsx28(Text_default, { size: "sm", weight: "bold", className: "text-text-700", children: "Enviado em" }),
|
|
3766
|
-
/* @__PURE__ */ jsx28(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children:
|
|
3766
|
+
/* @__PURE__ */ jsx28(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children: formatDate2(alertData.sentAt) })
|
|
3767
3767
|
] }),
|
|
3768
3768
|
/* @__PURE__ */ jsx28(Divider_default, { className: "my-4" }),
|
|
3769
3769
|
/* @__PURE__ */ jsx28("div", { className: "mb-4", children: /* @__PURE__ */ jsxs23(Table_default, { variant: "borderless", className: "table-fixed", children: [
|
|
@@ -5883,8 +5883,8 @@ var ProgressBar_default = ProgressBar;
|
|
|
5883
5883
|
import { jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5884
5884
|
var SIZE_CLASSES9 = {
|
|
5885
5885
|
small: {
|
|
5886
|
-
container: "w-[
|
|
5887
|
-
//
|
|
5886
|
+
container: "w-[107px] h-[107px]",
|
|
5887
|
+
// 107px circle to fit labels like "CONCLUÍDO"
|
|
5888
5888
|
strokeWidth: 4,
|
|
5889
5889
|
// 4px stroke width - matches ProgressBar small (h-1)
|
|
5890
5890
|
textSize: "2xl",
|
|
@@ -5892,13 +5892,13 @@ var SIZE_CLASSES9 = {
|
|
|
5892
5892
|
textWeight: "medium",
|
|
5893
5893
|
// font-weight: 500
|
|
5894
5894
|
labelSize: "2xs",
|
|
5895
|
-
//
|
|
5895
|
+
// 10px for status label
|
|
5896
5896
|
labelWeight: "bold",
|
|
5897
5897
|
// font-weight: 700
|
|
5898
5898
|
spacing: "gap-0",
|
|
5899
5899
|
// Reduced gap between percentage and label for better spacing
|
|
5900
|
-
contentWidth: "max-w-[
|
|
5901
|
-
//
|
|
5900
|
+
contentWidth: "max-w-[85px]"
|
|
5901
|
+
// Width to fit labels like "CONCLUÍDO" inside circle
|
|
5902
5902
|
},
|
|
5903
5903
|
medium: {
|
|
5904
5904
|
container: "w-[152px] h-[152px]",
|
|
@@ -5957,11 +5957,11 @@ var ProgressCircle = ({
|
|
|
5957
5957
|
const percentage = max === 0 ? 0 : clampedValue / max * 100;
|
|
5958
5958
|
const sizeClasses = SIZE_CLASSES9[size];
|
|
5959
5959
|
const variantClasses = VARIANT_CLASSES3[variant];
|
|
5960
|
-
const radius = size === "small" ?
|
|
5960
|
+
const radius = size === "small" ? 49 : 64;
|
|
5961
5961
|
const circumference = 2 * Math.PI * radius;
|
|
5962
5962
|
const strokeDashoffset = circumference - percentage / 100 * circumference;
|
|
5963
|
-
const center = size === "small" ?
|
|
5964
|
-
const svgSize = size === "small" ?
|
|
5963
|
+
const center = size === "small" ? 53.5 : 76;
|
|
5964
|
+
const svgSize = size === "small" ? 107 : 152;
|
|
5965
5965
|
return /* @__PURE__ */ jsxs30(
|
|
5966
5966
|
"div",
|
|
5967
5967
|
{
|
|
@@ -21014,6 +21014,41 @@ var GOAL_STATUS_OPTIONS = [
|
|
|
21014
21014
|
{ id: "VENCIDA" /* VENCIDA */, name: "Vencida" },
|
|
21015
21015
|
{ id: "CONCLUIDA" /* CONCLUIDA */, name: "Conclu\xEDda" }
|
|
21016
21016
|
];
|
|
21017
|
+
var StudentLessonStatus = /* @__PURE__ */ ((StudentLessonStatus2) => {
|
|
21018
|
+
StudentLessonStatus2["A_INICIAR"] = "A INICIAR";
|
|
21019
|
+
StudentLessonStatus2["EM_ANDAMENTO"] = "EM ANDAMENTO";
|
|
21020
|
+
StudentLessonStatus2["NAO_FINALIZADO"] = "N\xC3O FINALIZADO";
|
|
21021
|
+
StudentLessonStatus2["CONCLUIDO"] = "CONCLU\xCDDO";
|
|
21022
|
+
return StudentLessonStatus2;
|
|
21023
|
+
})(StudentLessonStatus || {});
|
|
21024
|
+
var getStudentStatusBadgeAction = (status) => {
|
|
21025
|
+
const actionMap = {
|
|
21026
|
+
["CONCLU\xCDDO" /* CONCLUIDO */]: "success",
|
|
21027
|
+
["EM ANDAMENTO" /* EM_ANDAMENTO */]: "info",
|
|
21028
|
+
["A INICIAR" /* A_INICIAR */]: "warning",
|
|
21029
|
+
["N\xC3O FINALIZADO" /* NAO_FINALIZADO */]: "error"
|
|
21030
|
+
};
|
|
21031
|
+
return actionMap[status] ?? "warning";
|
|
21032
|
+
};
|
|
21033
|
+
var isDeadlinePassed = (deadline) => {
|
|
21034
|
+
if (!deadline) return false;
|
|
21035
|
+
return new Date(deadline) < /* @__PURE__ */ new Date();
|
|
21036
|
+
};
|
|
21037
|
+
var deriveStudentStatus = (progress, completedAt, deadline) => {
|
|
21038
|
+
if (completedAt) return "CONCLU\xCDDO" /* CONCLUIDO */;
|
|
21039
|
+
if (progress === 100) return "CONCLU\xCDDO" /* CONCLUIDO */;
|
|
21040
|
+
if (isDeadlinePassed(deadline ?? null) && progress < 100) {
|
|
21041
|
+
return "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
|
|
21042
|
+
}
|
|
21043
|
+
if (progress === 0) return "A INICIAR" /* A_INICIAR */;
|
|
21044
|
+
if (progress > 0) return "EM ANDAMENTO" /* EM_ANDAMENTO */;
|
|
21045
|
+
return "A INICIAR" /* A_INICIAR */;
|
|
21046
|
+
};
|
|
21047
|
+
var formatDaysToComplete = (daysToComplete) => {
|
|
21048
|
+
if (daysToComplete === null) return null;
|
|
21049
|
+
if (daysToComplete === 1) return "1 dia";
|
|
21050
|
+
return `${daysToComplete} dias`;
|
|
21051
|
+
};
|
|
21017
21052
|
|
|
21018
21053
|
// src/hooks/useRecommendedLessons.ts
|
|
21019
21054
|
import { useState as useState41, useCallback as useCallback18 } from "react";
|
|
@@ -21645,6 +21680,594 @@ var RecommendedLessonsHistory = ({
|
|
|
21645
21680
|
}
|
|
21646
21681
|
);
|
|
21647
21682
|
};
|
|
21683
|
+
|
|
21684
|
+
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
21685
|
+
import { useMemo as useMemo24 } from "react";
|
|
21686
|
+
|
|
21687
|
+
// src/components/RecommendedLessonDetails/components/Breadcrumb.tsx
|
|
21688
|
+
import { CaretRightIcon as CaretRightIcon2 } from "@phosphor-icons/react";
|
|
21689
|
+
import { jsx as jsx84, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
21690
|
+
var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ jsx84("nav", { className: "flex items-center gap-2 text-sm", "aria-label": "Breadcrumb", children: items.map((item, index) => /* @__PURE__ */ jsxs67(
|
|
21691
|
+
Text_default,
|
|
21692
|
+
{
|
|
21693
|
+
as: "span",
|
|
21694
|
+
className: "flex items-center gap-2",
|
|
21695
|
+
children: [
|
|
21696
|
+
index > 0 && /* @__PURE__ */ jsx84(CaretRightIcon2, { size: 14, className: "text-text-500" }),
|
|
21697
|
+
item.path ? /* @__PURE__ */ jsx84(
|
|
21698
|
+
"button",
|
|
21699
|
+
{
|
|
21700
|
+
type: "button",
|
|
21701
|
+
onClick: () => onItemClick?.(item.path),
|
|
21702
|
+
className: "text-text-600 hover:text-primary-700 transition-colors",
|
|
21703
|
+
children: item.label
|
|
21704
|
+
}
|
|
21705
|
+
) : /* @__PURE__ */ jsx84(Text_default, { as: "span", className: "text-text-950 font-medium", children: item.label })
|
|
21706
|
+
]
|
|
21707
|
+
},
|
|
21708
|
+
item.path ?? item.label
|
|
21709
|
+
)) });
|
|
21710
|
+
|
|
21711
|
+
// src/components/RecommendedLessonDetails/components/LessonHeader.tsx
|
|
21712
|
+
import { BookBookmarkIcon } from "@phosphor-icons/react";
|
|
21713
|
+
|
|
21714
|
+
// src/components/RecommendedLessonDetails/utils/lessonDetailsUtils.ts
|
|
21715
|
+
var formatDate = (dateString) => {
|
|
21716
|
+
if (!dateString) return "-";
|
|
21717
|
+
const date = new Date(dateString);
|
|
21718
|
+
if (Number.isNaN(date.getTime())) return "-";
|
|
21719
|
+
return date.toLocaleDateString("pt-BR", {
|
|
21720
|
+
day: "2-digit",
|
|
21721
|
+
month: "2-digit",
|
|
21722
|
+
year: "numeric"
|
|
21723
|
+
});
|
|
21724
|
+
};
|
|
21725
|
+
var transformStudentForDisplay = (student, deadline) => ({
|
|
21726
|
+
id: student.userInstitutionId,
|
|
21727
|
+
name: student.name,
|
|
21728
|
+
status: deriveStudentStatus(student.progress, student.completedAt, deadline),
|
|
21729
|
+
completionPercentage: student.progress,
|
|
21730
|
+
duration: formatDaysToComplete(student.daysToComplete)
|
|
21731
|
+
});
|
|
21732
|
+
|
|
21733
|
+
// src/components/RecommendedLessonDetails/components/LessonHeader.tsx
|
|
21734
|
+
import { Fragment as Fragment21, jsx as jsx85, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
21735
|
+
var LessonHeader = ({
|
|
21736
|
+
data,
|
|
21737
|
+
onViewLesson,
|
|
21738
|
+
mapSubjectNameToEnum,
|
|
21739
|
+
viewLessonLabel
|
|
21740
|
+
}) => {
|
|
21741
|
+
const { goal, breakdown } = data;
|
|
21742
|
+
const subjectName = goal.lessonsGoals[0]?.supLessonsProgress?.lesson?.subject?.name || "";
|
|
21743
|
+
const subjectEnum = mapSubjectNameToEnum?.(subjectName);
|
|
21744
|
+
const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
|
|
21745
|
+
return /* @__PURE__ */ jsx85("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ jsxs68("div", { className: "flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4", children: [
|
|
21746
|
+
/* @__PURE__ */ jsxs68("div", { className: "flex flex-col gap-2", children: [
|
|
21747
|
+
/* @__PURE__ */ jsx85(
|
|
21748
|
+
Text_default,
|
|
21749
|
+
{
|
|
21750
|
+
as: "h1",
|
|
21751
|
+
size: "xl",
|
|
21752
|
+
weight: "bold",
|
|
21753
|
+
className: "text-text-950 lg:text-2xl",
|
|
21754
|
+
children: goal.title
|
|
21755
|
+
}
|
|
21756
|
+
),
|
|
21757
|
+
/* @__PURE__ */ jsxs68("div", { className: "flex flex-wrap items-center gap-2 text-sm text-text-600", children: [
|
|
21758
|
+
/* @__PURE__ */ jsxs68(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
21759
|
+
"In\xEDcio em ",
|
|
21760
|
+
formatDate(goal.startDate)
|
|
21761
|
+
] }),
|
|
21762
|
+
/* @__PURE__ */ jsx85(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
21763
|
+
/* @__PURE__ */ jsxs68(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
21764
|
+
"Prazo final ",
|
|
21765
|
+
formatDate(goal.finalDate)
|
|
21766
|
+
] }),
|
|
21767
|
+
breakdown?.schoolName && /* @__PURE__ */ jsxs68(Fragment21, { children: [
|
|
21768
|
+
/* @__PURE__ */ jsx85(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
21769
|
+
/* @__PURE__ */ jsx85(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.schoolName })
|
|
21770
|
+
] }),
|
|
21771
|
+
subjectName && /* @__PURE__ */ jsxs68(Fragment21, { children: [
|
|
21772
|
+
/* @__PURE__ */ jsx85(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
21773
|
+
/* @__PURE__ */ jsxs68(Text_default, { as: "span", size: "sm", className: "flex items-center gap-1", children: [
|
|
21774
|
+
subjectInfo && /* @__PURE__ */ jsx85(
|
|
21775
|
+
Text_default,
|
|
21776
|
+
{
|
|
21777
|
+
as: "span",
|
|
21778
|
+
className: cn(
|
|
21779
|
+
"size-5 rounded flex items-center justify-center text-white",
|
|
21780
|
+
subjectInfo.colorClass
|
|
21781
|
+
),
|
|
21782
|
+
children: subjectInfo.icon
|
|
21783
|
+
}
|
|
21784
|
+
),
|
|
21785
|
+
subjectName
|
|
21786
|
+
] })
|
|
21787
|
+
] }),
|
|
21788
|
+
breakdown?.className && /* @__PURE__ */ jsxs68(Fragment21, { children: [
|
|
21789
|
+
/* @__PURE__ */ jsx85(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
21790
|
+
/* @__PURE__ */ jsx85(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.className })
|
|
21791
|
+
] })
|
|
21792
|
+
] })
|
|
21793
|
+
] }),
|
|
21794
|
+
onViewLesson && /* @__PURE__ */ jsx85(
|
|
21795
|
+
Button_default,
|
|
21796
|
+
{
|
|
21797
|
+
variant: "solid",
|
|
21798
|
+
action: "primary",
|
|
21799
|
+
size: "small",
|
|
21800
|
+
iconLeft: /* @__PURE__ */ jsx85(BookBookmarkIcon, { size: 16 }),
|
|
21801
|
+
onClick: onViewLesson,
|
|
21802
|
+
children: viewLessonLabel
|
|
21803
|
+
}
|
|
21804
|
+
)
|
|
21805
|
+
] }) });
|
|
21806
|
+
};
|
|
21807
|
+
|
|
21808
|
+
// src/components/RecommendedLessonDetails/components/LoadingSkeleton.tsx
|
|
21809
|
+
import { jsx as jsx86, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
21810
|
+
var LoadingSkeleton = () => /* @__PURE__ */ jsxs69("div", { className: "flex flex-col gap-6", children: [
|
|
21811
|
+
/* @__PURE__ */ jsx86(SkeletonText, { width: 256 }),
|
|
21812
|
+
/* @__PURE__ */ jsx86("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ jsxs69("div", { className: "flex flex-col gap-3", children: [
|
|
21813
|
+
/* @__PURE__ */ jsx86(SkeletonText, { width: "75%", height: 28 }),
|
|
21814
|
+
/* @__PURE__ */ jsx86(SkeletonText, { width: "50%" })
|
|
21815
|
+
] }) }),
|
|
21816
|
+
/* @__PURE__ */ jsxs69("div", { className: "flex flex-col gap-4", children: [
|
|
21817
|
+
/* @__PURE__ */ jsx86(SkeletonText, { width: 192, height: 20 }),
|
|
21818
|
+
/* @__PURE__ */ jsxs69("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
|
|
21819
|
+
/* @__PURE__ */ jsx86(SkeletonRounded, { height: 140 }),
|
|
21820
|
+
/* @__PURE__ */ jsx86(SkeletonRounded, { height: 140 }),
|
|
21821
|
+
/* @__PURE__ */ jsx86(SkeletonRounded, { height: 140 })
|
|
21822
|
+
] })
|
|
21823
|
+
] }),
|
|
21824
|
+
/* @__PURE__ */ jsx86("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ jsx86(SkeletonTable, { rows: 4, columns: 5 }) })
|
|
21825
|
+
] });
|
|
21826
|
+
|
|
21827
|
+
// src/components/RecommendedLessonDetails/components/ResultsSection.tsx
|
|
21828
|
+
import { TrophyIcon, WarningIcon } from "@phosphor-icons/react";
|
|
21829
|
+
import { jsx as jsx87, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
21830
|
+
var ResultsSection = ({ data, labels }) => {
|
|
21831
|
+
const { details } = data;
|
|
21832
|
+
const { aggregated, contentPerformance } = details;
|
|
21833
|
+
return /* @__PURE__ */ jsxs70("div", { className: "flex flex-col gap-4", children: [
|
|
21834
|
+
/* @__PURE__ */ jsx87(Text_default, { as: "h2", size: "md", weight: "semibold", className: "text-text-950", children: labels.resultsTitle }),
|
|
21835
|
+
/* @__PURE__ */ jsx87("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ jsxs70("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
|
|
21836
|
+
/* @__PURE__ */ jsx87("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-primary-50", children: /* @__PURE__ */ jsx87(
|
|
21837
|
+
ProgressCircle_default,
|
|
21838
|
+
{
|
|
21839
|
+
value: aggregated.completionPercentage,
|
|
21840
|
+
size: "small",
|
|
21841
|
+
variant: "blue",
|
|
21842
|
+
label: labels.completedLabel,
|
|
21843
|
+
showPercentage: true
|
|
21844
|
+
}
|
|
21845
|
+
) }),
|
|
21846
|
+
/* @__PURE__ */ jsxs70("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-success-200", children: [
|
|
21847
|
+
/* @__PURE__ */ jsx87(
|
|
21848
|
+
Text_default,
|
|
21849
|
+
{
|
|
21850
|
+
as: "span",
|
|
21851
|
+
className: "size-8 rounded-full flex items-center justify-center bg-warning-300 mb-2",
|
|
21852
|
+
children: /* @__PURE__ */ jsx87(TrophyIcon, { size: 18, weight: "fill", className: "text-white" })
|
|
21853
|
+
}
|
|
21854
|
+
),
|
|
21855
|
+
/* @__PURE__ */ jsx87(
|
|
21856
|
+
Text_default,
|
|
21857
|
+
{
|
|
21858
|
+
size: "2xs",
|
|
21859
|
+
weight: "bold",
|
|
21860
|
+
className: "text-text-700 uppercase text-center leading-none mb-1",
|
|
21861
|
+
children: labels.bestResultLabel
|
|
21862
|
+
}
|
|
21863
|
+
),
|
|
21864
|
+
/* @__PURE__ */ jsx87(
|
|
21865
|
+
Text_default,
|
|
21866
|
+
{
|
|
21867
|
+
size: "xl",
|
|
21868
|
+
weight: "bold",
|
|
21869
|
+
className: "text-success-700 text-center leading-none tracking-wide",
|
|
21870
|
+
children: contentPerformance.best?.contentName || "-"
|
|
21871
|
+
}
|
|
21872
|
+
)
|
|
21873
|
+
] }),
|
|
21874
|
+
/* @__PURE__ */ jsxs70("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-error-100", children: [
|
|
21875
|
+
/* @__PURE__ */ jsx87(
|
|
21876
|
+
Text_default,
|
|
21877
|
+
{
|
|
21878
|
+
as: "span",
|
|
21879
|
+
className: "size-8 rounded-full flex items-center justify-center bg-error-300 mb-2",
|
|
21880
|
+
children: /* @__PURE__ */ jsx87(WarningIcon, { size: 18, weight: "fill", className: "text-error-700" })
|
|
21881
|
+
}
|
|
21882
|
+
),
|
|
21883
|
+
/* @__PURE__ */ jsx87(
|
|
21884
|
+
Text_default,
|
|
21885
|
+
{
|
|
21886
|
+
size: "2xs",
|
|
21887
|
+
weight: "bold",
|
|
21888
|
+
className: "text-text-700 uppercase text-center leading-none mb-1",
|
|
21889
|
+
children: labels.hardestTopicLabel
|
|
21890
|
+
}
|
|
21891
|
+
),
|
|
21892
|
+
/* @__PURE__ */ jsx87(
|
|
21893
|
+
Text_default,
|
|
21894
|
+
{
|
|
21895
|
+
size: "xl",
|
|
21896
|
+
weight: "bold",
|
|
21897
|
+
className: "text-error-700 text-center leading-none tracking-wide",
|
|
21898
|
+
children: contentPerformance.worst?.contentName || "-"
|
|
21899
|
+
}
|
|
21900
|
+
)
|
|
21901
|
+
] })
|
|
21902
|
+
] }) })
|
|
21903
|
+
] });
|
|
21904
|
+
};
|
|
21905
|
+
|
|
21906
|
+
// src/components/RecommendedLessonDetails/components/StudentsTable.tsx
|
|
21907
|
+
import { useCallback as useCallback20 } from "react";
|
|
21908
|
+
import { UserIcon } from "@phosphor-icons/react";
|
|
21909
|
+
import { jsx as jsx88, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
21910
|
+
var StudentsTable = ({
|
|
21911
|
+
students,
|
|
21912
|
+
onViewPerformance,
|
|
21913
|
+
labels,
|
|
21914
|
+
emptyMessage = "Nenhum aluno encontrado"
|
|
21915
|
+
}) => {
|
|
21916
|
+
const { sortedData, sortColumn, sortDirection, handleSort } = useTableSort(students);
|
|
21917
|
+
const canViewPerformance = useCallback20((student) => {
|
|
21918
|
+
return student.status === "CONCLU\xCDDO" /* CONCLUIDO */ || student.status === "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
|
|
21919
|
+
}, []);
|
|
21920
|
+
return /* @__PURE__ */ jsx88("div", { className: "bg-background rounded-xl border border-border-50 overflow-hidden", children: /* @__PURE__ */ jsxs71(Table_default, { children: [
|
|
21921
|
+
/* @__PURE__ */ jsx88(TableHeader, { children: /* @__PURE__ */ jsxs71(TableRow, { children: [
|
|
21922
|
+
/* @__PURE__ */ jsx88(
|
|
21923
|
+
TableHead,
|
|
21924
|
+
{
|
|
21925
|
+
sortable: true,
|
|
21926
|
+
sortDirection: sortColumn === "name" ? sortDirection : void 0,
|
|
21927
|
+
onSort: () => handleSort("name"),
|
|
21928
|
+
children: labels.studentColumn
|
|
21929
|
+
}
|
|
21930
|
+
),
|
|
21931
|
+
/* @__PURE__ */ jsx88(
|
|
21932
|
+
TableHead,
|
|
21933
|
+
{
|
|
21934
|
+
sortable: true,
|
|
21935
|
+
sortDirection: sortColumn === "status" ? sortDirection : void 0,
|
|
21936
|
+
onSort: () => handleSort("status"),
|
|
21937
|
+
children: labels.statusColumn
|
|
21938
|
+
}
|
|
21939
|
+
),
|
|
21940
|
+
/* @__PURE__ */ jsx88(
|
|
21941
|
+
TableHead,
|
|
21942
|
+
{
|
|
21943
|
+
sortable: true,
|
|
21944
|
+
sortDirection: sortColumn === "completionPercentage" ? sortDirection : void 0,
|
|
21945
|
+
onSort: () => handleSort("completionPercentage"),
|
|
21946
|
+
children: labels.completionColumn
|
|
21947
|
+
}
|
|
21948
|
+
),
|
|
21949
|
+
/* @__PURE__ */ jsx88(TableHead, { children: labels.durationColumn }),
|
|
21950
|
+
/* @__PURE__ */ jsx88(TableHead, { className: "w-[140px]" })
|
|
21951
|
+
] }) }),
|
|
21952
|
+
/* @__PURE__ */ jsx88(TableBody, { children: sortedData.length === 0 ? /* @__PURE__ */ jsx88(TableRow, { children: /* @__PURE__ */ jsx88(TableCell, { colSpan: 5, className: "text-center py-8", children: /* @__PURE__ */ jsx88(Text_default, { size: "sm", className: "text-text-500", children: emptyMessage }) }) }) : sortedData.map((student) => /* @__PURE__ */ jsxs71(TableRow, { children: [
|
|
21953
|
+
/* @__PURE__ */ jsx88(TableCell, { children: /* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2", children: [
|
|
21954
|
+
/* @__PURE__ */ jsx88(
|
|
21955
|
+
Text_default,
|
|
21956
|
+
{
|
|
21957
|
+
as: "span",
|
|
21958
|
+
className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
|
|
21959
|
+
children: /* @__PURE__ */ jsx88(UserIcon, { size: 16, className: "text-text-500" })
|
|
21960
|
+
}
|
|
21961
|
+
),
|
|
21962
|
+
/* @__PURE__ */ jsx88(Text_default, { size: "sm", className: "text-text-950", children: student.name })
|
|
21963
|
+
] }) }),
|
|
21964
|
+
/* @__PURE__ */ jsx88(TableCell, { children: /* @__PURE__ */ jsx88(
|
|
21965
|
+
Badge_default,
|
|
21966
|
+
{
|
|
21967
|
+
variant: "solid",
|
|
21968
|
+
action: getStudentStatusBadgeAction(student.status),
|
|
21969
|
+
size: "small",
|
|
21970
|
+
children: student.status
|
|
21971
|
+
}
|
|
21972
|
+
) }),
|
|
21973
|
+
/* @__PURE__ */ jsx88(TableCell, { children: /* @__PURE__ */ jsxs71("div", { className: "flex flex-col gap-1 min-w-[120px]", children: [
|
|
21974
|
+
/* @__PURE__ */ jsxs71(Text_default, { size: "sm", className: "text-primary-700 font-medium", children: [
|
|
21975
|
+
student.completionPercentage,
|
|
21976
|
+
"%"
|
|
21977
|
+
] }),
|
|
21978
|
+
/* @__PURE__ */ jsx88(
|
|
21979
|
+
ProgressBar_default,
|
|
21980
|
+
{
|
|
21981
|
+
value: student.completionPercentage,
|
|
21982
|
+
size: "small",
|
|
21983
|
+
variant: "blue",
|
|
21984
|
+
className: "w-full max-w-[100px]"
|
|
21985
|
+
}
|
|
21986
|
+
)
|
|
21987
|
+
] }) }),
|
|
21988
|
+
/* @__PURE__ */ jsx88(TableCell, { children: /* @__PURE__ */ jsx88(Text_default, { size: "sm", className: "text-text-700", children: student.duration ?? "-" }) }),
|
|
21989
|
+
/* @__PURE__ */ jsx88(TableCell, { children: canViewPerformance(student) ? /* @__PURE__ */ jsx88(
|
|
21990
|
+
Button_default,
|
|
21991
|
+
{
|
|
21992
|
+
variant: "outline",
|
|
21993
|
+
size: "extra-small",
|
|
21994
|
+
onClick: () => onViewPerformance?.(student.id),
|
|
21995
|
+
children: labels.viewPerformance
|
|
21996
|
+
}
|
|
21997
|
+
) : /* @__PURE__ */ jsx88(Button_default, { variant: "outline", size: "extra-small", disabled: true, children: labels.viewPerformance }) })
|
|
21998
|
+
] }, student.id)) })
|
|
21999
|
+
] }) });
|
|
22000
|
+
};
|
|
22001
|
+
|
|
22002
|
+
// src/components/RecommendedLessonDetails/types.ts
|
|
22003
|
+
var DEFAULT_LABELS = {
|
|
22004
|
+
viewLesson: "Ver aula",
|
|
22005
|
+
viewPerformance: "Ver desempenho",
|
|
22006
|
+
resultsTitle: "Resultados da aula recomendada",
|
|
22007
|
+
completedLabel: "CONCLU\xCDDO",
|
|
22008
|
+
bestResultLabel: "MELHOR RESULTADO",
|
|
22009
|
+
hardestTopicLabel: "MAIOR DIFICULDADE",
|
|
22010
|
+
studentColumn: "Aluno",
|
|
22011
|
+
statusColumn: "Status",
|
|
22012
|
+
completionColumn: "Conclus\xE3o",
|
|
22013
|
+
durationColumn: "Dura\xE7\xE3o"
|
|
22014
|
+
};
|
|
22015
|
+
|
|
22016
|
+
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
22017
|
+
import { jsx as jsx89, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
22018
|
+
var RecommendedLessonDetails = ({
|
|
22019
|
+
data,
|
|
22020
|
+
loading = false,
|
|
22021
|
+
error = null,
|
|
22022
|
+
onViewLesson,
|
|
22023
|
+
onViewStudentPerformance,
|
|
22024
|
+
onBreadcrumbClick,
|
|
22025
|
+
mapSubjectNameToEnum,
|
|
22026
|
+
breadcrumbs,
|
|
22027
|
+
labels: customLabels,
|
|
22028
|
+
className
|
|
22029
|
+
}) => {
|
|
22030
|
+
const labels = useMemo24(
|
|
22031
|
+
() => ({ ...DEFAULT_LABELS, ...customLabels }),
|
|
22032
|
+
[customLabels]
|
|
22033
|
+
);
|
|
22034
|
+
const defaultBreadcrumbs = useMemo24(
|
|
22035
|
+
() => [
|
|
22036
|
+
{ label: "Aulas recomendadas", path: "/aulas-recomendadas" },
|
|
22037
|
+
{ label: data?.goal.title || "Detalhes" }
|
|
22038
|
+
],
|
|
22039
|
+
[data?.goal.title]
|
|
22040
|
+
);
|
|
22041
|
+
const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
|
|
22042
|
+
const displayStudents = useMemo24(() => {
|
|
22043
|
+
if (!data?.details.students) return [];
|
|
22044
|
+
const deadline = data?.goal.finalDate;
|
|
22045
|
+
return data.details.students.map(
|
|
22046
|
+
(student) => transformStudentForDisplay(student, deadline)
|
|
22047
|
+
);
|
|
22048
|
+
}, [data?.details.students, data?.goal.finalDate]);
|
|
22049
|
+
if (loading) {
|
|
22050
|
+
return /* @__PURE__ */ jsx89(
|
|
22051
|
+
"div",
|
|
22052
|
+
{
|
|
22053
|
+
className: cn("flex flex-col gap-6", className),
|
|
22054
|
+
"data-testid": "lesson-details-loading",
|
|
22055
|
+
children: /* @__PURE__ */ jsx89(LoadingSkeleton, {})
|
|
22056
|
+
}
|
|
22057
|
+
);
|
|
22058
|
+
}
|
|
22059
|
+
if (error) {
|
|
22060
|
+
return /* @__PURE__ */ jsx89(
|
|
22061
|
+
"div",
|
|
22062
|
+
{
|
|
22063
|
+
className: cn(
|
|
22064
|
+
"flex flex-col items-center justify-center py-12",
|
|
22065
|
+
className
|
|
22066
|
+
),
|
|
22067
|
+
"data-testid": "lesson-details-error",
|
|
22068
|
+
children: /* @__PURE__ */ jsx89(Text_default, { size: "md", className: "text-error-700", children: error })
|
|
22069
|
+
}
|
|
22070
|
+
);
|
|
22071
|
+
}
|
|
22072
|
+
if (!data) {
|
|
22073
|
+
return null;
|
|
22074
|
+
}
|
|
22075
|
+
return /* @__PURE__ */ jsxs72(
|
|
22076
|
+
"div",
|
|
22077
|
+
{
|
|
22078
|
+
className: cn("flex flex-col gap-6", className),
|
|
22079
|
+
"data-testid": "recommended-lesson-details",
|
|
22080
|
+
children: [
|
|
22081
|
+
/* @__PURE__ */ jsx89(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
|
|
22082
|
+
/* @__PURE__ */ jsx89(
|
|
22083
|
+
LessonHeader,
|
|
22084
|
+
{
|
|
22085
|
+
data,
|
|
22086
|
+
onViewLesson,
|
|
22087
|
+
mapSubjectNameToEnum,
|
|
22088
|
+
viewLessonLabel: labels.viewLesson
|
|
22089
|
+
}
|
|
22090
|
+
),
|
|
22091
|
+
/* @__PURE__ */ jsx89(ResultsSection, { data, labels }),
|
|
22092
|
+
/* @__PURE__ */ jsx89(
|
|
22093
|
+
StudentsTable,
|
|
22094
|
+
{
|
|
22095
|
+
students: displayStudents,
|
|
22096
|
+
onViewPerformance: onViewStudentPerformance,
|
|
22097
|
+
labels
|
|
22098
|
+
}
|
|
22099
|
+
)
|
|
22100
|
+
]
|
|
22101
|
+
}
|
|
22102
|
+
);
|
|
22103
|
+
};
|
|
22104
|
+
var RecommendedLessonDetails_default = RecommendedLessonDetails;
|
|
22105
|
+
|
|
22106
|
+
// src/hooks/useRecommendedLessonDetails.ts
|
|
22107
|
+
import { useState as useState43, useCallback as useCallback21, useEffect as useEffect42 } from "react";
|
|
22108
|
+
import { z as z4 } from "zod";
|
|
22109
|
+
var goalLessonSubjectSchema = z4.object({
|
|
22110
|
+
id: z4.string(),
|
|
22111
|
+
name: z4.string(),
|
|
22112
|
+
color: z4.string(),
|
|
22113
|
+
icon: z4.string()
|
|
22114
|
+
});
|
|
22115
|
+
var lessonContentSchema = z4.object({
|
|
22116
|
+
id: z4.string(),
|
|
22117
|
+
name: z4.string()
|
|
22118
|
+
});
|
|
22119
|
+
var goalLessonSchema = z4.object({
|
|
22120
|
+
id: z4.string(),
|
|
22121
|
+
content: lessonContentSchema,
|
|
22122
|
+
subtopic: lessonContentSchema,
|
|
22123
|
+
topic: lessonContentSchema,
|
|
22124
|
+
subject: goalLessonSubjectSchema
|
|
22125
|
+
});
|
|
22126
|
+
var goalLessonProgressSchema = z4.object({
|
|
22127
|
+
id: z4.string(),
|
|
22128
|
+
userId: z4.string(),
|
|
22129
|
+
lessonId: z4.string(),
|
|
22130
|
+
progress: z4.number(),
|
|
22131
|
+
lesson: goalLessonSchema
|
|
22132
|
+
});
|
|
22133
|
+
var goalLessonGoalItemSchema = z4.object({
|
|
22134
|
+
goalId: z4.string(),
|
|
22135
|
+
supLessonsProgressId: z4.string(),
|
|
22136
|
+
supLessonsProgress: goalLessonProgressSchema
|
|
22137
|
+
});
|
|
22138
|
+
var goalMetadataSchema = z4.object({
|
|
22139
|
+
id: z4.string(),
|
|
22140
|
+
title: z4.string(),
|
|
22141
|
+
startDate: z4.string(),
|
|
22142
|
+
finalDate: z4.string(),
|
|
22143
|
+
progress: z4.number(),
|
|
22144
|
+
lessonsGoals: z4.array(goalLessonGoalItemSchema)
|
|
22145
|
+
});
|
|
22146
|
+
var goalApiResponseSchema = z4.object({
|
|
22147
|
+
message: z4.string(),
|
|
22148
|
+
data: goalMetadataSchema
|
|
22149
|
+
});
|
|
22150
|
+
var goalDetailStudentSchema = z4.object({
|
|
22151
|
+
userInstitutionId: z4.string(),
|
|
22152
|
+
userId: z4.string(),
|
|
22153
|
+
name: z4.string(),
|
|
22154
|
+
progress: z4.number(),
|
|
22155
|
+
completedAt: z4.string().nullable(),
|
|
22156
|
+
avgScore: z4.number().nullable(),
|
|
22157
|
+
daysToComplete: z4.number().nullable()
|
|
22158
|
+
});
|
|
22159
|
+
var goalDetailAggregatedSchema = z4.object({
|
|
22160
|
+
completionPercentage: z4.number(),
|
|
22161
|
+
avgScore: z4.number().nullable()
|
|
22162
|
+
});
|
|
22163
|
+
var goalDetailContentPerformanceItemSchema = z4.object({
|
|
22164
|
+
contentId: z4.string(),
|
|
22165
|
+
contentName: z4.string(),
|
|
22166
|
+
rate: z4.number()
|
|
22167
|
+
}).nullable();
|
|
22168
|
+
var goalDetailContentPerformanceSchema = z4.object({
|
|
22169
|
+
best: goalDetailContentPerformanceItemSchema,
|
|
22170
|
+
worst: goalDetailContentPerformanceItemSchema
|
|
22171
|
+
});
|
|
22172
|
+
var goalDetailsDataSchema = z4.object({
|
|
22173
|
+
students: z4.array(goalDetailStudentSchema),
|
|
22174
|
+
aggregated: goalDetailAggregatedSchema,
|
|
22175
|
+
contentPerformance: goalDetailContentPerformanceSchema
|
|
22176
|
+
});
|
|
22177
|
+
var goalDetailsApiResponseSchema = z4.object({
|
|
22178
|
+
message: z4.string(),
|
|
22179
|
+
data: goalDetailsDataSchema
|
|
22180
|
+
});
|
|
22181
|
+
var goalBreakdownSchema2 = z4.object({
|
|
22182
|
+
classId: z4.string().uuid(),
|
|
22183
|
+
className: z4.string(),
|
|
22184
|
+
schoolId: z4.string(),
|
|
22185
|
+
schoolName: z4.string(),
|
|
22186
|
+
studentCount: z4.number(),
|
|
22187
|
+
completedCount: z4.number()
|
|
22188
|
+
});
|
|
22189
|
+
var historyGoalItemSchema = z4.object({
|
|
22190
|
+
goal: z4.object({ id: z4.string().uuid() }),
|
|
22191
|
+
breakdown: z4.array(goalBreakdownSchema2)
|
|
22192
|
+
});
|
|
22193
|
+
var historyApiResponseSchema = z4.object({
|
|
22194
|
+
message: z4.string(),
|
|
22195
|
+
data: z4.object({
|
|
22196
|
+
goals: z4.array(historyGoalItemSchema),
|
|
22197
|
+
total: z4.number()
|
|
22198
|
+
})
|
|
22199
|
+
});
|
|
22200
|
+
var handleLessonDetailsFetchError = (error) => {
|
|
22201
|
+
if (error instanceof z4.ZodError) {
|
|
22202
|
+
console.error("Erro ao validar dados dos detalhes da aula:", error);
|
|
22203
|
+
return "Erro ao validar dados dos detalhes da aula";
|
|
22204
|
+
}
|
|
22205
|
+
console.error("Erro ao carregar detalhes da aula:", error);
|
|
22206
|
+
return "Erro ao carregar detalhes da aula";
|
|
22207
|
+
};
|
|
22208
|
+
var createUseRecommendedLessonDetails = (apiClient) => {
|
|
22209
|
+
return (lessonId) => {
|
|
22210
|
+
const [state, setState] = useState43({
|
|
22211
|
+
data: null,
|
|
22212
|
+
loading: true,
|
|
22213
|
+
error: null
|
|
22214
|
+
});
|
|
22215
|
+
const fetchLessonDetails = useCallback21(async () => {
|
|
22216
|
+
if (!lessonId) {
|
|
22217
|
+
setState({
|
|
22218
|
+
data: null,
|
|
22219
|
+
loading: false,
|
|
22220
|
+
error: "ID da aula n\xE3o encontrado"
|
|
22221
|
+
});
|
|
22222
|
+
return;
|
|
22223
|
+
}
|
|
22224
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
22225
|
+
try {
|
|
22226
|
+
const promises = [
|
|
22227
|
+
apiClient.fetchGoal(lessonId),
|
|
22228
|
+
apiClient.fetchGoalDetails(lessonId),
|
|
22229
|
+
apiClient.fetchBreakdown ? apiClient.fetchBreakdown(lessonId) : Promise.resolve(null)
|
|
22230
|
+
];
|
|
22231
|
+
const [goalResponse, detailsResponse, historyResponse] = await Promise.all(promises);
|
|
22232
|
+
const validatedGoal = goalApiResponseSchema.parse(goalResponse);
|
|
22233
|
+
const validatedDetails = goalDetailsApiResponseSchema.parse(detailsResponse);
|
|
22234
|
+
let breakdown;
|
|
22235
|
+
if (historyResponse) {
|
|
22236
|
+
const validatedHistory = historyApiResponseSchema.parse(historyResponse);
|
|
22237
|
+
const historyItem = validatedHistory.data.goals.find(
|
|
22238
|
+
(g) => g.goal.id === lessonId
|
|
22239
|
+
);
|
|
22240
|
+
breakdown = historyItem?.breakdown[0];
|
|
22241
|
+
}
|
|
22242
|
+
const lessonData = {
|
|
22243
|
+
goal: validatedGoal.data,
|
|
22244
|
+
details: validatedDetails.data,
|
|
22245
|
+
breakdown
|
|
22246
|
+
};
|
|
22247
|
+
setState({
|
|
22248
|
+
data: lessonData,
|
|
22249
|
+
loading: false,
|
|
22250
|
+
error: null
|
|
22251
|
+
});
|
|
22252
|
+
} catch (error) {
|
|
22253
|
+
const errorMessage = handleLessonDetailsFetchError(error);
|
|
22254
|
+
setState({
|
|
22255
|
+
data: null,
|
|
22256
|
+
loading: false,
|
|
22257
|
+
error: errorMessage
|
|
22258
|
+
});
|
|
22259
|
+
}
|
|
22260
|
+
}, [lessonId]);
|
|
22261
|
+
useEffect42(() => {
|
|
22262
|
+
fetchLessonDetails();
|
|
22263
|
+
}, [fetchLessonDetails]);
|
|
22264
|
+
return {
|
|
22265
|
+
...state,
|
|
22266
|
+
refetch: fetchLessonDetails
|
|
22267
|
+
};
|
|
22268
|
+
};
|
|
22269
|
+
};
|
|
22270
|
+
var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
21648
22271
|
export {
|
|
21649
22272
|
ACTIVITY_AVAILABILITY,
|
|
21650
22273
|
ANSWER_STATUS,
|
|
@@ -21759,6 +22382,7 @@ export {
|
|
|
21759
22382
|
Radio_default as Radio,
|
|
21760
22383
|
RadioGroup,
|
|
21761
22384
|
RadioGroupItem,
|
|
22385
|
+
RecommendedLessonDetails_default as RecommendedLessonDetails,
|
|
21762
22386
|
RecommendedLessonsHistory,
|
|
21763
22387
|
STUDENT_ACTIVITY_STATUS,
|
|
21764
22388
|
SUBTYPE_ENUM,
|
|
@@ -21780,6 +22404,7 @@ export {
|
|
|
21780
22404
|
SkeletonText,
|
|
21781
22405
|
StatisticsCard,
|
|
21782
22406
|
Stepper_default as Stepper,
|
|
22407
|
+
StudentLessonStatus,
|
|
21783
22408
|
SubjectEnum,
|
|
21784
22409
|
SubjectInfo,
|
|
21785
22410
|
Support_default as Support,
|
|
@@ -21808,15 +22433,19 @@ export {
|
|
|
21808
22433
|
createNotificationStore,
|
|
21809
22434
|
createNotificationsHook,
|
|
21810
22435
|
createQuestionsListHook,
|
|
22436
|
+
createRecommendedLessonDetailsHook,
|
|
21811
22437
|
createRecommendedLessonsHistoryHook,
|
|
21812
22438
|
createUseActivityFiltersData,
|
|
21813
22439
|
createUseNotificationStore,
|
|
21814
22440
|
createUseNotifications,
|
|
21815
22441
|
createUseQuestionsList,
|
|
22442
|
+
createUseRecommendedLessonDetails,
|
|
21816
22443
|
createUseRecommendedLessonsHistory,
|
|
21817
22444
|
createZustandAuthAdapter,
|
|
22445
|
+
deriveStudentStatus,
|
|
21818
22446
|
determineGoalStatus,
|
|
21819
22447
|
formatDateToBrazilian,
|
|
22448
|
+
formatDaysToComplete,
|
|
21820
22449
|
formatFileSize,
|
|
21821
22450
|
formatQuestionNumbers,
|
|
21822
22451
|
formatTimeAgo,
|
|
@@ -21833,13 +22462,19 @@ export {
|
|
|
21833
22462
|
getStatusBadgeAction,
|
|
21834
22463
|
getStatusBadgeConfig,
|
|
21835
22464
|
getStatusText,
|
|
22465
|
+
getStudentStatusBadgeAction,
|
|
21836
22466
|
getSubjectColorClass,
|
|
21837
22467
|
getSubjectColorWithOpacity,
|
|
21838
22468
|
getSubjectIcon,
|
|
21839
22469
|
getSubjectInfo,
|
|
21840
22470
|
getSubjectName,
|
|
22471
|
+
goalApiResponseSchema,
|
|
22472
|
+
goalDetailsApiResponseSchema,
|
|
21841
22473
|
goalsHistoryApiResponseSchema,
|
|
21842
22474
|
handleGoalFetchError,
|
|
22475
|
+
handleLessonDetailsFetchError,
|
|
22476
|
+
historyApiResponseSchema,
|
|
22477
|
+
isDeadlinePassed,
|
|
21843
22478
|
isFormValid,
|
|
21844
22479
|
isStepValid,
|
|
21845
22480
|
mapApiStatusToInternal,
|