analytica-frontend-lib 1.2.84 → 1.2.86
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/RecommendedLessonsHistory/index.js +337 -165
- package/dist/RecommendedLessonsHistory/index.js.map +1 -1
- package/dist/RecommendedLessonsHistory/index.mjs +286 -114
- package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
- package/dist/hooks/useGoalDrafts/index.d.ts +57 -0
- package/dist/hooks/useGoalDrafts/index.d.ts.map +1 -0
- package/dist/hooks/useGoalDrafts/index.js +189 -0
- package/dist/hooks/useGoalDrafts/index.js.map +1 -0
- package/dist/hooks/useGoalDrafts/index.mjs +151 -0
- package/dist/hooks/useGoalDrafts/index.mjs.map +1 -0
- package/dist/hooks/useGoalDrafts.d.ts +57 -0
- package/dist/hooks/useGoalDrafts.d.ts.map +1 -0
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts +4 -0
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.js +24 -0
- package/dist/hooks/useRecommendedLessonsPage/index.js.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.mjs +24 -0
- package/dist/hooks/useRecommendedLessonsPage/index.mjs.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage.d.ts +4 -0
- package/dist/hooks/useRecommendedLessonsPage.d.ts.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +690 -430
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +567 -316
- package/dist/index.mjs.map +1 -1
- package/dist/types/lessonAvailability.d.ts +33 -0
- package/dist/types/lessonAvailability.d.ts.map +1 -0
- package/dist/utils/lessonAvailabilityUtils.d.ts +45 -0
- package/dist/utils/lessonAvailabilityUtils.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -23300,6 +23300,53 @@ var LessonPreview = ({
|
|
|
23300
23300
|
] });
|
|
23301
23301
|
};
|
|
23302
23302
|
|
|
23303
|
+
// src/types/lessonAvailability.ts
|
|
23304
|
+
var LESSON_AVAILABILITY = {
|
|
23305
|
+
/** Lesson is available for access */
|
|
23306
|
+
DISPONIVEL: "DISPONIVEL",
|
|
23307
|
+
/** Lesson has not started yet (current date < startDate) */
|
|
23308
|
+
NAO_INICIADA: "NAO_INICIADA",
|
|
23309
|
+
/** Lesson has expired (current date > finalDate) */
|
|
23310
|
+
EXPIRADA: "EXPIRADA"
|
|
23311
|
+
};
|
|
23312
|
+
|
|
23313
|
+
// src/utils/lessonAvailabilityUtils.ts
|
|
23314
|
+
var isDateInPast = (dateString) => {
|
|
23315
|
+
const date = new Date(dateString);
|
|
23316
|
+
const now = /* @__PURE__ */ new Date();
|
|
23317
|
+
return now > date;
|
|
23318
|
+
};
|
|
23319
|
+
var isDateInFuture = (dateString) => {
|
|
23320
|
+
const date = new Date(dateString);
|
|
23321
|
+
const now = /* @__PURE__ */ new Date();
|
|
23322
|
+
return now < date;
|
|
23323
|
+
};
|
|
23324
|
+
var checkLessonAvailability = (startDate, finalDate) => {
|
|
23325
|
+
const start = startDate ? new Date(startDate) : null;
|
|
23326
|
+
const end = finalDate ? new Date(finalDate) : null;
|
|
23327
|
+
let status = LESSON_AVAILABILITY.DISPONIVEL;
|
|
23328
|
+
if (startDate && isDateInFuture(startDate)) {
|
|
23329
|
+
status = LESSON_AVAILABILITY.NAO_INICIADA;
|
|
23330
|
+
} else if (finalDate && isDateInPast(finalDate)) {
|
|
23331
|
+
status = LESSON_AVAILABILITY.EXPIRADA;
|
|
23332
|
+
}
|
|
23333
|
+
return {
|
|
23334
|
+
status,
|
|
23335
|
+
startDate: start,
|
|
23336
|
+
endDate: end,
|
|
23337
|
+
formattedStartDate: startDate ? formatDateToBrazilian(startDate) : null,
|
|
23338
|
+
formattedEndDate: finalDate ? formatDateToBrazilian(finalDate) : null
|
|
23339
|
+
};
|
|
23340
|
+
};
|
|
23341
|
+
var isLessonNotYetAvailable = (startDate) => {
|
|
23342
|
+
if (!startDate) return false;
|
|
23343
|
+
return isDateInFuture(startDate);
|
|
23344
|
+
};
|
|
23345
|
+
var isLessonExpired = (finalDate) => {
|
|
23346
|
+
if (!finalDate) return false;
|
|
23347
|
+
return isDateInPast(finalDate);
|
|
23348
|
+
};
|
|
23349
|
+
|
|
23303
23350
|
// src/components/ActivityDetails/ActivityDetails.tsx
|
|
23304
23351
|
import { useState as useState43, useMemo as useMemo26, useCallback as useCallback20, useEffect as useEffect45, useRef as useRef28 } from "react";
|
|
23305
23352
|
import {
|
|
@@ -26061,7 +26108,7 @@ var SendLessonModal = ({
|
|
|
26061
26108
|
var SendLessonModal_default = SendLessonModal;
|
|
26062
26109
|
|
|
26063
26110
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
26064
|
-
import { useState as
|
|
26111
|
+
import { useState as useState50, useCallback as useCallback29, useMemo as useMemo28, useRef as useRef32, useEffect as useEffect51 } from "react";
|
|
26065
26112
|
import { Plus as Plus5, CaretRight as CaretRight10, Trash as Trash4, PencilSimple as PencilSimple4 } from "phosphor-react";
|
|
26066
26113
|
|
|
26067
26114
|
// src/types/recommendedLessons.ts
|
|
@@ -26667,8 +26714,161 @@ var GoalModelsTab = ({
|
|
|
26667
26714
|
}
|
|
26668
26715
|
);
|
|
26669
26716
|
|
|
26717
|
+
// src/components/RecommendedLessonsHistory/config/draftsFiltersConfig.ts
|
|
26718
|
+
var getSubjectOptions2 = (data) => {
|
|
26719
|
+
if (!data?.subjects) return [];
|
|
26720
|
+
return data.subjects.map((subject) => ({
|
|
26721
|
+
id: subject.id,
|
|
26722
|
+
name: subject.name
|
|
26723
|
+
}));
|
|
26724
|
+
};
|
|
26725
|
+
var createGoalDraftsFiltersConfig = (userData) => [
|
|
26726
|
+
{
|
|
26727
|
+
key: "content",
|
|
26728
|
+
label: "CONTE\xDADO",
|
|
26729
|
+
categories: [
|
|
26730
|
+
{
|
|
26731
|
+
key: "subject",
|
|
26732
|
+
label: "Mat\xE9ria",
|
|
26733
|
+
selectedIds: [],
|
|
26734
|
+
itens: getSubjectOptions2(userData)
|
|
26735
|
+
}
|
|
26736
|
+
]
|
|
26737
|
+
}
|
|
26738
|
+
];
|
|
26739
|
+
|
|
26740
|
+
// src/hooks/useGoalDrafts.ts
|
|
26741
|
+
import { useState as useState49, useCallback as useCallback28 } from "react";
|
|
26742
|
+
var DEFAULT_GOAL_DRAFTS_PAGINATION = {
|
|
26743
|
+
total: 0,
|
|
26744
|
+
page: 1,
|
|
26745
|
+
limit: 10,
|
|
26746
|
+
totalPages: 0
|
|
26747
|
+
};
|
|
26748
|
+
var handleGoalDraftFetchError = createFetchErrorHandler(
|
|
26749
|
+
"Erro ao validar dados de rascunhos de aulas",
|
|
26750
|
+
"Erro ao carregar rascunhos de aulas"
|
|
26751
|
+
);
|
|
26752
|
+
var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
26753
|
+
return () => {
|
|
26754
|
+
const [state, setState] = useState49({
|
|
26755
|
+
models: [],
|
|
26756
|
+
loading: false,
|
|
26757
|
+
error: null,
|
|
26758
|
+
pagination: DEFAULT_GOAL_DRAFTS_PAGINATION
|
|
26759
|
+
});
|
|
26760
|
+
const fetchModels = useCallback28(
|
|
26761
|
+
async (filters, subjectsMap) => {
|
|
26762
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
26763
|
+
try {
|
|
26764
|
+
const responseData = await fetchGoalDrafts(filters);
|
|
26765
|
+
const validatedData = goalModelsApiResponseSchema.parse(responseData);
|
|
26766
|
+
const tableItems = validatedData.data.drafts.map(
|
|
26767
|
+
(draft) => transformGoalModelToTableItem(draft, subjectsMap)
|
|
26768
|
+
);
|
|
26769
|
+
const limit = filters?.limit || 10;
|
|
26770
|
+
const page = filters?.page || 1;
|
|
26771
|
+
const total = validatedData.data.total;
|
|
26772
|
+
const totalPages = Math.ceil(total / limit);
|
|
26773
|
+
setState({
|
|
26774
|
+
models: tableItems,
|
|
26775
|
+
loading: false,
|
|
26776
|
+
error: null,
|
|
26777
|
+
pagination: {
|
|
26778
|
+
total,
|
|
26779
|
+
page,
|
|
26780
|
+
limit,
|
|
26781
|
+
totalPages
|
|
26782
|
+
}
|
|
26783
|
+
});
|
|
26784
|
+
} catch (error) {
|
|
26785
|
+
const errorMessage = handleGoalDraftFetchError(error);
|
|
26786
|
+
setState((prev) => ({
|
|
26787
|
+
...prev,
|
|
26788
|
+
loading: false,
|
|
26789
|
+
error: errorMessage
|
|
26790
|
+
}));
|
|
26791
|
+
}
|
|
26792
|
+
},
|
|
26793
|
+
[fetchGoalDrafts]
|
|
26794
|
+
);
|
|
26795
|
+
const deleteModel = useCallback28(
|
|
26796
|
+
async (id) => {
|
|
26797
|
+
try {
|
|
26798
|
+
await deleteGoalDraft(id);
|
|
26799
|
+
return true;
|
|
26800
|
+
} catch (error) {
|
|
26801
|
+
console.error("Erro ao deletar rascunho:", error);
|
|
26802
|
+
return false;
|
|
26803
|
+
}
|
|
26804
|
+
},
|
|
26805
|
+
[deleteGoalDraft]
|
|
26806
|
+
);
|
|
26807
|
+
return {
|
|
26808
|
+
...state,
|
|
26809
|
+
fetchModels,
|
|
26810
|
+
deleteModel
|
|
26811
|
+
};
|
|
26812
|
+
};
|
|
26813
|
+
};
|
|
26814
|
+
var createGoalDraftsHook = createUseGoalDrafts;
|
|
26815
|
+
|
|
26816
|
+
// src/components/RecommendedLessonsHistory/tabs/DraftsTab.tsx
|
|
26817
|
+
import { jsx as jsx119 } from "react/jsx-runtime";
|
|
26818
|
+
var GOAL_DRAFTS_CONFIG = {
|
|
26819
|
+
entityName: "rascunho",
|
|
26820
|
+
entityNamePlural: "rascunhos",
|
|
26821
|
+
testId: "goal-drafts-tab",
|
|
26822
|
+
emptyStateTitle: "Voc\xEA n\xE3o tem aulas recomendadas em rascunho",
|
|
26823
|
+
emptyStateDescription: "As aulas recomendadas que voc\xEA come\xE7ar a criar, aparecer\xE3o aqui automaticamente como rascunhos. Tudo \xE9 salvo enquanto voc\xEA cria, continue de onde parou quando quiser!",
|
|
26824
|
+
searchPlaceholder: "Buscar rascunho"
|
|
26825
|
+
};
|
|
26826
|
+
var GOAL_DRAFTS_COLUMNS_CONFIG = {
|
|
26827
|
+
sendButtonLabel: "Enviar aula",
|
|
26828
|
+
sendButtonAriaLabel: "Enviar rascunho",
|
|
26829
|
+
deleteButtonAriaLabel: "Deletar rascunho",
|
|
26830
|
+
editButtonAriaLabel: "Editar rascunho"
|
|
26831
|
+
};
|
|
26832
|
+
var GoalDraftsTab = ({
|
|
26833
|
+
fetchGoalDrafts,
|
|
26834
|
+
deleteGoalDraft,
|
|
26835
|
+
onCreateDraft,
|
|
26836
|
+
onSendDraft,
|
|
26837
|
+
onEditDraft,
|
|
26838
|
+
emptyStateImage,
|
|
26839
|
+
noSearchImage,
|
|
26840
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
26841
|
+
userFilterData,
|
|
26842
|
+
subjectsMap
|
|
26843
|
+
}) => /* @__PURE__ */ jsx119(
|
|
26844
|
+
ModelsTabBase,
|
|
26845
|
+
{
|
|
26846
|
+
fetchModels: fetchGoalDrafts,
|
|
26847
|
+
deleteModel: deleteGoalDraft,
|
|
26848
|
+
onCreateModel: onCreateDraft,
|
|
26849
|
+
onSend: onSendDraft,
|
|
26850
|
+
onEditModel: onEditDraft,
|
|
26851
|
+
emptyStateImage,
|
|
26852
|
+
noSearchImage,
|
|
26853
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
26854
|
+
userFilterData,
|
|
26855
|
+
subjectsMap,
|
|
26856
|
+
config: GOAL_DRAFTS_CONFIG,
|
|
26857
|
+
createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
|
|
26858
|
+
mapSubject,
|
|
26859
|
+
send,
|
|
26860
|
+
edit,
|
|
26861
|
+
del,
|
|
26862
|
+
GOAL_DRAFTS_COLUMNS_CONFIG
|
|
26863
|
+
),
|
|
26864
|
+
createFiltersConfig: createGoalDraftsFiltersConfig,
|
|
26865
|
+
buildFiltersFromParams: buildGoalModelsFiltersFromParams,
|
|
26866
|
+
createUseModels: createUseGoalDrafts
|
|
26867
|
+
}
|
|
26868
|
+
);
|
|
26869
|
+
|
|
26670
26870
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
26671
|
-
import { Fragment as Fragment26, jsx as
|
|
26871
|
+
import { Fragment as Fragment26, jsx as jsx120, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
26672
26872
|
var GoalPageTab = /* @__PURE__ */ ((GoalPageTab2) => {
|
|
26673
26873
|
GoalPageTab2["HISTORY"] = "history";
|
|
26674
26874
|
GoalPageTab2["DRAFTS"] = "drafts";
|
|
@@ -26714,7 +26914,7 @@ var getSchoolOptions = (data) => {
|
|
|
26714
26914
|
name: school.name
|
|
26715
26915
|
}));
|
|
26716
26916
|
};
|
|
26717
|
-
var
|
|
26917
|
+
var getSubjectOptions3 = (data) => {
|
|
26718
26918
|
if (!data?.subjects) return [];
|
|
26719
26919
|
return data.subjects.map((subject) => ({
|
|
26720
26920
|
id: subject.id,
|
|
@@ -26780,7 +26980,7 @@ var createGoalFiltersConfig = (userData) => [
|
|
|
26780
26980
|
key: "subject",
|
|
26781
26981
|
label: "Mat\xE9ria",
|
|
26782
26982
|
selectedIds: [],
|
|
26783
|
-
itens:
|
|
26983
|
+
itens: getSubjectOptions3(userData)
|
|
26784
26984
|
},
|
|
26785
26985
|
{
|
|
26786
26986
|
key: "theme",
|
|
@@ -26833,7 +27033,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
26833
27033
|
className: "max-w-[200px] truncate",
|
|
26834
27034
|
render: (value) => {
|
|
26835
27035
|
const title = typeof value === "string" ? value : "";
|
|
26836
|
-
return /* @__PURE__ */
|
|
27036
|
+
return /* @__PURE__ */ jsx120(Text_default, { size: "sm", title, children: title });
|
|
26837
27037
|
}
|
|
26838
27038
|
},
|
|
26839
27039
|
{
|
|
@@ -26843,7 +27043,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
26843
27043
|
className: "max-w-[150px] truncate",
|
|
26844
27044
|
render: (value) => {
|
|
26845
27045
|
const school = typeof value === "string" ? value : "";
|
|
26846
|
-
return /* @__PURE__ */
|
|
27046
|
+
return /* @__PURE__ */ jsx120(Text_default, { size: "sm", title: school, children: school });
|
|
26847
27047
|
}
|
|
26848
27048
|
},
|
|
26849
27049
|
{
|
|
@@ -26860,11 +27060,11 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
26860
27060
|
const subjectName = typeof value === "string" ? value : "";
|
|
26861
27061
|
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
26862
27062
|
if (!subjectEnum) {
|
|
26863
|
-
return /* @__PURE__ */
|
|
27063
|
+
return /* @__PURE__ */ jsx120(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
26864
27064
|
}
|
|
26865
27065
|
const subjectInfo = getSubjectInfo(subjectEnum);
|
|
26866
27066
|
return /* @__PURE__ */ jsxs94("div", { className: "flex items-center gap-2", title: subjectName, children: [
|
|
26867
|
-
/* @__PURE__ */
|
|
27067
|
+
/* @__PURE__ */ jsx120(
|
|
26868
27068
|
"span",
|
|
26869
27069
|
{
|
|
26870
27070
|
className: cn(
|
|
@@ -26874,7 +27074,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
26874
27074
|
children: subjectInfo.icon
|
|
26875
27075
|
}
|
|
26876
27076
|
),
|
|
26877
|
-
/* @__PURE__ */
|
|
27077
|
+
/* @__PURE__ */ jsx120(Text_default, { size: "sm", className: "truncate", children: subjectName })
|
|
26878
27078
|
] });
|
|
26879
27079
|
}
|
|
26880
27080
|
},
|
|
@@ -26890,9 +27090,9 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
26890
27090
|
render: (value) => {
|
|
26891
27091
|
const status = typeof value === "string" ? value : "";
|
|
26892
27092
|
if (!status) {
|
|
26893
|
-
return /* @__PURE__ */
|
|
27093
|
+
return /* @__PURE__ */ jsx120(Text_default, { size: "sm", color: "text-text-500", children: "-" });
|
|
26894
27094
|
}
|
|
26895
|
-
return /* @__PURE__ */
|
|
27095
|
+
return /* @__PURE__ */ jsx120(
|
|
26896
27096
|
Badge_default,
|
|
26897
27097
|
{
|
|
26898
27098
|
variant: "solid",
|
|
@@ -26907,7 +27107,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
26907
27107
|
key: "completionPercentage",
|
|
26908
27108
|
label: "Conclus\xE3o",
|
|
26909
27109
|
sortable: true,
|
|
26910
|
-
render: (value) => /* @__PURE__ */
|
|
27110
|
+
render: (value) => /* @__PURE__ */ jsx120(
|
|
26911
27111
|
ProgressBar_default,
|
|
26912
27112
|
{
|
|
26913
27113
|
value: Number(value),
|
|
@@ -26934,19 +27134,19 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
26934
27134
|
onEditGoal?.(row.id);
|
|
26935
27135
|
};
|
|
26936
27136
|
return /* @__PURE__ */ jsxs94("div", { className: "flex justify-center gap-2", children: [
|
|
26937
|
-
/* @__PURE__ */
|
|
27137
|
+
/* @__PURE__ */ jsx120(
|
|
26938
27138
|
IconButton_default,
|
|
26939
27139
|
{
|
|
26940
|
-
icon: /* @__PURE__ */
|
|
27140
|
+
icon: /* @__PURE__ */ jsx120(Trash4, { size: 20 }),
|
|
26941
27141
|
size: "sm",
|
|
26942
27142
|
title: "Excluir",
|
|
26943
27143
|
onClick: handleDelete
|
|
26944
27144
|
}
|
|
26945
27145
|
),
|
|
26946
|
-
/* @__PURE__ */
|
|
27146
|
+
/* @__PURE__ */ jsx120(
|
|
26947
27147
|
IconButton_default,
|
|
26948
27148
|
{
|
|
26949
|
-
icon: /* @__PURE__ */
|
|
27149
|
+
icon: /* @__PURE__ */ jsx120(PencilSimple4, { size: 20 }),
|
|
26950
27150
|
size: "sm",
|
|
26951
27151
|
title: "Editar",
|
|
26952
27152
|
onClick: handleEdit
|
|
@@ -26960,7 +27160,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
26960
27160
|
label: "",
|
|
26961
27161
|
sortable: false,
|
|
26962
27162
|
className: "w-12",
|
|
26963
|
-
render: () => /* @__PURE__ */
|
|
27163
|
+
render: () => /* @__PURE__ */ jsx120("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx120(CaretRight10, { size: 20, className: "text-text-600" }) })
|
|
26964
27164
|
}
|
|
26965
27165
|
];
|
|
26966
27166
|
var RecommendedLessonsHistory = ({
|
|
@@ -26982,10 +27182,14 @@ var RecommendedLessonsHistory = ({
|
|
|
26982
27182
|
onSendLesson,
|
|
26983
27183
|
onEditModel,
|
|
26984
27184
|
subjectsMap,
|
|
27185
|
+
fetchGoalDrafts,
|
|
27186
|
+
deleteGoalDraft,
|
|
27187
|
+
onSendDraft,
|
|
27188
|
+
onEditDraft,
|
|
26985
27189
|
defaultTab,
|
|
26986
27190
|
onTabChange
|
|
26987
27191
|
}) => {
|
|
26988
|
-
const [activeTab, setActiveTab] =
|
|
27192
|
+
const [activeTab, setActiveTab] = useState50(
|
|
26989
27193
|
defaultTab ?? "history" /* HISTORY */
|
|
26990
27194
|
);
|
|
26991
27195
|
useEffect51(() => {
|
|
@@ -26993,7 +27197,7 @@ var RecommendedLessonsHistory = ({
|
|
|
26993
27197
|
setActiveTab(defaultTab);
|
|
26994
27198
|
}
|
|
26995
27199
|
}, [defaultTab]);
|
|
26996
|
-
const handleTabChange =
|
|
27200
|
+
const handleTabChange = useCallback29(
|
|
26997
27201
|
(value) => {
|
|
26998
27202
|
const newTab = value;
|
|
26999
27203
|
setActiveTab(newTab);
|
|
@@ -27024,7 +27228,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27024
27228
|
() => createTableColumns2(mapSubjectNameToEnum2, onDeleteGoal, onEditGoal),
|
|
27025
27229
|
[mapSubjectNameToEnum2, onDeleteGoal, onEditGoal]
|
|
27026
27230
|
);
|
|
27027
|
-
const handleParamsChange =
|
|
27231
|
+
const handleParamsChange = useCallback29(
|
|
27028
27232
|
(params) => {
|
|
27029
27233
|
const filters = buildFiltersFromParams(params);
|
|
27030
27234
|
fetchGoals(filters);
|
|
@@ -27037,10 +27241,10 @@ var RecommendedLessonsHistory = ({
|
|
|
27037
27241
|
"data-testid": "recommended-lessons-history",
|
|
27038
27242
|
className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
|
|
27039
27243
|
children: [
|
|
27040
|
-
/* @__PURE__ */
|
|
27244
|
+
/* @__PURE__ */ jsx120("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
|
|
27041
27245
|
/* @__PURE__ */ jsxs94("div", { className: "flex flex-col w-full h-full max-w-[1350px] mx-auto z-10 lg:px-0 px-4 pt-4 sm:pt-0", children: [
|
|
27042
27246
|
/* @__PURE__ */ jsxs94("div", { className: "flex flex-col sm:flex-row w-full mb-6 items-start sm:items-center sm:justify-between gap-0 sm:gap-4", children: [
|
|
27043
|
-
/* @__PURE__ */
|
|
27247
|
+
/* @__PURE__ */ jsx120(
|
|
27044
27248
|
Text_default,
|
|
27045
27249
|
{
|
|
27046
27250
|
as: "h1",
|
|
@@ -27049,7 +27253,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27049
27253
|
children: title
|
|
27050
27254
|
}
|
|
27051
27255
|
),
|
|
27052
|
-
/* @__PURE__ */
|
|
27256
|
+
/* @__PURE__ */ jsx120("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ jsx120(
|
|
27053
27257
|
Menu,
|
|
27054
27258
|
{
|
|
27055
27259
|
defaultValue: "history" /* HISTORY */,
|
|
@@ -27063,7 +27267,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27063
27267
|
variant: "menu2",
|
|
27064
27268
|
className: "w-full lg:w-auto max-w-full min-w-0",
|
|
27065
27269
|
children: [
|
|
27066
|
-
/* @__PURE__ */
|
|
27270
|
+
/* @__PURE__ */ jsx120(
|
|
27067
27271
|
MenuItem,
|
|
27068
27272
|
{
|
|
27069
27273
|
variant: "menu2",
|
|
@@ -27073,7 +27277,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27073
27277
|
children: "Hist\xF3rico"
|
|
27074
27278
|
}
|
|
27075
27279
|
),
|
|
27076
|
-
/* @__PURE__ */
|
|
27280
|
+
/* @__PURE__ */ jsx120(
|
|
27077
27281
|
MenuItem,
|
|
27078
27282
|
{
|
|
27079
27283
|
variant: "menu2",
|
|
@@ -27083,7 +27287,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27083
27287
|
children: "Rascunhos"
|
|
27084
27288
|
}
|
|
27085
27289
|
),
|
|
27086
|
-
/* @__PURE__ */
|
|
27290
|
+
/* @__PURE__ */ jsx120(
|
|
27087
27291
|
MenuItem,
|
|
27088
27292
|
{
|
|
27089
27293
|
variant: "menu2",
|
|
@@ -27100,7 +27304,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27100
27304
|
) })
|
|
27101
27305
|
] }),
|
|
27102
27306
|
/* @__PURE__ */ jsxs94("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
|
|
27103
|
-
activeTab === "history" /* HISTORY */ && /* @__PURE__ */
|
|
27307
|
+
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ jsx120(Fragment26, { children: error ? /* @__PURE__ */ jsx120("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx120(Text_default, { size: "lg", color: "text-error-500", children: error }) }) : /* @__PURE__ */ jsx120("div", { className: "w-full", children: /* @__PURE__ */ jsx120(
|
|
27104
27308
|
TableProvider,
|
|
27105
27309
|
{
|
|
27106
27310
|
data: goals,
|
|
@@ -27125,14 +27329,14 @@ var RecommendedLessonsHistory = ({
|
|
|
27125
27329
|
image: noSearchImage
|
|
27126
27330
|
},
|
|
27127
27331
|
emptyState: {
|
|
27128
|
-
component: /* @__PURE__ */
|
|
27332
|
+
component: /* @__PURE__ */ jsx120(
|
|
27129
27333
|
EmptyState_default,
|
|
27130
27334
|
{
|
|
27131
27335
|
image: emptyStateImage,
|
|
27132
27336
|
title: "Crie uma nova aula",
|
|
27133
27337
|
description: "Selecione um conjunto de aulas organizadas por tema e ajude seus alunos a estudarem de forma estruturada e eficiente!",
|
|
27134
27338
|
buttonText: createButtonText,
|
|
27135
|
-
buttonIcon: /* @__PURE__ */
|
|
27339
|
+
buttonIcon: /* @__PURE__ */ jsx120(Plus5, { size: 18 }),
|
|
27136
27340
|
buttonVariant: "outline",
|
|
27137
27341
|
buttonAction: "primary",
|
|
27138
27342
|
onButtonClick: onCreateLesson
|
|
@@ -27149,14 +27353,14 @@ var RecommendedLessonsHistory = ({
|
|
|
27149
27353
|
} = renderProps;
|
|
27150
27354
|
return /* @__PURE__ */ jsxs94("div", { className: "space-y-4", children: [
|
|
27151
27355
|
/* @__PURE__ */ jsxs94("div", { className: "flex items-center justify-between gap-4", children: [
|
|
27152
|
-
/* @__PURE__ */
|
|
27356
|
+
/* @__PURE__ */ jsx120(
|
|
27153
27357
|
Button_default,
|
|
27154
27358
|
{
|
|
27155
27359
|
variant: "solid",
|
|
27156
27360
|
action: "primary",
|
|
27157
27361
|
size: "medium",
|
|
27158
27362
|
onClick: onCreateLesson,
|
|
27159
|
-
iconLeft: /* @__PURE__ */
|
|
27363
|
+
iconLeft: /* @__PURE__ */ jsx120(Plus5, { size: 18, weight: "bold" }),
|
|
27160
27364
|
children: createButtonText
|
|
27161
27365
|
}
|
|
27162
27366
|
),
|
|
@@ -27170,8 +27374,22 @@ var RecommendedLessonsHistory = ({
|
|
|
27170
27374
|
}
|
|
27171
27375
|
}
|
|
27172
27376
|
) }) }),
|
|
27173
|
-
activeTab === "drafts" /* DRAFTS */ &&
|
|
27174
|
-
|
|
27377
|
+
activeTab === "drafts" /* DRAFTS */ && fetchGoalDrafts && deleteGoalDraft && onCreateLesson && /* @__PURE__ */ jsx120(
|
|
27378
|
+
GoalDraftsTab,
|
|
27379
|
+
{
|
|
27380
|
+
fetchGoalDrafts,
|
|
27381
|
+
deleteGoalDraft,
|
|
27382
|
+
onCreateDraft: onCreateLesson,
|
|
27383
|
+
onSendDraft,
|
|
27384
|
+
onEditDraft,
|
|
27385
|
+
emptyStateImage,
|
|
27386
|
+
noSearchImage,
|
|
27387
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
27388
|
+
userFilterData,
|
|
27389
|
+
subjectsMap
|
|
27390
|
+
}
|
|
27391
|
+
),
|
|
27392
|
+
activeTab === "models" /* MODELS */ && fetchGoalModels && deleteGoalModel && onCreateModel && /* @__PURE__ */ jsx120(
|
|
27175
27393
|
GoalModelsTab,
|
|
27176
27394
|
{
|
|
27177
27395
|
fetchGoalModels,
|
|
@@ -27194,19 +27412,19 @@ var RecommendedLessonsHistory = ({
|
|
|
27194
27412
|
};
|
|
27195
27413
|
|
|
27196
27414
|
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
27197
|
-
import { useMemo as useMemo30, useState as
|
|
27415
|
+
import { useMemo as useMemo30, useState as useState51, useCallback as useCallback31 } from "react";
|
|
27198
27416
|
|
|
27199
27417
|
// src/components/RecommendedLessonDetails/components/Breadcrumb.tsx
|
|
27200
27418
|
import { CaretRightIcon as CaretRightIcon2 } from "@phosphor-icons/react";
|
|
27201
|
-
import { jsx as
|
|
27202
|
-
var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */
|
|
27419
|
+
import { jsx as jsx121, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
27420
|
+
var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ jsx121("nav", { className: "flex items-center gap-2 text-sm", "aria-label": "Breadcrumb", children: items.map((item, index) => /* @__PURE__ */ jsxs95(
|
|
27203
27421
|
Text_default,
|
|
27204
27422
|
{
|
|
27205
27423
|
as: "span",
|
|
27206
27424
|
className: "flex items-center gap-2",
|
|
27207
27425
|
children: [
|
|
27208
|
-
index > 0 && /* @__PURE__ */
|
|
27209
|
-
item.path ? /* @__PURE__ */
|
|
27426
|
+
index > 0 && /* @__PURE__ */ jsx121(CaretRightIcon2, { size: 14, className: "text-text-500" }),
|
|
27427
|
+
item.path ? /* @__PURE__ */ jsx121(
|
|
27210
27428
|
"button",
|
|
27211
27429
|
{
|
|
27212
27430
|
type: "button",
|
|
@@ -27214,7 +27432,7 @@ var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ jsx120("nav", { cla
|
|
|
27214
27432
|
className: "text-text-600 hover:text-primary-700 transition-colors",
|
|
27215
27433
|
children: item.label
|
|
27216
27434
|
}
|
|
27217
|
-
) : /* @__PURE__ */
|
|
27435
|
+
) : /* @__PURE__ */ jsx121(Text_default, { as: "span", className: "text-text-950 font-medium", children: item.label })
|
|
27218
27436
|
]
|
|
27219
27437
|
},
|
|
27220
27438
|
item.path ?? item.label
|
|
@@ -27243,7 +27461,7 @@ var transformStudentForDisplay = (student, deadline) => ({
|
|
|
27243
27461
|
});
|
|
27244
27462
|
|
|
27245
27463
|
// src/components/RecommendedLessonDetails/components/LessonHeader.tsx
|
|
27246
|
-
import { Fragment as Fragment27, jsx as
|
|
27464
|
+
import { Fragment as Fragment27, jsx as jsx122, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
27247
27465
|
var LessonHeader = ({
|
|
27248
27466
|
data,
|
|
27249
27467
|
onViewLesson,
|
|
@@ -27254,9 +27472,9 @@ var LessonHeader = ({
|
|
|
27254
27472
|
const subjectName = goal.lessonsGoals[0]?.supLessonsProgress?.lesson?.subject?.name || "";
|
|
27255
27473
|
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
27256
27474
|
const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
|
|
27257
|
-
return /* @__PURE__ */
|
|
27475
|
+
return /* @__PURE__ */ jsx122("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ jsxs96("div", { className: "flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4", children: [
|
|
27258
27476
|
/* @__PURE__ */ jsxs96("div", { className: "flex flex-col gap-2", children: [
|
|
27259
|
-
/* @__PURE__ */
|
|
27477
|
+
/* @__PURE__ */ jsx122(
|
|
27260
27478
|
Text_default,
|
|
27261
27479
|
{
|
|
27262
27480
|
as: "h1",
|
|
@@ -27271,19 +27489,19 @@ var LessonHeader = ({
|
|
|
27271
27489
|
"In\xEDcio em ",
|
|
27272
27490
|
formatDate(goal.startDate)
|
|
27273
27491
|
] }),
|
|
27274
|
-
/* @__PURE__ */
|
|
27492
|
+
/* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27275
27493
|
/* @__PURE__ */ jsxs96(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
27276
27494
|
"Prazo final ",
|
|
27277
27495
|
formatDate(goal.finalDate)
|
|
27278
27496
|
] }),
|
|
27279
27497
|
breakdown?.schoolName && /* @__PURE__ */ jsxs96(Fragment27, { children: [
|
|
27280
|
-
/* @__PURE__ */
|
|
27281
|
-
/* @__PURE__ */
|
|
27498
|
+
/* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27499
|
+
/* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.schoolName })
|
|
27282
27500
|
] }),
|
|
27283
27501
|
subjectName && /* @__PURE__ */ jsxs96(Fragment27, { children: [
|
|
27284
|
-
/* @__PURE__ */
|
|
27502
|
+
/* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27285
27503
|
/* @__PURE__ */ jsxs96(Text_default, { as: "span", size: "sm", className: "flex items-center gap-1", children: [
|
|
27286
|
-
subjectInfo && /* @__PURE__ */
|
|
27504
|
+
subjectInfo && /* @__PURE__ */ jsx122(
|
|
27287
27505
|
Text_default,
|
|
27288
27506
|
{
|
|
27289
27507
|
as: "span",
|
|
@@ -27298,18 +27516,18 @@ var LessonHeader = ({
|
|
|
27298
27516
|
] })
|
|
27299
27517
|
] }),
|
|
27300
27518
|
breakdown?.className && /* @__PURE__ */ jsxs96(Fragment27, { children: [
|
|
27301
|
-
/* @__PURE__ */
|
|
27302
|
-
/* @__PURE__ */
|
|
27519
|
+
/* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27520
|
+
/* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.className })
|
|
27303
27521
|
] })
|
|
27304
27522
|
] })
|
|
27305
27523
|
] }),
|
|
27306
|
-
onViewLesson && /* @__PURE__ */
|
|
27524
|
+
onViewLesson && /* @__PURE__ */ jsx122(
|
|
27307
27525
|
Button_default,
|
|
27308
27526
|
{
|
|
27309
27527
|
variant: "solid",
|
|
27310
27528
|
action: "primary",
|
|
27311
27529
|
size: "small",
|
|
27312
|
-
iconLeft: /* @__PURE__ */
|
|
27530
|
+
iconLeft: /* @__PURE__ */ jsx122(BookBookmarkIcon, { size: 16 }),
|
|
27313
27531
|
onClick: onViewLesson,
|
|
27314
27532
|
children: viewLessonLabel
|
|
27315
27533
|
}
|
|
@@ -27318,34 +27536,34 @@ var LessonHeader = ({
|
|
|
27318
27536
|
};
|
|
27319
27537
|
|
|
27320
27538
|
// src/components/RecommendedLessonDetails/components/LoadingSkeleton.tsx
|
|
27321
|
-
import { jsx as
|
|
27539
|
+
import { jsx as jsx123, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
27322
27540
|
var LoadingSkeleton = () => /* @__PURE__ */ jsxs97("div", { className: "flex flex-col gap-6", children: [
|
|
27323
|
-
/* @__PURE__ */
|
|
27324
|
-
/* @__PURE__ */
|
|
27325
|
-
/* @__PURE__ */
|
|
27326
|
-
/* @__PURE__ */
|
|
27541
|
+
/* @__PURE__ */ jsx123(SkeletonText, { width: 256 }),
|
|
27542
|
+
/* @__PURE__ */ jsx123("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ jsxs97("div", { className: "flex flex-col gap-3", children: [
|
|
27543
|
+
/* @__PURE__ */ jsx123(SkeletonText, { width: "75%", height: 28 }),
|
|
27544
|
+
/* @__PURE__ */ jsx123(SkeletonText, { width: "50%" })
|
|
27327
27545
|
] }) }),
|
|
27328
27546
|
/* @__PURE__ */ jsxs97("div", { className: "flex flex-col gap-4", children: [
|
|
27329
|
-
/* @__PURE__ */
|
|
27547
|
+
/* @__PURE__ */ jsx123(SkeletonText, { width: 192, height: 20 }),
|
|
27330
27548
|
/* @__PURE__ */ jsxs97("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
|
|
27331
|
-
/* @__PURE__ */
|
|
27332
|
-
/* @__PURE__ */
|
|
27333
|
-
/* @__PURE__ */
|
|
27549
|
+
/* @__PURE__ */ jsx123(SkeletonRounded, { height: 140 }),
|
|
27550
|
+
/* @__PURE__ */ jsx123(SkeletonRounded, { height: 140 }),
|
|
27551
|
+
/* @__PURE__ */ jsx123(SkeletonRounded, { height: 140 })
|
|
27334
27552
|
] })
|
|
27335
27553
|
] }),
|
|
27336
|
-
/* @__PURE__ */
|
|
27554
|
+
/* @__PURE__ */ jsx123("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ jsx123(SkeletonTable, { rows: 4, columns: 5 }) })
|
|
27337
27555
|
] });
|
|
27338
27556
|
|
|
27339
27557
|
// src/components/RecommendedLessonDetails/components/ResultsSection.tsx
|
|
27340
27558
|
import { TrophyIcon, WarningIcon } from "@phosphor-icons/react";
|
|
27341
|
-
import { jsx as
|
|
27559
|
+
import { jsx as jsx124, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
27342
27560
|
var ResultsSection = ({ data, labels }) => {
|
|
27343
27561
|
const { details } = data;
|
|
27344
27562
|
const { aggregated, contentPerformance } = details;
|
|
27345
27563
|
return /* @__PURE__ */ jsxs98("div", { className: "flex flex-col gap-4", children: [
|
|
27346
|
-
/* @__PURE__ */
|
|
27347
|
-
/* @__PURE__ */
|
|
27348
|
-
/* @__PURE__ */
|
|
27564
|
+
/* @__PURE__ */ jsx124(Text_default, { as: "h2", size: "md", weight: "semibold", className: "text-text-950", children: labels.resultsTitle }),
|
|
27565
|
+
/* @__PURE__ */ jsx124("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ jsxs98("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
|
|
27566
|
+
/* @__PURE__ */ jsx124("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-primary-50", children: /* @__PURE__ */ jsx124(
|
|
27349
27567
|
ProgressCircle_default,
|
|
27350
27568
|
{
|
|
27351
27569
|
value: aggregated.completionPercentage,
|
|
@@ -27356,15 +27574,15 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27356
27574
|
}
|
|
27357
27575
|
) }),
|
|
27358
27576
|
/* @__PURE__ */ jsxs98("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-success-200", children: [
|
|
27359
|
-
/* @__PURE__ */
|
|
27577
|
+
/* @__PURE__ */ jsx124(
|
|
27360
27578
|
Text_default,
|
|
27361
27579
|
{
|
|
27362
27580
|
as: "span",
|
|
27363
27581
|
className: "size-8 rounded-full flex items-center justify-center bg-warning-300 mb-2",
|
|
27364
|
-
children: /* @__PURE__ */
|
|
27582
|
+
children: /* @__PURE__ */ jsx124(TrophyIcon, { size: 18, weight: "fill", className: "text-white" })
|
|
27365
27583
|
}
|
|
27366
27584
|
),
|
|
27367
|
-
/* @__PURE__ */
|
|
27585
|
+
/* @__PURE__ */ jsx124(
|
|
27368
27586
|
Text_default,
|
|
27369
27587
|
{
|
|
27370
27588
|
size: "2xs",
|
|
@@ -27373,7 +27591,7 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27373
27591
|
children: labels.bestResultLabel
|
|
27374
27592
|
}
|
|
27375
27593
|
),
|
|
27376
|
-
/* @__PURE__ */
|
|
27594
|
+
/* @__PURE__ */ jsx124(
|
|
27377
27595
|
Text_default,
|
|
27378
27596
|
{
|
|
27379
27597
|
size: "xl",
|
|
@@ -27384,15 +27602,15 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27384
27602
|
)
|
|
27385
27603
|
] }),
|
|
27386
27604
|
/* @__PURE__ */ jsxs98("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-error-100", children: [
|
|
27387
|
-
/* @__PURE__ */
|
|
27605
|
+
/* @__PURE__ */ jsx124(
|
|
27388
27606
|
Text_default,
|
|
27389
27607
|
{
|
|
27390
27608
|
as: "span",
|
|
27391
27609
|
className: "size-8 rounded-full flex items-center justify-center bg-error-300 mb-2",
|
|
27392
|
-
children: /* @__PURE__ */
|
|
27610
|
+
children: /* @__PURE__ */ jsx124(WarningIcon, { size: 18, weight: "fill", className: "text-error-700" })
|
|
27393
27611
|
}
|
|
27394
27612
|
),
|
|
27395
|
-
/* @__PURE__ */
|
|
27613
|
+
/* @__PURE__ */ jsx124(
|
|
27396
27614
|
Text_default,
|
|
27397
27615
|
{
|
|
27398
27616
|
size: "2xs",
|
|
@@ -27401,7 +27619,7 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27401
27619
|
children: labels.hardestTopicLabel
|
|
27402
27620
|
}
|
|
27403
27621
|
),
|
|
27404
|
-
/* @__PURE__ */
|
|
27622
|
+
/* @__PURE__ */ jsx124(
|
|
27405
27623
|
Text_default,
|
|
27406
27624
|
{
|
|
27407
27625
|
size: "xl",
|
|
@@ -27416,9 +27634,9 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27416
27634
|
};
|
|
27417
27635
|
|
|
27418
27636
|
// src/components/RecommendedLessonDetails/components/StudentsTable.tsx
|
|
27419
|
-
import { useCallback as
|
|
27637
|
+
import { useCallback as useCallback30 } from "react";
|
|
27420
27638
|
import { UserIcon } from "@phosphor-icons/react";
|
|
27421
|
-
import { jsx as
|
|
27639
|
+
import { jsx as jsx125, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
27422
27640
|
var StudentsTable = ({
|
|
27423
27641
|
students,
|
|
27424
27642
|
onViewPerformance,
|
|
@@ -27426,12 +27644,12 @@ var StudentsTable = ({
|
|
|
27426
27644
|
emptyMessage = "Nenhum aluno encontrado"
|
|
27427
27645
|
}) => {
|
|
27428
27646
|
const { sortedData, sortColumn, sortDirection, handleSort } = useTableSort(students);
|
|
27429
|
-
const canViewPerformance =
|
|
27647
|
+
const canViewPerformance = useCallback30((student) => {
|
|
27430
27648
|
return student.status === "CONCLU\xCDDO" /* CONCLUIDO */ || student.status === "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
|
|
27431
27649
|
}, []);
|
|
27432
|
-
return /* @__PURE__ */
|
|
27433
|
-
/* @__PURE__ */
|
|
27434
|
-
/* @__PURE__ */
|
|
27650
|
+
return /* @__PURE__ */ jsx125("div", { className: "bg-background rounded-xl border border-border-50 overflow-hidden", children: /* @__PURE__ */ jsxs99(Table_default, { children: [
|
|
27651
|
+
/* @__PURE__ */ jsx125(TableHeader, { children: /* @__PURE__ */ jsxs99(TableRow, { children: [
|
|
27652
|
+
/* @__PURE__ */ jsx125(
|
|
27435
27653
|
TableHead,
|
|
27436
27654
|
{
|
|
27437
27655
|
sortable: true,
|
|
@@ -27440,7 +27658,7 @@ var StudentsTable = ({
|
|
|
27440
27658
|
children: labels.studentColumn
|
|
27441
27659
|
}
|
|
27442
27660
|
),
|
|
27443
|
-
/* @__PURE__ */
|
|
27661
|
+
/* @__PURE__ */ jsx125(
|
|
27444
27662
|
TableHead,
|
|
27445
27663
|
{
|
|
27446
27664
|
sortable: true,
|
|
@@ -27449,7 +27667,7 @@ var StudentsTable = ({
|
|
|
27449
27667
|
children: labels.statusColumn
|
|
27450
27668
|
}
|
|
27451
27669
|
),
|
|
27452
|
-
/* @__PURE__ */
|
|
27670
|
+
/* @__PURE__ */ jsx125(
|
|
27453
27671
|
TableHead,
|
|
27454
27672
|
{
|
|
27455
27673
|
sortable: true,
|
|
@@ -27458,22 +27676,22 @@ var StudentsTable = ({
|
|
|
27458
27676
|
children: labels.completionColumn
|
|
27459
27677
|
}
|
|
27460
27678
|
),
|
|
27461
|
-
/* @__PURE__ */
|
|
27462
|
-
/* @__PURE__ */
|
|
27679
|
+
/* @__PURE__ */ jsx125(TableHead, { children: labels.durationColumn }),
|
|
27680
|
+
/* @__PURE__ */ jsx125(TableHead, { className: "w-[140px]" })
|
|
27463
27681
|
] }) }),
|
|
27464
|
-
/* @__PURE__ */
|
|
27465
|
-
/* @__PURE__ */
|
|
27466
|
-
/* @__PURE__ */
|
|
27682
|
+
/* @__PURE__ */ jsx125(TableBody, { children: sortedData.length === 0 ? /* @__PURE__ */ jsx125(TableRow, { children: /* @__PURE__ */ jsx125(TableCell, { colSpan: 5, className: "text-center py-8", children: /* @__PURE__ */ jsx125(Text_default, { size: "sm", className: "text-text-500", children: emptyMessage }) }) }) : sortedData.map((student) => /* @__PURE__ */ jsxs99(TableRow, { children: [
|
|
27683
|
+
/* @__PURE__ */ jsx125(TableCell, { children: /* @__PURE__ */ jsxs99("div", { className: "flex items-center gap-2", children: [
|
|
27684
|
+
/* @__PURE__ */ jsx125(
|
|
27467
27685
|
Text_default,
|
|
27468
27686
|
{
|
|
27469
27687
|
as: "span",
|
|
27470
27688
|
className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
|
|
27471
|
-
children: /* @__PURE__ */
|
|
27689
|
+
children: /* @__PURE__ */ jsx125(UserIcon, { size: 16, className: "text-text-500" })
|
|
27472
27690
|
}
|
|
27473
27691
|
),
|
|
27474
|
-
/* @__PURE__ */
|
|
27692
|
+
/* @__PURE__ */ jsx125(Text_default, { size: "sm", className: "text-text-950", children: student.name })
|
|
27475
27693
|
] }) }),
|
|
27476
|
-
/* @__PURE__ */
|
|
27694
|
+
/* @__PURE__ */ jsx125(TableCell, { children: /* @__PURE__ */ jsx125(
|
|
27477
27695
|
Badge_default,
|
|
27478
27696
|
{
|
|
27479
27697
|
variant: "solid",
|
|
@@ -27482,12 +27700,12 @@ var StudentsTable = ({
|
|
|
27482
27700
|
children: student.status
|
|
27483
27701
|
}
|
|
27484
27702
|
) }),
|
|
27485
|
-
/* @__PURE__ */
|
|
27703
|
+
/* @__PURE__ */ jsx125(TableCell, { children: /* @__PURE__ */ jsxs99("div", { className: "flex flex-col gap-1 min-w-[120px]", children: [
|
|
27486
27704
|
/* @__PURE__ */ jsxs99(Text_default, { size: "sm", className: "text-primary-700 font-medium", children: [
|
|
27487
27705
|
student.completionPercentage,
|
|
27488
27706
|
"%"
|
|
27489
27707
|
] }),
|
|
27490
|
-
/* @__PURE__ */
|
|
27708
|
+
/* @__PURE__ */ jsx125(
|
|
27491
27709
|
ProgressBar_default,
|
|
27492
27710
|
{
|
|
27493
27711
|
value: student.completionPercentage,
|
|
@@ -27497,8 +27715,8 @@ var StudentsTable = ({
|
|
|
27497
27715
|
}
|
|
27498
27716
|
)
|
|
27499
27717
|
] }) }),
|
|
27500
|
-
/* @__PURE__ */
|
|
27501
|
-
/* @__PURE__ */
|
|
27718
|
+
/* @__PURE__ */ jsx125(TableCell, { children: /* @__PURE__ */ jsx125(Text_default, { size: "sm", className: "text-text-700", children: student.duration ?? "-" }) }),
|
|
27719
|
+
/* @__PURE__ */ jsx125(TableCell, { children: canViewPerformance(student) ? /* @__PURE__ */ jsx125(
|
|
27502
27720
|
Button_default,
|
|
27503
27721
|
{
|
|
27504
27722
|
variant: "outline",
|
|
@@ -27506,7 +27724,7 @@ var StudentsTable = ({
|
|
|
27506
27724
|
onClick: () => onViewPerformance?.(student.id),
|
|
27507
27725
|
children: labels.viewPerformance
|
|
27508
27726
|
}
|
|
27509
|
-
) : /* @__PURE__ */
|
|
27727
|
+
) : /* @__PURE__ */ jsx125(Button_default, { variant: "outline", size: "extra-small", disabled: true, children: labels.viewPerformance }) })
|
|
27510
27728
|
] }, student.id)) })
|
|
27511
27729
|
] }) });
|
|
27512
27730
|
};
|
|
@@ -27544,7 +27762,7 @@ var DEFAULT_PERFORMANCE_LABELS = {
|
|
|
27544
27762
|
};
|
|
27545
27763
|
|
|
27546
27764
|
// src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
|
|
27547
|
-
import { jsx as
|
|
27765
|
+
import { jsx as jsx126, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
27548
27766
|
var PerformanceCard = ({
|
|
27549
27767
|
icon,
|
|
27550
27768
|
label,
|
|
@@ -27575,7 +27793,7 @@ var PerformanceCard = ({
|
|
|
27575
27793
|
{
|
|
27576
27794
|
className: `flex flex-col items-center justify-center p-4 gap-1 ${headerBgColor}`,
|
|
27577
27795
|
children: [
|
|
27578
|
-
/* @__PURE__ */
|
|
27796
|
+
/* @__PURE__ */ jsx126(
|
|
27579
27797
|
Text_default,
|
|
27580
27798
|
{
|
|
27581
27799
|
as: "span",
|
|
@@ -27583,7 +27801,7 @@ var PerformanceCard = ({
|
|
|
27583
27801
|
children: icon
|
|
27584
27802
|
}
|
|
27585
27803
|
),
|
|
27586
|
-
/* @__PURE__ */
|
|
27804
|
+
/* @__PURE__ */ jsx126(
|
|
27587
27805
|
Text_default,
|
|
27588
27806
|
{
|
|
27589
27807
|
size: "2xs",
|
|
@@ -27592,12 +27810,12 @@ var PerformanceCard = ({
|
|
|
27592
27810
|
children: label
|
|
27593
27811
|
}
|
|
27594
27812
|
),
|
|
27595
|
-
/* @__PURE__ */
|
|
27813
|
+
/* @__PURE__ */ jsx126(Text_default, { size: "xl", weight: "bold", className: `${valueColor} text-center`, children: value })
|
|
27596
27814
|
]
|
|
27597
27815
|
}
|
|
27598
27816
|
),
|
|
27599
27817
|
/* @__PURE__ */ jsxs100("div", { className: "flex flex-col items-center gap-2 px-4 py-3", children: [
|
|
27600
|
-
/* @__PURE__ */
|
|
27818
|
+
/* @__PURE__ */ jsx126(
|
|
27601
27819
|
Text_default,
|
|
27602
27820
|
{
|
|
27603
27821
|
size: "2xs",
|
|
@@ -27606,7 +27824,7 @@ var PerformanceCard = ({
|
|
|
27606
27824
|
children: secondaryLabel
|
|
27607
27825
|
}
|
|
27608
27826
|
),
|
|
27609
|
-
/* @__PURE__ */
|
|
27827
|
+
/* @__PURE__ */ jsx126(Badge_default, { size: "large", action: "info", children: secondaryValue || "-" })
|
|
27610
27828
|
] })
|
|
27611
27829
|
] });
|
|
27612
27830
|
};
|
|
@@ -27633,7 +27851,7 @@ var getSelectedValue = (question) => {
|
|
|
27633
27851
|
var QuestionAccordionItem = ({
|
|
27634
27852
|
question,
|
|
27635
27853
|
index
|
|
27636
|
-
}) => /* @__PURE__ */
|
|
27854
|
+
}) => /* @__PURE__ */ jsx126(
|
|
27637
27855
|
CardAccordation,
|
|
27638
27856
|
{
|
|
27639
27857
|
value: question.id,
|
|
@@ -27645,28 +27863,28 @@ var QuestionAccordionItem = ({
|
|
|
27645
27863
|
"Quest\xE3o ",
|
|
27646
27864
|
index + 1
|
|
27647
27865
|
] }),
|
|
27648
|
-
/* @__PURE__ */
|
|
27866
|
+
/* @__PURE__ */ jsx126(
|
|
27649
27867
|
Badge_default,
|
|
27650
27868
|
{
|
|
27651
27869
|
size: "small",
|
|
27652
27870
|
action: question.isCorrect ? "success" : "error",
|
|
27653
27871
|
variant: "solid",
|
|
27654
|
-
iconLeft: question.isCorrect ? /* @__PURE__ */
|
|
27872
|
+
iconLeft: question.isCorrect ? /* @__PURE__ */ jsx126(CheckCircleIcon, {}) : /* @__PURE__ */ jsx126(XCircleIcon, {}),
|
|
27655
27873
|
children: question.isCorrect ? "Correta" : "Incorreta"
|
|
27656
27874
|
}
|
|
27657
27875
|
)
|
|
27658
27876
|
] }),
|
|
27659
27877
|
children: /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-3", children: [
|
|
27660
|
-
/* @__PURE__ */
|
|
27661
|
-
/* @__PURE__ */
|
|
27878
|
+
/* @__PURE__ */ jsx126(Text_default, { size: "sm", className: "text-text-700", children: question.statement }),
|
|
27879
|
+
/* @__PURE__ */ jsx126(
|
|
27662
27880
|
CardAccordation,
|
|
27663
27881
|
{
|
|
27664
27882
|
value: `${question.id}-alternatives`,
|
|
27665
27883
|
className: "bg-background rounded-lg border border-border-50",
|
|
27666
27884
|
triggerClassName: "py-5 px-5",
|
|
27667
27885
|
contentClassName: "px-5 py-5",
|
|
27668
|
-
trigger: /* @__PURE__ */
|
|
27669
|
-
children: /* @__PURE__ */
|
|
27886
|
+
trigger: /* @__PURE__ */ jsx126(Text_default, { size: "sm", weight: "medium", className: "text-text-800", children: "Alternativas" }),
|
|
27887
|
+
children: /* @__PURE__ */ jsx126(
|
|
27670
27888
|
AlternativesList,
|
|
27671
27889
|
{
|
|
27672
27890
|
mode: "readonly",
|
|
@@ -27680,7 +27898,7 @@ var QuestionAccordionItem = ({
|
|
|
27680
27898
|
] })
|
|
27681
27899
|
}
|
|
27682
27900
|
);
|
|
27683
|
-
var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */
|
|
27901
|
+
var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx126(
|
|
27684
27902
|
CardAccordation,
|
|
27685
27903
|
{
|
|
27686
27904
|
value: lesson.id,
|
|
@@ -27688,8 +27906,8 @@ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx125(
|
|
|
27688
27906
|
triggerClassName: "py-5 px-5",
|
|
27689
27907
|
contentClassName: "px-5 pb-5",
|
|
27690
27908
|
trigger: /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-1 flex-1", children: [
|
|
27691
|
-
/* @__PURE__ */
|
|
27692
|
-
/* @__PURE__ */
|
|
27909
|
+
/* @__PURE__ */ jsx126(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: lesson.title }),
|
|
27910
|
+
/* @__PURE__ */ jsx126(
|
|
27693
27911
|
ProgressBar_default,
|
|
27694
27912
|
{
|
|
27695
27913
|
value: lesson.progress,
|
|
@@ -27700,7 +27918,7 @@ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx125(
|
|
|
27700
27918
|
}
|
|
27701
27919
|
)
|
|
27702
27920
|
] }),
|
|
27703
|
-
children: /* @__PURE__ */
|
|
27921
|
+
children: /* @__PURE__ */ jsx126("div", { className: "flex flex-col gap-2", children: lesson.questions.map((question, index) => /* @__PURE__ */ jsx126(
|
|
27704
27922
|
QuestionAccordionItem,
|
|
27705
27923
|
{
|
|
27706
27924
|
question,
|
|
@@ -27711,43 +27929,43 @@ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx125(
|
|
|
27711
27929
|
}
|
|
27712
27930
|
);
|
|
27713
27931
|
var LoadingSkeleton2 = () => /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-4 animate-pulse", children: [
|
|
27714
|
-
/* @__PURE__ */
|
|
27932
|
+
/* @__PURE__ */ jsx126("div", { className: "h-6 bg-background-200 rounded w-48" }),
|
|
27715
27933
|
/* @__PURE__ */ jsxs100("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
27716
|
-
/* @__PURE__ */
|
|
27717
|
-
/* @__PURE__ */
|
|
27934
|
+
/* @__PURE__ */ jsx126("div", { className: "h-44 bg-background-200 rounded-xl" }),
|
|
27935
|
+
/* @__PURE__ */ jsx126("div", { className: "h-44 bg-background-200 rounded-xl" })
|
|
27718
27936
|
] })
|
|
27719
27937
|
] });
|
|
27720
27938
|
var ErrorContent = ({ message }) => /* @__PURE__ */ jsxs100("div", { className: "flex flex-col items-center justify-center py-8 gap-3", children: [
|
|
27721
|
-
/* @__PURE__ */
|
|
27939
|
+
/* @__PURE__ */ jsx126(
|
|
27722
27940
|
Text_default,
|
|
27723
27941
|
{
|
|
27724
27942
|
as: "span",
|
|
27725
27943
|
className: "size-12 rounded-full bg-error-100 flex items-center justify-center",
|
|
27726
|
-
children: /* @__PURE__ */
|
|
27944
|
+
children: /* @__PURE__ */ jsx126(WarningCircleIcon2, { size: 24, className: "text-error-700" })
|
|
27727
27945
|
}
|
|
27728
27946
|
),
|
|
27729
|
-
/* @__PURE__ */
|
|
27947
|
+
/* @__PURE__ */ jsx126(Text_default, { size: "md", className: "text-error-700 text-center", children: message })
|
|
27730
27948
|
] });
|
|
27731
27949
|
var PerformanceContent = ({
|
|
27732
27950
|
data,
|
|
27733
27951
|
labels
|
|
27734
27952
|
}) => /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-5", children: [
|
|
27735
27953
|
/* @__PURE__ */ jsxs100("div", { className: "flex items-center gap-2", children: [
|
|
27736
|
-
/* @__PURE__ */
|
|
27954
|
+
/* @__PURE__ */ jsx126(
|
|
27737
27955
|
Text_default,
|
|
27738
27956
|
{
|
|
27739
27957
|
as: "span",
|
|
27740
27958
|
className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
|
|
27741
|
-
children: /* @__PURE__ */
|
|
27959
|
+
children: /* @__PURE__ */ jsx126(UserIcon2, { size: 16, className: "text-text-500" })
|
|
27742
27960
|
}
|
|
27743
27961
|
),
|
|
27744
|
-
/* @__PURE__ */
|
|
27962
|
+
/* @__PURE__ */ jsx126(Text_default, { size: "md", weight: "medium", className: "text-text-950", children: data.studentName })
|
|
27745
27963
|
] }),
|
|
27746
27964
|
/* @__PURE__ */ jsxs100("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
27747
|
-
/* @__PURE__ */
|
|
27965
|
+
/* @__PURE__ */ jsx126(
|
|
27748
27966
|
PerformanceCard,
|
|
27749
27967
|
{
|
|
27750
|
-
icon: /* @__PURE__ */
|
|
27968
|
+
icon: /* @__PURE__ */ jsx126(
|
|
27751
27969
|
LightbulbFilamentIcon,
|
|
27752
27970
|
{
|
|
27753
27971
|
size: 18,
|
|
@@ -27762,10 +27980,10 @@ var PerformanceContent = ({
|
|
|
27762
27980
|
variant: "success"
|
|
27763
27981
|
}
|
|
27764
27982
|
),
|
|
27765
|
-
/* @__PURE__ */
|
|
27983
|
+
/* @__PURE__ */ jsx126(
|
|
27766
27984
|
PerformanceCard,
|
|
27767
27985
|
{
|
|
27768
|
-
icon: /* @__PURE__ */
|
|
27986
|
+
icon: /* @__PURE__ */ jsx126(
|
|
27769
27987
|
WarningCircleIcon2,
|
|
27770
27988
|
{
|
|
27771
27989
|
size: 18,
|
|
@@ -27782,19 +28000,19 @@ var PerformanceContent = ({
|
|
|
27782
28000
|
)
|
|
27783
28001
|
] }),
|
|
27784
28002
|
data.lessons.length > 0 && /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-3", children: [
|
|
27785
|
-
/* @__PURE__ */
|
|
27786
|
-
/* @__PURE__ */
|
|
28003
|
+
/* @__PURE__ */ jsx126(Text_default, { size: "md", weight: "semibold", className: "text-text-950", children: labels.lessonsTitle }),
|
|
28004
|
+
/* @__PURE__ */ jsx126("div", { className: "flex flex-col gap-2", children: data.lessons.map((lesson) => /* @__PURE__ */ jsx126(LessonAccordionItem, { lesson }, lesson.id)) })
|
|
27787
28005
|
] })
|
|
27788
28006
|
] });
|
|
27789
28007
|
var renderModalContent = (loading, error, data, labels) => {
|
|
27790
28008
|
if (loading) {
|
|
27791
|
-
return /* @__PURE__ */
|
|
28009
|
+
return /* @__PURE__ */ jsx126(LoadingSkeleton2, {});
|
|
27792
28010
|
}
|
|
27793
28011
|
if (error) {
|
|
27794
|
-
return /* @__PURE__ */
|
|
28012
|
+
return /* @__PURE__ */ jsx126(ErrorContent, { message: error });
|
|
27795
28013
|
}
|
|
27796
28014
|
if (data) {
|
|
27797
|
-
return /* @__PURE__ */
|
|
28015
|
+
return /* @__PURE__ */ jsx126(PerformanceContent, { data, labels });
|
|
27798
28016
|
}
|
|
27799
28017
|
return null;
|
|
27800
28018
|
};
|
|
@@ -27813,7 +28031,7 @@ var StudentPerformanceModal = ({
|
|
|
27813
28031
|
if (!data && !loading && !error) {
|
|
27814
28032
|
return null;
|
|
27815
28033
|
}
|
|
27816
|
-
return /* @__PURE__ */
|
|
28034
|
+
return /* @__PURE__ */ jsx126(
|
|
27817
28035
|
Modal_default,
|
|
27818
28036
|
{
|
|
27819
28037
|
isOpen,
|
|
@@ -27827,7 +28045,7 @@ var StudentPerformanceModal = ({
|
|
|
27827
28045
|
};
|
|
27828
28046
|
|
|
27829
28047
|
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
27830
|
-
import { Fragment as Fragment28, jsx as
|
|
28048
|
+
import { Fragment as Fragment28, jsx as jsx127, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
27831
28049
|
var RecommendedLessonDetails = ({
|
|
27832
28050
|
goalId,
|
|
27833
28051
|
data,
|
|
@@ -27845,11 +28063,11 @@ var RecommendedLessonDetails = ({
|
|
|
27845
28063
|
() => ({ ...DEFAULT_LABELS, ...customLabels }),
|
|
27846
28064
|
[customLabels]
|
|
27847
28065
|
);
|
|
27848
|
-
const [performanceModalOpen, setPerformanceModalOpen] =
|
|
27849
|
-
const [performanceData, setPerformanceData] =
|
|
27850
|
-
const [performanceLoading, setPerformanceLoading] =
|
|
27851
|
-
const [performanceError, setPerformanceError] =
|
|
27852
|
-
const handleViewStudentPerformance =
|
|
28066
|
+
const [performanceModalOpen, setPerformanceModalOpen] = useState51(false);
|
|
28067
|
+
const [performanceData, setPerformanceData] = useState51(null);
|
|
28068
|
+
const [performanceLoading, setPerformanceLoading] = useState51(false);
|
|
28069
|
+
const [performanceError, setPerformanceError] = useState51(null);
|
|
28070
|
+
const handleViewStudentPerformance = useCallback31(
|
|
27853
28071
|
async (studentId) => {
|
|
27854
28072
|
if (!fetchStudentPerformance || !goalId) return;
|
|
27855
28073
|
setPerformanceModalOpen(true);
|
|
@@ -27870,7 +28088,7 @@ var RecommendedLessonDetails = ({
|
|
|
27870
28088
|
},
|
|
27871
28089
|
[fetchStudentPerformance, goalId]
|
|
27872
28090
|
);
|
|
27873
|
-
const handleClosePerformanceModal =
|
|
28091
|
+
const handleClosePerformanceModal = useCallback31(() => {
|
|
27874
28092
|
setPerformanceModalOpen(false);
|
|
27875
28093
|
setPerformanceData(null);
|
|
27876
28094
|
setPerformanceError(null);
|
|
@@ -27891,17 +28109,17 @@ var RecommendedLessonDetails = ({
|
|
|
27891
28109
|
);
|
|
27892
28110
|
}, [data?.details.students, data?.goal.finalDate]);
|
|
27893
28111
|
if (loading) {
|
|
27894
|
-
return /* @__PURE__ */
|
|
28112
|
+
return /* @__PURE__ */ jsx127(
|
|
27895
28113
|
"div",
|
|
27896
28114
|
{
|
|
27897
28115
|
className: cn("flex flex-col gap-6", className),
|
|
27898
28116
|
"data-testid": "lesson-details-loading",
|
|
27899
|
-
children: /* @__PURE__ */
|
|
28117
|
+
children: /* @__PURE__ */ jsx127(LoadingSkeleton, {})
|
|
27900
28118
|
}
|
|
27901
28119
|
);
|
|
27902
28120
|
}
|
|
27903
28121
|
if (error) {
|
|
27904
|
-
return /* @__PURE__ */
|
|
28122
|
+
return /* @__PURE__ */ jsx127(
|
|
27905
28123
|
"div",
|
|
27906
28124
|
{
|
|
27907
28125
|
className: cn(
|
|
@@ -27909,7 +28127,7 @@ var RecommendedLessonDetails = ({
|
|
|
27909
28127
|
className
|
|
27910
28128
|
),
|
|
27911
28129
|
"data-testid": "lesson-details-error",
|
|
27912
|
-
children: /* @__PURE__ */
|
|
28130
|
+
children: /* @__PURE__ */ jsx127(Text_default, { size: "md", className: "text-error-700", children: error })
|
|
27913
28131
|
}
|
|
27914
28132
|
);
|
|
27915
28133
|
}
|
|
@@ -27923,8 +28141,8 @@ var RecommendedLessonDetails = ({
|
|
|
27923
28141
|
className: cn("flex flex-col gap-6", className),
|
|
27924
28142
|
"data-testid": "recommended-lesson-details",
|
|
27925
28143
|
children: [
|
|
27926
|
-
/* @__PURE__ */
|
|
27927
|
-
/* @__PURE__ */
|
|
28144
|
+
/* @__PURE__ */ jsx127(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
|
|
28145
|
+
/* @__PURE__ */ jsx127(
|
|
27928
28146
|
LessonHeader,
|
|
27929
28147
|
{
|
|
27930
28148
|
data,
|
|
@@ -27933,8 +28151,8 @@ var RecommendedLessonDetails = ({
|
|
|
27933
28151
|
viewLessonLabel: labels.viewLesson
|
|
27934
28152
|
}
|
|
27935
28153
|
),
|
|
27936
|
-
/* @__PURE__ */
|
|
27937
|
-
/* @__PURE__ */
|
|
28154
|
+
/* @__PURE__ */ jsx127(ResultsSection, { data, labels }),
|
|
28155
|
+
/* @__PURE__ */ jsx127(
|
|
27938
28156
|
StudentsTable,
|
|
27939
28157
|
{
|
|
27940
28158
|
students: displayStudents,
|
|
@@ -27945,7 +28163,7 @@ var RecommendedLessonDetails = ({
|
|
|
27945
28163
|
]
|
|
27946
28164
|
}
|
|
27947
28165
|
),
|
|
27948
|
-
fetchStudentPerformance && /* @__PURE__ */
|
|
28166
|
+
fetchStudentPerformance && /* @__PURE__ */ jsx127(
|
|
27949
28167
|
StudentPerformanceModal,
|
|
27950
28168
|
{
|
|
27951
28169
|
isOpen: performanceModalOpen,
|
|
@@ -27960,7 +28178,7 @@ var RecommendedLessonDetails = ({
|
|
|
27960
28178
|
var RecommendedLessonDetails_default = RecommendedLessonDetails;
|
|
27961
28179
|
|
|
27962
28180
|
// src/hooks/useRecommendedLessonsPage.ts
|
|
27963
|
-
import { useCallback as
|
|
28181
|
+
import { useCallback as useCallback32, useRef as useRef33, useMemo as useMemo31, useState as useState52 } from "react";
|
|
27964
28182
|
var buildQueryParams2 = (filters) => {
|
|
27965
28183
|
if (!filters) return {};
|
|
27966
28184
|
const params = {};
|
|
@@ -27994,7 +28212,7 @@ var getClassOptions2 = (userData) => {
|
|
|
27994
28212
|
});
|
|
27995
28213
|
return Array.from(classMap.entries()).map(([id, name]) => ({ id, name }));
|
|
27996
28214
|
};
|
|
27997
|
-
var
|
|
28215
|
+
var getSubjectOptions4 = (userData) => {
|
|
27998
28216
|
if (!userData?.subTeacherTopicClasses) return [];
|
|
27999
28217
|
const subjectMap = /* @__PURE__ */ new Map();
|
|
28000
28218
|
userData.subTeacherTopicClasses.forEach((stc) => {
|
|
@@ -28018,25 +28236,25 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28018
28236
|
} = config;
|
|
28019
28237
|
return () => {
|
|
28020
28238
|
const goalsMapRef = useRef33(/* @__PURE__ */ new Map());
|
|
28021
|
-
const [sendModalOpen, setSendModalOpen] =
|
|
28022
|
-
const [selectedModel, setSelectedModel] =
|
|
28023
|
-
const [sendModalLoading, setSendModalLoading] =
|
|
28024
|
-
const [sendModalCategories, setSendModalCategories] =
|
|
28239
|
+
const [sendModalOpen, setSendModalOpen] = useState52(false);
|
|
28240
|
+
const [selectedModel, setSelectedModel] = useState52(null);
|
|
28241
|
+
const [sendModalLoading, setSendModalLoading] = useState52(false);
|
|
28242
|
+
const [sendModalCategories, setSendModalCategories] = useState52([]);
|
|
28025
28243
|
const userFilterData = useMemo31(
|
|
28026
28244
|
() => ({
|
|
28027
28245
|
schools: getSchoolOptions2(userData),
|
|
28028
28246
|
classes: getClassOptions2(userData),
|
|
28029
|
-
subjects:
|
|
28247
|
+
subjects: getSubjectOptions4(userData)
|
|
28030
28248
|
}),
|
|
28031
28249
|
[userData]
|
|
28032
28250
|
);
|
|
28033
28251
|
const subjectsMap = useMemo31(() => {
|
|
28034
28252
|
const map = /* @__PURE__ */ new Map();
|
|
28035
|
-
const subjects =
|
|
28253
|
+
const subjects = getSubjectOptions4(userData);
|
|
28036
28254
|
subjects.forEach((s) => map.set(s.id, s.name));
|
|
28037
28255
|
return map;
|
|
28038
28256
|
}, [userData]);
|
|
28039
|
-
const fetchGoalsHistory =
|
|
28257
|
+
const fetchGoalsHistory = useCallback32(
|
|
28040
28258
|
async (filters) => {
|
|
28041
28259
|
const params = buildQueryParams2(filters);
|
|
28042
28260
|
const response = await api.get(
|
|
@@ -28051,7 +28269,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28051
28269
|
},
|
|
28052
28270
|
[api, endpoints.goalsHistory]
|
|
28053
28271
|
);
|
|
28054
|
-
const fetchGoalModels =
|
|
28272
|
+
const fetchGoalModels = useCallback32(
|
|
28055
28273
|
async (filters) => {
|
|
28056
28274
|
const params = buildQueryParams2({
|
|
28057
28275
|
...filters,
|
|
@@ -28065,31 +28283,51 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28065
28283
|
},
|
|
28066
28284
|
[api, endpoints.goalDrafts]
|
|
28067
28285
|
);
|
|
28068
|
-
const deleteGoalModel =
|
|
28286
|
+
const deleteGoalModel = useCallback32(
|
|
28287
|
+
async (id) => {
|
|
28288
|
+
await api.delete(`${endpoints.goalDrafts}/${id}`);
|
|
28289
|
+
},
|
|
28290
|
+
[api, endpoints.goalDrafts]
|
|
28291
|
+
);
|
|
28292
|
+
const fetchGoalDrafts = useCallback32(
|
|
28293
|
+
async (filters) => {
|
|
28294
|
+
const params = buildQueryParams2({
|
|
28295
|
+
...filters,
|
|
28296
|
+
type: "RASCUNHO" /* RASCUNHO */
|
|
28297
|
+
});
|
|
28298
|
+
const response = await api.get(
|
|
28299
|
+
endpoints.goalDrafts,
|
|
28300
|
+
{ params }
|
|
28301
|
+
);
|
|
28302
|
+
return response.data;
|
|
28303
|
+
},
|
|
28304
|
+
[api, endpoints.goalDrafts]
|
|
28305
|
+
);
|
|
28306
|
+
const deleteGoalDraft = useCallback32(
|
|
28069
28307
|
async (id) => {
|
|
28070
28308
|
await api.delete(`${endpoints.goalDrafts}/${id}`);
|
|
28071
28309
|
},
|
|
28072
28310
|
[api, endpoints.goalDrafts]
|
|
28073
28311
|
);
|
|
28074
|
-
const handleCreateLesson =
|
|
28312
|
+
const handleCreateLesson = useCallback32(() => {
|
|
28075
28313
|
navigate(paths.createLesson);
|
|
28076
28314
|
}, []);
|
|
28077
|
-
const handleCreateModel =
|
|
28315
|
+
const handleCreateModel = useCallback32(() => {
|
|
28078
28316
|
navigate(paths.createModel);
|
|
28079
28317
|
}, []);
|
|
28080
|
-
const handleRowClick =
|
|
28318
|
+
const handleRowClick = useCallback32((row) => {
|
|
28081
28319
|
const originalData = goalsMapRef.current.get(row.id);
|
|
28082
28320
|
navigate(`${paths.lessonDetails}/${row.id}`, {
|
|
28083
28321
|
state: { goalData: originalData }
|
|
28084
28322
|
});
|
|
28085
28323
|
}, []);
|
|
28086
|
-
const handleEditGoal =
|
|
28324
|
+
const handleEditGoal = useCallback32((id) => {
|
|
28087
28325
|
navigate(`${paths.editLesson}/${id}/editar`);
|
|
28088
28326
|
}, []);
|
|
28089
|
-
const handleEditModel =
|
|
28327
|
+
const handleEditModel = useCallback32((model) => {
|
|
28090
28328
|
navigate(`${paths.editModel}${model.id}`);
|
|
28091
28329
|
}, []);
|
|
28092
|
-
const handleSendLesson =
|
|
28330
|
+
const handleSendLesson = useCallback32(
|
|
28093
28331
|
(model) => {
|
|
28094
28332
|
setSelectedModel(model);
|
|
28095
28333
|
const classes = getClassOptions2(userData);
|
|
@@ -28112,7 +28350,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28112
28350
|
},
|
|
28113
28351
|
[userData]
|
|
28114
28352
|
);
|
|
28115
|
-
const handleSendLessonSubmit =
|
|
28353
|
+
const handleSendLessonSubmit = useCallback32(
|
|
28116
28354
|
async (formData) => {
|
|
28117
28355
|
if (!selectedModel) return;
|
|
28118
28356
|
setSendModalLoading(true);
|
|
@@ -28131,11 +28369,11 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28131
28369
|
},
|
|
28132
28370
|
[api, endpoints.submitGoal, selectedModel]
|
|
28133
28371
|
);
|
|
28134
|
-
const handleSendModalClose =
|
|
28372
|
+
const handleSendModalClose = useCallback32(() => {
|
|
28135
28373
|
setSendModalOpen(false);
|
|
28136
28374
|
setSelectedModel(null);
|
|
28137
28375
|
}, []);
|
|
28138
|
-
const handleCategoriesChange =
|
|
28376
|
+
const handleCategoriesChange = useCallback32(
|
|
28139
28377
|
(categories) => {
|
|
28140
28378
|
setSendModalCategories(categories);
|
|
28141
28379
|
},
|
|
@@ -28152,6 +28390,10 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28152
28390
|
onEditGoal: handleEditGoal,
|
|
28153
28391
|
onEditModel: handleEditModel,
|
|
28154
28392
|
onSendLesson: handleSendLesson,
|
|
28393
|
+
fetchGoalDrafts,
|
|
28394
|
+
deleteGoalDraft,
|
|
28395
|
+
onSendDraft: handleSendLesson,
|
|
28396
|
+
onEditDraft: handleEditModel,
|
|
28155
28397
|
emptyStateImage,
|
|
28156
28398
|
noSearchImage,
|
|
28157
28399
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
@@ -28177,7 +28419,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28177
28419
|
var createRecommendedLessonsPageHook = createUseRecommendedLessonsPage;
|
|
28178
28420
|
|
|
28179
28421
|
// src/hooks/useRecommendedLessonDetails.ts
|
|
28180
|
-
import { useState as
|
|
28422
|
+
import { useState as useState53, useCallback as useCallback33, useEffect as useEffect52 } from "react";
|
|
28181
28423
|
import { z as z7 } from "zod";
|
|
28182
28424
|
var goalLessonSubjectSchema = z7.object({
|
|
28183
28425
|
id: z7.string(),
|
|
@@ -28280,12 +28522,12 @@ var handleLessonDetailsFetchError = (error) => {
|
|
|
28280
28522
|
};
|
|
28281
28523
|
var createUseRecommendedLessonDetails = (apiClient) => {
|
|
28282
28524
|
return (lessonId) => {
|
|
28283
|
-
const [state, setState] =
|
|
28525
|
+
const [state, setState] = useState53({
|
|
28284
28526
|
data: null,
|
|
28285
28527
|
loading: true,
|
|
28286
28528
|
error: null
|
|
28287
28529
|
});
|
|
28288
|
-
const fetchLessonDetails =
|
|
28530
|
+
const fetchLessonDetails = useCallback33(async () => {
|
|
28289
28531
|
if (!lessonId) {
|
|
28290
28532
|
setState({
|
|
28291
28533
|
data: null,
|
|
@@ -28343,20 +28585,20 @@ var createUseRecommendedLessonDetails = (apiClient) => {
|
|
|
28343
28585
|
var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
28344
28586
|
|
|
28345
28587
|
// src/components/ActivitiesHistory/ActivitiesHistory.tsx
|
|
28346
|
-
import { useState as
|
|
28588
|
+
import { useState as useState56 } from "react";
|
|
28347
28589
|
|
|
28348
28590
|
// src/components/ActivitiesHistory/tabs/HistoryTab.tsx
|
|
28349
|
-
import { useCallback as
|
|
28591
|
+
import { useCallback as useCallback35, useMemo as useMemo32, useRef as useRef34 } from "react";
|
|
28350
28592
|
import { Plus as Plus6 } from "phosphor-react";
|
|
28351
28593
|
|
|
28352
28594
|
// src/components/ActivitiesHistory/config/historyTableColumns.tsx
|
|
28353
28595
|
import { CaretRight as CaretRight11 } from "phosphor-react";
|
|
28354
28596
|
|
|
28355
28597
|
// src/components/ActivitiesHistory/utils/renderTruncatedText.tsx
|
|
28356
|
-
import { jsx as
|
|
28598
|
+
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
28357
28599
|
var renderTruncatedText = (value) => {
|
|
28358
28600
|
const text = typeof value === "string" ? value : "";
|
|
28359
|
-
return /* @__PURE__ */
|
|
28601
|
+
return /* @__PURE__ */ jsx128(Text_default, { size: "sm", title: text, children: text });
|
|
28360
28602
|
};
|
|
28361
28603
|
|
|
28362
28604
|
// src/components/ActivitiesHistory/utils/filterBuilders.ts
|
|
@@ -28402,7 +28644,7 @@ var getSchoolOptions3 = (data) => {
|
|
|
28402
28644
|
name: school.name
|
|
28403
28645
|
}));
|
|
28404
28646
|
};
|
|
28405
|
-
var
|
|
28647
|
+
var getSubjectOptions5 = (data) => {
|
|
28406
28648
|
if (!data?.subjects) return [];
|
|
28407
28649
|
return data.subjects.map((subject) => ({
|
|
28408
28650
|
id: subject.id,
|
|
@@ -28411,7 +28653,7 @@ var getSubjectOptions4 = (data) => {
|
|
|
28411
28653
|
};
|
|
28412
28654
|
|
|
28413
28655
|
// src/components/ActivitiesHistory/config/historyTableColumns.tsx
|
|
28414
|
-
import { jsx as
|
|
28656
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
28415
28657
|
var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
28416
28658
|
{
|
|
28417
28659
|
key: "startDate",
|
|
@@ -28464,9 +28706,9 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
|
28464
28706
|
render: (value) => {
|
|
28465
28707
|
const status = typeof value === "string" ? value : "";
|
|
28466
28708
|
if (!status) {
|
|
28467
|
-
return /* @__PURE__ */
|
|
28709
|
+
return /* @__PURE__ */ jsx129(Text_default, { size: "sm", color: "text-text-500", children: "-" });
|
|
28468
28710
|
}
|
|
28469
|
-
return /* @__PURE__ */
|
|
28711
|
+
return /* @__PURE__ */ jsx129(
|
|
28470
28712
|
Badge_default,
|
|
28471
28713
|
{
|
|
28472
28714
|
variant: "solid",
|
|
@@ -28481,7 +28723,7 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
|
28481
28723
|
key: "completionPercentage",
|
|
28482
28724
|
label: "Conclus\xE3o",
|
|
28483
28725
|
sortable: true,
|
|
28484
|
-
render: (value) => /* @__PURE__ */
|
|
28726
|
+
render: (value) => /* @__PURE__ */ jsx129(
|
|
28485
28727
|
ProgressBar_default,
|
|
28486
28728
|
{
|
|
28487
28729
|
value: Number(value),
|
|
@@ -28498,7 +28740,7 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
|
28498
28740
|
label: "",
|
|
28499
28741
|
sortable: false,
|
|
28500
28742
|
className: "w-12",
|
|
28501
|
-
render: () => /* @__PURE__ */
|
|
28743
|
+
render: () => /* @__PURE__ */ jsx129("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx129(CaretRight11, { size: 20, className: "text-text-600" }) })
|
|
28502
28744
|
}
|
|
28503
28745
|
];
|
|
28504
28746
|
|
|
@@ -28536,14 +28778,14 @@ var createHistoryFiltersConfig = (userData) => [
|
|
|
28536
28778
|
key: "subject",
|
|
28537
28779
|
label: "Mat\xE9ria",
|
|
28538
28780
|
selectedIds: [],
|
|
28539
|
-
itens:
|
|
28781
|
+
itens: getSubjectOptions5(userData)
|
|
28540
28782
|
}
|
|
28541
28783
|
]
|
|
28542
28784
|
}
|
|
28543
28785
|
];
|
|
28544
28786
|
|
|
28545
28787
|
// src/hooks/useActivitiesHistory.ts
|
|
28546
|
-
import { useState as
|
|
28788
|
+
import { useState as useState54, useCallback as useCallback34 } from "react";
|
|
28547
28789
|
import { z as z8 } from "zod";
|
|
28548
28790
|
import dayjs6 from "dayjs";
|
|
28549
28791
|
var activityHistoryResponseSchema = z8.object({
|
|
@@ -28602,13 +28844,13 @@ var handleActivityFetchError = createFetchErrorHandler(
|
|
|
28602
28844
|
);
|
|
28603
28845
|
var createUseActivitiesHistory = (fetchActivitiesHistory) => {
|
|
28604
28846
|
return () => {
|
|
28605
|
-
const [state, setState] =
|
|
28847
|
+
const [state, setState] = useState54({
|
|
28606
28848
|
activities: [],
|
|
28607
28849
|
loading: false,
|
|
28608
28850
|
error: null,
|
|
28609
28851
|
pagination: DEFAULT_ACTIVITIES_PAGINATION
|
|
28610
28852
|
});
|
|
28611
|
-
const fetchActivities =
|
|
28853
|
+
const fetchActivities = useCallback34(
|
|
28612
28854
|
async (filters) => {
|
|
28613
28855
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
28614
28856
|
try {
|
|
@@ -28643,7 +28885,7 @@ var createUseActivitiesHistory = (fetchActivitiesHistory) => {
|
|
|
28643
28885
|
var createActivitiesHistoryHook = createUseActivitiesHistory;
|
|
28644
28886
|
|
|
28645
28887
|
// src/components/ActivitiesHistory/tabs/HistoryTab.tsx
|
|
28646
|
-
import { jsx as
|
|
28888
|
+
import { jsx as jsx130, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
28647
28889
|
var HistoryTab = ({
|
|
28648
28890
|
fetchActivitiesHistory,
|
|
28649
28891
|
onCreateActivity,
|
|
@@ -28676,7 +28918,7 @@ var HistoryTab = ({
|
|
|
28676
28918
|
() => createHistoryTableColumns(mapSubjectNameToEnum2),
|
|
28677
28919
|
[mapSubjectNameToEnum2]
|
|
28678
28920
|
);
|
|
28679
|
-
const handleParamsChange =
|
|
28921
|
+
const handleParamsChange = useCallback35(
|
|
28680
28922
|
(params) => {
|
|
28681
28923
|
const filters = buildHistoryFiltersFromParams(params);
|
|
28682
28924
|
fetchActivities(filters);
|
|
@@ -28684,9 +28926,9 @@ var HistoryTab = ({
|
|
|
28684
28926
|
[fetchActivities]
|
|
28685
28927
|
);
|
|
28686
28928
|
if (error) {
|
|
28687
|
-
return /* @__PURE__ */
|
|
28929
|
+
return /* @__PURE__ */ jsx130(ErrorDisplay, { error });
|
|
28688
28930
|
}
|
|
28689
|
-
return /* @__PURE__ */
|
|
28931
|
+
return /* @__PURE__ */ jsx130("div", { className: "w-full", children: /* @__PURE__ */ jsx130(
|
|
28690
28932
|
TableProvider,
|
|
28691
28933
|
{
|
|
28692
28934
|
data: activities,
|
|
@@ -28711,14 +28953,14 @@ var HistoryTab = ({
|
|
|
28711
28953
|
image: noSearchImage
|
|
28712
28954
|
},
|
|
28713
28955
|
emptyState: {
|
|
28714
|
-
component: /* @__PURE__ */
|
|
28956
|
+
component: /* @__PURE__ */ jsx130(
|
|
28715
28957
|
EmptyState_default,
|
|
28716
28958
|
{
|
|
28717
28959
|
image: emptyStateImage,
|
|
28718
28960
|
title: "Incentive sua turma ao aprendizado",
|
|
28719
28961
|
description: "Crie uma nova atividade e ajude seus alunos a colocarem o conte\xFAdo em pr\xE1tica!",
|
|
28720
28962
|
buttonText: "Criar atividade",
|
|
28721
|
-
buttonIcon: /* @__PURE__ */
|
|
28963
|
+
buttonIcon: /* @__PURE__ */ jsx130(Plus6, { size: 18 }),
|
|
28722
28964
|
buttonVariant: "outline",
|
|
28723
28965
|
buttonAction: "primary",
|
|
28724
28966
|
onButtonClick: onCreateActivity
|
|
@@ -28735,14 +28977,14 @@ var HistoryTab = ({
|
|
|
28735
28977
|
} = renderProps;
|
|
28736
28978
|
return /* @__PURE__ */ jsxs102("div", { className: "space-y-4", children: [
|
|
28737
28979
|
/* @__PURE__ */ jsxs102("div", { className: "flex items-center justify-between gap-4", children: [
|
|
28738
|
-
/* @__PURE__ */
|
|
28980
|
+
/* @__PURE__ */ jsx130(
|
|
28739
28981
|
Button_default,
|
|
28740
28982
|
{
|
|
28741
28983
|
variant: "solid",
|
|
28742
28984
|
action: "primary",
|
|
28743
28985
|
size: "medium",
|
|
28744
28986
|
onClick: onCreateActivity,
|
|
28745
|
-
iconLeft: /* @__PURE__ */
|
|
28987
|
+
iconLeft: /* @__PURE__ */ jsx130(Plus6, { size: 18, weight: "bold" }),
|
|
28746
28988
|
children: "Criar atividade"
|
|
28747
28989
|
}
|
|
28748
28990
|
),
|
|
@@ -28768,14 +29010,14 @@ var createModelsFiltersConfig = (userData) => [
|
|
|
28768
29010
|
key: "subject",
|
|
28769
29011
|
label: "Mat\xE9ria",
|
|
28770
29012
|
selectedIds: [],
|
|
28771
|
-
itens:
|
|
29013
|
+
itens: getSubjectOptions5(userData)
|
|
28772
29014
|
}
|
|
28773
29015
|
]
|
|
28774
29016
|
}
|
|
28775
29017
|
];
|
|
28776
29018
|
|
|
28777
29019
|
// src/hooks/useActivityModels.ts
|
|
28778
|
-
import { useState as
|
|
29020
|
+
import { useState as useState55, useCallback as useCallback36 } from "react";
|
|
28779
29021
|
import { z as z9 } from "zod";
|
|
28780
29022
|
import dayjs7 from "dayjs";
|
|
28781
29023
|
var activityDraftFiltersSchema = z9.object({
|
|
@@ -28836,13 +29078,13 @@ var handleModelFetchError = createFetchErrorHandler(
|
|
|
28836
29078
|
);
|
|
28837
29079
|
var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
28838
29080
|
return () => {
|
|
28839
|
-
const [state, setState] =
|
|
29081
|
+
const [state, setState] = useState55({
|
|
28840
29082
|
models: [],
|
|
28841
29083
|
loading: false,
|
|
28842
29084
|
error: null,
|
|
28843
29085
|
pagination: DEFAULT_MODELS_PAGINATION
|
|
28844
29086
|
});
|
|
28845
|
-
const fetchModels =
|
|
29087
|
+
const fetchModels = useCallback36(
|
|
28846
29088
|
async (filters, subjectsMap) => {
|
|
28847
29089
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
28848
29090
|
try {
|
|
@@ -28877,7 +29119,7 @@ var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
|
28877
29119
|
},
|
|
28878
29120
|
[fetchActivityModels]
|
|
28879
29121
|
);
|
|
28880
|
-
const deleteModel =
|
|
29122
|
+
const deleteModel = useCallback36(
|
|
28881
29123
|
async (id) => {
|
|
28882
29124
|
try {
|
|
28883
29125
|
await deleteActivityModel(id);
|
|
@@ -28899,7 +29141,7 @@ var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
|
28899
29141
|
var createActivityModelsHook = createUseActivityModels;
|
|
28900
29142
|
|
|
28901
29143
|
// src/components/ActivitiesHistory/tabs/ModelsTab.tsx
|
|
28902
|
-
import { jsx as
|
|
29144
|
+
import { jsx as jsx131 } from "react/jsx-runtime";
|
|
28903
29145
|
var ACTIVITY_MODELS_CONFIG = {
|
|
28904
29146
|
entityName: "atividade",
|
|
28905
29147
|
entityNamePlural: "atividades",
|
|
@@ -28925,7 +29167,7 @@ var ModelsTab = ({
|
|
|
28925
29167
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
28926
29168
|
userFilterData,
|
|
28927
29169
|
subjectsMap
|
|
28928
|
-
}) => /* @__PURE__ */
|
|
29170
|
+
}) => /* @__PURE__ */ jsx131(
|
|
28929
29171
|
ModelsTabBase,
|
|
28930
29172
|
{
|
|
28931
29173
|
fetchModels: fetchActivityModels,
|
|
@@ -28953,13 +29195,13 @@ var ModelsTab = ({
|
|
|
28953
29195
|
);
|
|
28954
29196
|
|
|
28955
29197
|
// src/components/ActivitiesHistory/tabs/DraftsTab.tsx
|
|
28956
|
-
import { jsx as
|
|
29198
|
+
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
28957
29199
|
var DraftsTab = () => {
|
|
28958
|
-
return /* @__PURE__ */
|
|
29200
|
+
return /* @__PURE__ */ jsx132("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx132(Text_default, { size: "lg", color: "text-text-600", children: "Rascunhos em desenvolvimento" }) });
|
|
28959
29201
|
};
|
|
28960
29202
|
|
|
28961
29203
|
// src/components/ActivitiesHistory/ActivitiesHistory.tsx
|
|
28962
|
-
import { jsx as
|
|
29204
|
+
import { jsx as jsx133, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
28963
29205
|
var PAGE_TITLES = {
|
|
28964
29206
|
["history" /* HISTORY */]: "Hist\xF3rico de atividades",
|
|
28965
29207
|
["drafts" /* DRAFTS */]: "Rascunhos",
|
|
@@ -28980,17 +29222,17 @@ var ActivitiesHistory = ({
|
|
|
28980
29222
|
userFilterData,
|
|
28981
29223
|
subjectsMap
|
|
28982
29224
|
}) => {
|
|
28983
|
-
const [activeTab, setActiveTab] =
|
|
29225
|
+
const [activeTab, setActiveTab] = useState56("history" /* HISTORY */);
|
|
28984
29226
|
return /* @__PURE__ */ jsxs103(
|
|
28985
29227
|
"div",
|
|
28986
29228
|
{
|
|
28987
29229
|
"data-testid": "activities-history",
|
|
28988
29230
|
className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
|
|
28989
29231
|
children: [
|
|
28990
|
-
/* @__PURE__ */
|
|
29232
|
+
/* @__PURE__ */ jsx133("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
|
|
28991
29233
|
/* @__PURE__ */ jsxs103("div", { className: "flex flex-col w-full h-full max-w-[1350px] mx-auto z-10 lg:px-0 px-4 pt-4 sm:pt-0", children: [
|
|
28992
29234
|
/* @__PURE__ */ jsxs103("div", { className: "flex flex-col sm:flex-row w-full mb-6 items-start sm:items-center sm:justify-between gap-0 sm:gap-4", children: [
|
|
28993
|
-
/* @__PURE__ */
|
|
29235
|
+
/* @__PURE__ */ jsx133(
|
|
28994
29236
|
Text_default,
|
|
28995
29237
|
{
|
|
28996
29238
|
as: "h1",
|
|
@@ -28999,7 +29241,7 @@ var ActivitiesHistory = ({
|
|
|
28999
29241
|
children: PAGE_TITLES[activeTab]
|
|
29000
29242
|
}
|
|
29001
29243
|
),
|
|
29002
|
-
/* @__PURE__ */
|
|
29244
|
+
/* @__PURE__ */ jsx133("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ jsx133(
|
|
29003
29245
|
Menu,
|
|
29004
29246
|
{
|
|
29005
29247
|
defaultValue: "history" /* HISTORY */,
|
|
@@ -29013,7 +29255,7 @@ var ActivitiesHistory = ({
|
|
|
29013
29255
|
variant: "menu2",
|
|
29014
29256
|
className: "w-full lg:w-auto max-w-full min-w-0",
|
|
29015
29257
|
children: [
|
|
29016
|
-
/* @__PURE__ */
|
|
29258
|
+
/* @__PURE__ */ jsx133(
|
|
29017
29259
|
MenuItem,
|
|
29018
29260
|
{
|
|
29019
29261
|
variant: "menu2",
|
|
@@ -29023,7 +29265,7 @@ var ActivitiesHistory = ({
|
|
|
29023
29265
|
children: "Hist\xF3rico"
|
|
29024
29266
|
}
|
|
29025
29267
|
),
|
|
29026
|
-
/* @__PURE__ */
|
|
29268
|
+
/* @__PURE__ */ jsx133(
|
|
29027
29269
|
MenuItem,
|
|
29028
29270
|
{
|
|
29029
29271
|
variant: "menu2",
|
|
@@ -29033,7 +29275,7 @@ var ActivitiesHistory = ({
|
|
|
29033
29275
|
children: "Rascunhos"
|
|
29034
29276
|
}
|
|
29035
29277
|
),
|
|
29036
|
-
/* @__PURE__ */
|
|
29278
|
+
/* @__PURE__ */ jsx133(
|
|
29037
29279
|
MenuItem,
|
|
29038
29280
|
{
|
|
29039
29281
|
variant: "menu2",
|
|
@@ -29050,7 +29292,7 @@ var ActivitiesHistory = ({
|
|
|
29050
29292
|
) })
|
|
29051
29293
|
] }),
|
|
29052
29294
|
/* @__PURE__ */ jsxs103("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
|
|
29053
|
-
activeTab === "history" /* HISTORY */ && /* @__PURE__ */
|
|
29295
|
+
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ jsx133(
|
|
29054
29296
|
HistoryTab,
|
|
29055
29297
|
{
|
|
29056
29298
|
fetchActivitiesHistory,
|
|
@@ -29062,8 +29304,8 @@ var ActivitiesHistory = ({
|
|
|
29062
29304
|
userFilterData
|
|
29063
29305
|
}
|
|
29064
29306
|
),
|
|
29065
|
-
activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */
|
|
29066
|
-
activeTab === "models" /* MODELS */ && /* @__PURE__ */
|
|
29307
|
+
activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */ jsx133(DraftsTab, {}),
|
|
29308
|
+
activeTab === "models" /* MODELS */ && /* @__PURE__ */ jsx133(
|
|
29067
29309
|
ModelsTab,
|
|
29068
29310
|
{
|
|
29069
29311
|
fetchActivityModels,
|
|
@@ -29219,7 +29461,7 @@ var buildUserFilterData = (userData) => ({
|
|
|
29219
29461
|
});
|
|
29220
29462
|
|
|
29221
29463
|
// src/hooks/useChat.ts
|
|
29222
|
-
import { useState as
|
|
29464
|
+
import { useState as useState57, useEffect as useEffect53, useCallback as useCallback37, useRef as useRef35 } from "react";
|
|
29223
29465
|
var WS_STATES = {
|
|
29224
29466
|
CONNECTING: 0,
|
|
29225
29467
|
OPEN: 1,
|
|
@@ -29238,10 +29480,10 @@ function useChat({
|
|
|
29238
29480
|
reconnectInterval = 3e3,
|
|
29239
29481
|
maxReconnectAttempts = 5
|
|
29240
29482
|
}) {
|
|
29241
|
-
const [isConnected, setIsConnected] =
|
|
29242
|
-
const [messages, setMessages] =
|
|
29243
|
-
const [participants, setParticipants] =
|
|
29244
|
-
const [error, setError] =
|
|
29483
|
+
const [isConnected, setIsConnected] = useState57(false);
|
|
29484
|
+
const [messages, setMessages] = useState57([]);
|
|
29485
|
+
const [participants, setParticipants] = useState57([]);
|
|
29486
|
+
const [error, setError] = useState57(null);
|
|
29245
29487
|
const wsRef = useRef35(null);
|
|
29246
29488
|
const reconnectAttemptsRef = useRef35(0);
|
|
29247
29489
|
const reconnectTimeoutRef = useRef35(
|
|
@@ -29251,12 +29493,12 @@ function useChat({
|
|
|
29251
29493
|
const isConnectingRef = useRef35(false);
|
|
29252
29494
|
const connectRef = useRef35(() => {
|
|
29253
29495
|
});
|
|
29254
|
-
const sendWsMessage =
|
|
29496
|
+
const sendWsMessage = useCallback37((message) => {
|
|
29255
29497
|
if (wsRef.current?.readyState === WS_STATES.OPEN) {
|
|
29256
29498
|
wsRef.current.send(JSON.stringify(message));
|
|
29257
29499
|
}
|
|
29258
29500
|
}, []);
|
|
29259
|
-
const sendMessage =
|
|
29501
|
+
const sendMessage = useCallback37(
|
|
29260
29502
|
(content) => {
|
|
29261
29503
|
const trimmedContent = content.trim();
|
|
29262
29504
|
if (!trimmedContent) return;
|
|
@@ -29267,12 +29509,12 @@ function useChat({
|
|
|
29267
29509
|
},
|
|
29268
29510
|
[sendWsMessage]
|
|
29269
29511
|
);
|
|
29270
|
-
const leave =
|
|
29512
|
+
const leave = useCallback37(() => {
|
|
29271
29513
|
isManualDisconnectRef.current = true;
|
|
29272
29514
|
sendWsMessage({ type: "leave" });
|
|
29273
29515
|
wsRef.current?.close(1e3, "User left");
|
|
29274
29516
|
}, [sendWsMessage]);
|
|
29275
|
-
const handleMessage =
|
|
29517
|
+
const handleMessage = useCallback37(
|
|
29276
29518
|
(event) => {
|
|
29277
29519
|
try {
|
|
29278
29520
|
const data = JSON.parse(event.data);
|
|
@@ -29340,7 +29582,7 @@ function useChat({
|
|
|
29340
29582
|
},
|
|
29341
29583
|
[onError]
|
|
29342
29584
|
);
|
|
29343
|
-
const connect =
|
|
29585
|
+
const connect = useCallback37(() => {
|
|
29344
29586
|
if (isConnectingRef.current) {
|
|
29345
29587
|
return;
|
|
29346
29588
|
}
|
|
@@ -29394,7 +29636,7 @@ function useChat({
|
|
|
29394
29636
|
maxReconnectAttempts
|
|
29395
29637
|
]);
|
|
29396
29638
|
connectRef.current = connect;
|
|
29397
|
-
const reconnect =
|
|
29639
|
+
const reconnect = useCallback37(() => {
|
|
29398
29640
|
isManualDisconnectRef.current = false;
|
|
29399
29641
|
reconnectAttemptsRef.current = 0;
|
|
29400
29642
|
connectRef.current();
|
|
@@ -29443,15 +29685,15 @@ function createUseChat(baseWsUrl) {
|
|
|
29443
29685
|
}
|
|
29444
29686
|
|
|
29445
29687
|
// src/hooks/useChatRooms.ts
|
|
29446
|
-
import { useState as
|
|
29688
|
+
import { useState as useState58, useCallback as useCallback38 } from "react";
|
|
29447
29689
|
function useChatRooms({
|
|
29448
29690
|
apiClient
|
|
29449
29691
|
}) {
|
|
29450
|
-
const [rooms, setRooms] =
|
|
29451
|
-
const [availableUsers, setAvailableUsers] =
|
|
29452
|
-
const [loading, setLoading] =
|
|
29453
|
-
const [error, setError] =
|
|
29454
|
-
const fetchRooms =
|
|
29692
|
+
const [rooms, setRooms] = useState58([]);
|
|
29693
|
+
const [availableUsers, setAvailableUsers] = useState58([]);
|
|
29694
|
+
const [loading, setLoading] = useState58(false);
|
|
29695
|
+
const [error, setError] = useState58(null);
|
|
29696
|
+
const fetchRooms = useCallback38(async () => {
|
|
29455
29697
|
setLoading(true);
|
|
29456
29698
|
setError(null);
|
|
29457
29699
|
try {
|
|
@@ -29467,7 +29709,7 @@ function useChatRooms({
|
|
|
29467
29709
|
setLoading(false);
|
|
29468
29710
|
}
|
|
29469
29711
|
}, [apiClient]);
|
|
29470
|
-
const fetchAvailableUsers =
|
|
29712
|
+
const fetchAvailableUsers = useCallback38(async () => {
|
|
29471
29713
|
setLoading(true);
|
|
29472
29714
|
setError(null);
|
|
29473
29715
|
try {
|
|
@@ -29483,7 +29725,7 @@ function useChatRooms({
|
|
|
29483
29725
|
setLoading(false);
|
|
29484
29726
|
}
|
|
29485
29727
|
}, [apiClient]);
|
|
29486
|
-
const createRoom =
|
|
29728
|
+
const createRoom = useCallback38(
|
|
29487
29729
|
async (participantIds) => {
|
|
29488
29730
|
setLoading(true);
|
|
29489
29731
|
setError(null);
|
|
@@ -29507,7 +29749,7 @@ function useChatRooms({
|
|
|
29507
29749
|
},
|
|
29508
29750
|
[apiClient, fetchRooms]
|
|
29509
29751
|
);
|
|
29510
|
-
const clearError =
|
|
29752
|
+
const clearError = useCallback38(() => {
|
|
29511
29753
|
setError(null);
|
|
29512
29754
|
}, []);
|
|
29513
29755
|
return {
|
|
@@ -29541,19 +29783,19 @@ var CHAT_MESSAGE_TYPES = {
|
|
|
29541
29783
|
};
|
|
29542
29784
|
|
|
29543
29785
|
// src/components/Chat/Chat.tsx
|
|
29544
|
-
import { useState as
|
|
29786
|
+
import { useState as useState59, useEffect as useEffect54, useCallback as useCallback39, useRef as useRef36 } from "react";
|
|
29545
29787
|
import {
|
|
29546
29788
|
PaperPlaneTiltIcon as PaperPlaneTiltIcon2,
|
|
29547
29789
|
XIcon,
|
|
29548
29790
|
PlusIcon,
|
|
29549
29791
|
UsersIcon
|
|
29550
29792
|
} from "@phosphor-icons/react";
|
|
29551
|
-
import { jsx as
|
|
29793
|
+
import { jsx as jsx134, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
29552
29794
|
var RoomItem = ({
|
|
29553
29795
|
room,
|
|
29554
29796
|
onClick,
|
|
29555
29797
|
isActive
|
|
29556
|
-
}) => /* @__PURE__ */
|
|
29798
|
+
}) => /* @__PURE__ */ jsx134(
|
|
29557
29799
|
Button_default,
|
|
29558
29800
|
{
|
|
29559
29801
|
variant: "link",
|
|
@@ -29564,9 +29806,9 @@ var RoomItem = ({
|
|
|
29564
29806
|
isActive && "bg-primary-50 border-l-4 border-primary-500"
|
|
29565
29807
|
),
|
|
29566
29808
|
children: /* @__PURE__ */ jsxs104("div", { className: "flex items-start gap-3 w-full", children: [
|
|
29567
|
-
/* @__PURE__ */
|
|
29809
|
+
/* @__PURE__ */ jsx134("div", { className: "w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx134(UsersIcon, { size: 20, className: "text-primary-600" }) }),
|
|
29568
29810
|
/* @__PURE__ */ jsxs104("div", { className: "flex-1 min-w-0", children: [
|
|
29569
|
-
/* @__PURE__ */
|
|
29811
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "sm", weight: "semibold", className: "text-text-900 truncate", children: room.name }),
|
|
29570
29812
|
room.lastMessage && /* @__PURE__ */ jsxs104(Text_default, { size: "xs", className: "text-text-500 truncate mt-1", children: [
|
|
29571
29813
|
room.lastMessage.senderName,
|
|
29572
29814
|
": ",
|
|
@@ -29584,27 +29826,27 @@ var MessageBubble = ({
|
|
|
29584
29826
|
message,
|
|
29585
29827
|
isOwn
|
|
29586
29828
|
}) => /* @__PURE__ */ jsxs104("div", { className: cn("flex gap-2 mb-3", isOwn && "flex-row-reverse"), children: [
|
|
29587
|
-
!isOwn && /* @__PURE__ */
|
|
29829
|
+
!isOwn && /* @__PURE__ */ jsx134("div", { className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center flex-shrink-0", children: message.senderPhoto ? /* @__PURE__ */ jsx134(
|
|
29588
29830
|
"img",
|
|
29589
29831
|
{
|
|
29590
29832
|
src: message.senderPhoto,
|
|
29591
29833
|
alt: message.senderName,
|
|
29592
29834
|
className: "w-8 h-8 rounded-full object-cover"
|
|
29593
29835
|
}
|
|
29594
|
-
) : /* @__PURE__ */
|
|
29836
|
+
) : /* @__PURE__ */ jsx134(Text_default, { size: "xs", weight: "bold", className: "text-gray-600", children: message.senderName.charAt(0).toUpperCase() }) }),
|
|
29595
29837
|
/* @__PURE__ */ jsxs104("div", { className: cn("max-w-[70%]", isOwn && "items-end"), children: [
|
|
29596
|
-
!isOwn && /* @__PURE__ */
|
|
29597
|
-
/* @__PURE__ */
|
|
29838
|
+
!isOwn && /* @__PURE__ */ jsx134(Text_default, { size: "xs", className: "text-text-500 mb-1", children: message.senderName }),
|
|
29839
|
+
/* @__PURE__ */ jsx134(
|
|
29598
29840
|
"div",
|
|
29599
29841
|
{
|
|
29600
29842
|
className: cn(
|
|
29601
29843
|
"px-4 py-2 rounded-2xl",
|
|
29602
29844
|
isOwn ? "bg-primary-500 text-white rounded-br-md" : "bg-background-100 text-text-900 rounded-bl-md"
|
|
29603
29845
|
),
|
|
29604
|
-
children: /* @__PURE__ */
|
|
29846
|
+
children: /* @__PURE__ */ jsx134(Text_default, { size: "sm", children: message.content })
|
|
29605
29847
|
}
|
|
29606
29848
|
),
|
|
29607
|
-
/* @__PURE__ */
|
|
29849
|
+
/* @__PURE__ */ jsx134(
|
|
29608
29850
|
Text_default,
|
|
29609
29851
|
{
|
|
29610
29852
|
size: "xs",
|
|
@@ -29619,26 +29861,26 @@ var MessageBubble = ({
|
|
|
29619
29861
|
] });
|
|
29620
29862
|
var ParticipantItem = ({ participant }) => /* @__PURE__ */ jsxs104("div", { className: "flex items-center gap-2 py-2", children: [
|
|
29621
29863
|
/* @__PURE__ */ jsxs104("div", { className: "relative", children: [
|
|
29622
|
-
/* @__PURE__ */
|
|
29864
|
+
/* @__PURE__ */ jsx134("div", { className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center", children: participant.photo ? /* @__PURE__ */ jsx134(
|
|
29623
29865
|
"img",
|
|
29624
29866
|
{
|
|
29625
29867
|
src: participant.photo,
|
|
29626
29868
|
alt: participant.name,
|
|
29627
29869
|
className: "w-8 h-8 rounded-full object-cover"
|
|
29628
29870
|
}
|
|
29629
|
-
) : /* @__PURE__ */
|
|
29630
|
-
participant.isOnline && /* @__PURE__ */
|
|
29871
|
+
) : /* @__PURE__ */ jsx134(Text_default, { size: "xs", weight: "bold", className: "text-gray-600", children: participant.name.charAt(0).toUpperCase() }) }),
|
|
29872
|
+
participant.isOnline && /* @__PURE__ */ jsx134("div", { className: "absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white" })
|
|
29631
29873
|
] }),
|
|
29632
29874
|
/* @__PURE__ */ jsxs104("div", { className: "flex-1 min-w-0", children: [
|
|
29633
|
-
/* @__PURE__ */
|
|
29634
|
-
/* @__PURE__ */
|
|
29875
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-900 truncate", children: participant.name }),
|
|
29876
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "xs", className: "text-text-500", children: participant.role })
|
|
29635
29877
|
] })
|
|
29636
29878
|
] });
|
|
29637
29879
|
var UserSelector = ({
|
|
29638
29880
|
users,
|
|
29639
29881
|
selectedIds,
|
|
29640
29882
|
onToggle
|
|
29641
|
-
}) => /* @__PURE__ */
|
|
29883
|
+
}) => /* @__PURE__ */ jsx134("div", { className: "space-y-2 max-h-64 overflow-y-auto", children: users.map((user) => /* @__PURE__ */ jsxs104(
|
|
29642
29884
|
Button_default,
|
|
29643
29885
|
{
|
|
29644
29886
|
variant: "link",
|
|
@@ -29648,26 +29890,26 @@ var UserSelector = ({
|
|
|
29648
29890
|
selectedIds.has(user.userInstitutionId) ? "bg-primary-50 border border-primary-500" : "bg-background-50 hover:bg-background-100 border border-transparent"
|
|
29649
29891
|
),
|
|
29650
29892
|
children: [
|
|
29651
|
-
/* @__PURE__ */
|
|
29893
|
+
/* @__PURE__ */ jsx134("div", { className: "w-10 h-10 rounded-full bg-gray-200 flex items-center justify-center", children: user.photo ? /* @__PURE__ */ jsx134(
|
|
29652
29894
|
"img",
|
|
29653
29895
|
{
|
|
29654
29896
|
src: user.photo,
|
|
29655
29897
|
alt: user.name,
|
|
29656
29898
|
className: "w-10 h-10 rounded-full object-cover"
|
|
29657
29899
|
}
|
|
29658
|
-
) : /* @__PURE__ */
|
|
29900
|
+
) : /* @__PURE__ */ jsx134(Text_default, { size: "sm", weight: "bold", className: "text-gray-600", children: user.name.charAt(0).toUpperCase() }) }),
|
|
29659
29901
|
/* @__PURE__ */ jsxs104("div", { className: "flex-1 text-left", children: [
|
|
29660
|
-
/* @__PURE__ */
|
|
29661
|
-
/* @__PURE__ */
|
|
29902
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children: user.name }),
|
|
29903
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "xs", className: "text-text-500", children: user.profileName })
|
|
29662
29904
|
] }),
|
|
29663
|
-
/* @__PURE__ */
|
|
29905
|
+
/* @__PURE__ */ jsx134(
|
|
29664
29906
|
"div",
|
|
29665
29907
|
{
|
|
29666
29908
|
className: cn(
|
|
29667
29909
|
"w-5 h-5 rounded-full border-2 flex items-center justify-center",
|
|
29668
29910
|
selectedIds.has(user.userInstitutionId) ? "bg-primary-500 border-primary-500" : "border-gray-300"
|
|
29669
29911
|
),
|
|
29670
|
-
children: selectedIds.has(user.userInstitutionId) && /* @__PURE__ */
|
|
29912
|
+
children: selectedIds.has(user.userInstitutionId) && /* @__PURE__ */ jsx134("div", { className: "w-2 h-2 bg-white rounded-full" })
|
|
29671
29913
|
}
|
|
29672
29914
|
)
|
|
29673
29915
|
]
|
|
@@ -29677,9 +29919,9 @@ var UserSelector = ({
|
|
|
29677
29919
|
function Chat(props) {
|
|
29678
29920
|
const { userId, token } = props;
|
|
29679
29921
|
if (!userId || !token) {
|
|
29680
|
-
return /* @__PURE__ */
|
|
29922
|
+
return /* @__PURE__ */ jsx134("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-500", children: "Carregando..." }) });
|
|
29681
29923
|
}
|
|
29682
|
-
return /* @__PURE__ */
|
|
29924
|
+
return /* @__PURE__ */ jsx134(ChatContent, { ...props });
|
|
29683
29925
|
}
|
|
29684
29926
|
function ChatContent({
|
|
29685
29927
|
apiClient,
|
|
@@ -29694,15 +29936,15 @@ function ChatContent({
|
|
|
29694
29936
|
onRoomChange,
|
|
29695
29937
|
onBackToList
|
|
29696
29938
|
}) {
|
|
29697
|
-
const [view, setView] =
|
|
29698
|
-
const [selectedRoom, setSelectedRoom] =
|
|
29939
|
+
const [view, setView] = useState59("list");
|
|
29940
|
+
const [selectedRoom, setSelectedRoom] = useState59(
|
|
29699
29941
|
null
|
|
29700
29942
|
);
|
|
29701
|
-
const [selectedUserIds, setSelectedUserIds] =
|
|
29943
|
+
const [selectedUserIds, setSelectedUserIds] = useState59(
|
|
29702
29944
|
/* @__PURE__ */ new Set()
|
|
29703
29945
|
);
|
|
29704
|
-
const [messageInput, setMessageInput] =
|
|
29705
|
-
const [showCreateModal, setShowCreateModal] =
|
|
29946
|
+
const [messageInput, setMessageInput] = useState59("");
|
|
29947
|
+
const [showCreateModal, setShowCreateModal] = useState59(false);
|
|
29706
29948
|
const hasHandledInitialRoomRef = useRef36(false);
|
|
29707
29949
|
const {
|
|
29708
29950
|
rooms,
|
|
@@ -29756,7 +29998,7 @@ function ChatContent({
|
|
|
29756
29998
|
onBackToList?.();
|
|
29757
29999
|
}
|
|
29758
30000
|
}, [initialRoomId, rooms, roomsLoading, onBackToList]);
|
|
29759
|
-
const handleSelectRoom =
|
|
30001
|
+
const handleSelectRoom = useCallback39(
|
|
29760
30002
|
(room) => {
|
|
29761
30003
|
setSelectedRoom(room);
|
|
29762
30004
|
setView("room");
|
|
@@ -29764,12 +30006,12 @@ function ChatContent({
|
|
|
29764
30006
|
},
|
|
29765
30007
|
[onRoomChange]
|
|
29766
30008
|
);
|
|
29767
|
-
const handleOpenCreateModal =
|
|
30009
|
+
const handleOpenCreateModal = useCallback39(async () => {
|
|
29768
30010
|
await fetchAvailableUsers();
|
|
29769
30011
|
setSelectedUserIds(/* @__PURE__ */ new Set());
|
|
29770
30012
|
setShowCreateModal(true);
|
|
29771
30013
|
}, [fetchAvailableUsers]);
|
|
29772
|
-
const handleToggleUser =
|
|
30014
|
+
const handleToggleUser = useCallback39((id) => {
|
|
29773
30015
|
setSelectedUserIds((prev) => {
|
|
29774
30016
|
const next = new Set(prev);
|
|
29775
30017
|
if (next.has(id)) {
|
|
@@ -29780,7 +30022,7 @@ function ChatContent({
|
|
|
29780
30022
|
return next;
|
|
29781
30023
|
});
|
|
29782
30024
|
}, []);
|
|
29783
|
-
const handleCreateRoom =
|
|
30025
|
+
const handleCreateRoom = useCallback39(async () => {
|
|
29784
30026
|
if (selectedUserIds.size === 0) return;
|
|
29785
30027
|
const room = await createRoom(Array.from(selectedUserIds));
|
|
29786
30028
|
if (room) {
|
|
@@ -29789,30 +30031,30 @@ function ChatContent({
|
|
|
29789
30031
|
onRoomChange?.(room.id);
|
|
29790
30032
|
}
|
|
29791
30033
|
}, [selectedUserIds, createRoom, onRoomChange]);
|
|
29792
|
-
const handleSendMessage =
|
|
30034
|
+
const handleSendMessage = useCallback39(() => {
|
|
29793
30035
|
if (!messageInput.trim()) return;
|
|
29794
30036
|
sendMessage(messageInput);
|
|
29795
30037
|
setMessageInput("");
|
|
29796
30038
|
}, [messageInput, sendMessage]);
|
|
29797
|
-
const handleBackToList =
|
|
30039
|
+
const handleBackToList = useCallback39(() => {
|
|
29798
30040
|
setSelectedRoom(null);
|
|
29799
30041
|
setView("list");
|
|
29800
30042
|
onBackToList?.();
|
|
29801
30043
|
}, [onBackToList]);
|
|
29802
30044
|
const renderMessagesContent = () => {
|
|
29803
30045
|
if (chatError) {
|
|
29804
|
-
return /* @__PURE__ */
|
|
29805
|
-
/* @__PURE__ */
|
|
29806
|
-
/* @__PURE__ */
|
|
30046
|
+
return /* @__PURE__ */ jsx134("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsxs104("div", { className: "text-center", children: [
|
|
30047
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-red-500 mb-2", children: "Erro de conexao com o chat" }),
|
|
30048
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "xs", className: "text-text-500", children: "Tentando reconectar..." })
|
|
29807
30049
|
] }) });
|
|
29808
30050
|
}
|
|
29809
30051
|
const userMessages = messages?.filter(
|
|
29810
30052
|
(message) => message.messageType !== CHAT_MESSAGE_TYPES.SYSTEM
|
|
29811
30053
|
);
|
|
29812
30054
|
if (!userMessages?.length) {
|
|
29813
|
-
return /* @__PURE__ */
|
|
30055
|
+
return /* @__PURE__ */ jsx134("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-500", children: "Nenhuma mensagem ainda. Comece a conversa!" }) });
|
|
29814
30056
|
}
|
|
29815
|
-
return userMessages.map((message) => /* @__PURE__ */
|
|
30057
|
+
return userMessages.map((message) => /* @__PURE__ */ jsx134(
|
|
29816
30058
|
MessageBubble,
|
|
29817
30059
|
{
|
|
29818
30060
|
message,
|
|
@@ -29824,16 +30066,16 @@ function ChatContent({
|
|
|
29824
30066
|
const renderRoomList = () => /* @__PURE__ */ jsxs104("div", { className: "flex flex-col h-full", children: [
|
|
29825
30067
|
/* @__PURE__ */ jsxs104("div", { className: "p-4 border-b border-background-200 flex items-center justify-between", children: [
|
|
29826
30068
|
/* @__PURE__ */ jsxs104("div", { className: "flex items-center gap-3", children: [
|
|
29827
|
-
/* @__PURE__ */
|
|
30069
|
+
/* @__PURE__ */ jsx134("div", { className: "w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center flex-shrink-0", children: userPhoto ? /* @__PURE__ */ jsx134(
|
|
29828
30070
|
"img",
|
|
29829
30071
|
{
|
|
29830
30072
|
src: userPhoto,
|
|
29831
30073
|
alt: userName,
|
|
29832
30074
|
className: "w-10 h-10 rounded-full object-cover"
|
|
29833
30075
|
}
|
|
29834
|
-
) : /* @__PURE__ */
|
|
30076
|
+
) : /* @__PURE__ */ jsx134(Text_default, { size: "sm", weight: "bold", className: "text-primary-600", children: userName.charAt(0).toUpperCase() }) }),
|
|
29835
30077
|
/* @__PURE__ */ jsxs104("div", { children: [
|
|
29836
|
-
/* @__PURE__ */
|
|
30078
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "lg", weight: "bold", className: "text-text-900", children: "Conversas" }),
|
|
29837
30079
|
/* @__PURE__ */ jsxs104(Text_default, { size: "xs", className: "text-text-500", children: [
|
|
29838
30080
|
userName,
|
|
29839
30081
|
" - ",
|
|
@@ -29841,37 +30083,37 @@ function ChatContent({
|
|
|
29841
30083
|
] })
|
|
29842
30084
|
] })
|
|
29843
30085
|
] }),
|
|
29844
|
-
/* @__PURE__ */
|
|
30086
|
+
/* @__PURE__ */ jsx134(
|
|
29845
30087
|
Button_default,
|
|
29846
30088
|
{
|
|
29847
30089
|
variant: "solid",
|
|
29848
30090
|
size: "small",
|
|
29849
30091
|
onClick: handleOpenCreateModal,
|
|
29850
|
-
iconLeft: /* @__PURE__ */
|
|
30092
|
+
iconLeft: /* @__PURE__ */ jsx134(PlusIcon, { size: 16 }),
|
|
29851
30093
|
children: "Nova conversa"
|
|
29852
30094
|
}
|
|
29853
30095
|
)
|
|
29854
30096
|
] }),
|
|
29855
30097
|
/* @__PURE__ */ jsxs104("div", { className: "flex-1 overflow-y-auto p-2", children: [
|
|
29856
30098
|
roomsError && /* @__PURE__ */ jsxs104("div", { className: "p-4 text-center", children: [
|
|
29857
|
-
/* @__PURE__ */
|
|
29858
|
-
/* @__PURE__ */
|
|
30099
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-red-500 mb-2", children: "Erro ao carregar conversas" }),
|
|
30100
|
+
/* @__PURE__ */ jsx134(Button_default, { variant: "outline", size: "small", onClick: fetchRooms, children: "Tentar novamente" })
|
|
29859
30101
|
] }),
|
|
29860
|
-
!roomsError && roomsLoading && /* @__PURE__ */
|
|
29861
|
-
/* @__PURE__ */
|
|
30102
|
+
!roomsError && roomsLoading && /* @__PURE__ */ jsx134("div", { className: "space-y-3 p-2", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs104("div", { className: "flex items-center gap-3", children: [
|
|
30103
|
+
/* @__PURE__ */ jsx134(SkeletonRounded, { className: "w-10 h-10" }),
|
|
29862
30104
|
/* @__PURE__ */ jsxs104("div", { className: "flex-1", children: [
|
|
29863
|
-
/* @__PURE__ */
|
|
29864
|
-
/* @__PURE__ */
|
|
30105
|
+
/* @__PURE__ */ jsx134(SkeletonText, { className: "w-3/4 h-4 mb-2" }),
|
|
30106
|
+
/* @__PURE__ */ jsx134(SkeletonText, { className: "w-1/2 h-3" })
|
|
29865
30107
|
] })
|
|
29866
30108
|
] }, i)) }),
|
|
29867
|
-
!roomsError && !roomsLoading && !rooms?.length && /* @__PURE__ */
|
|
30109
|
+
!roomsError && !roomsLoading && !rooms?.length && /* @__PURE__ */ jsx134(
|
|
29868
30110
|
EmptyState_default,
|
|
29869
30111
|
{
|
|
29870
30112
|
title: "Nenhuma conversa",
|
|
29871
30113
|
description: "Comece uma nova conversa clicando no botao acima"
|
|
29872
30114
|
}
|
|
29873
30115
|
),
|
|
29874
|
-
!roomsError && !roomsLoading && !!rooms?.length && /* @__PURE__ */
|
|
30116
|
+
!roomsError && !roomsLoading && !!rooms?.length && /* @__PURE__ */ jsx134("div", { className: "space-y-1", children: rooms.map((room) => /* @__PURE__ */ jsx134(
|
|
29875
30117
|
RoomItem,
|
|
29876
30118
|
{
|
|
29877
30119
|
room,
|
|
@@ -29887,15 +30129,15 @@ function ChatContent({
|
|
|
29887
30129
|
return /* @__PURE__ */ jsxs104("div", { className: "flex h-full", children: [
|
|
29888
30130
|
/* @__PURE__ */ jsxs104("div", { className: "flex-1 flex flex-col", children: [
|
|
29889
30131
|
/* @__PURE__ */ jsxs104("div", { className: "p-4 border-b border-background-200 flex items-center gap-3", children: [
|
|
29890
|
-
/* @__PURE__ */
|
|
30132
|
+
/* @__PURE__ */ jsx134(Button_default, { variant: "link", size: "small", onClick: handleBackToList, children: /* @__PURE__ */ jsx134(XIcon, { size: 20 }) }),
|
|
29891
30133
|
/* @__PURE__ */ jsxs104("div", { className: "flex-1", children: [
|
|
29892
|
-
/* @__PURE__ */
|
|
29893
|
-
/* @__PURE__ */
|
|
30134
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "md", weight: "semibold", className: "text-text-900", children: selectedRoom.name }),
|
|
30135
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "xs", className: "text-text-500", children: isConnected ? "Conectado" : "Conectando..." })
|
|
29894
30136
|
] })
|
|
29895
30137
|
] }),
|
|
29896
|
-
/* @__PURE__ */
|
|
29897
|
-
/* @__PURE__ */
|
|
29898
|
-
/* @__PURE__ */
|
|
30138
|
+
/* @__PURE__ */ jsx134("div", { className: "flex-1 overflow-y-auto p-4", children: renderMessagesContent() }),
|
|
30139
|
+
/* @__PURE__ */ jsx134("div", { className: "p-4 border-t border-background-200", children: /* @__PURE__ */ jsxs104("div", { className: "flex gap-2", children: [
|
|
30140
|
+
/* @__PURE__ */ jsx134(
|
|
29899
30141
|
Input_default,
|
|
29900
30142
|
{
|
|
29901
30143
|
placeholder: "Digite sua mensagem...",
|
|
@@ -29910,13 +30152,13 @@ function ChatContent({
|
|
|
29910
30152
|
className: "flex-1"
|
|
29911
30153
|
}
|
|
29912
30154
|
),
|
|
29913
|
-
/* @__PURE__ */
|
|
30155
|
+
/* @__PURE__ */ jsx134(
|
|
29914
30156
|
Button_default,
|
|
29915
30157
|
{
|
|
29916
30158
|
variant: "solid",
|
|
29917
30159
|
onClick: handleSendMessage,
|
|
29918
30160
|
disabled: !messageInput.trim() || !isConnected,
|
|
29919
|
-
children: /* @__PURE__ */
|
|
30161
|
+
children: /* @__PURE__ */ jsx134(PaperPlaneTiltIcon2, { size: 20 })
|
|
29920
30162
|
}
|
|
29921
30163
|
)
|
|
29922
30164
|
] }) })
|
|
@@ -29927,7 +30169,7 @@ function ChatContent({
|
|
|
29927
30169
|
participants?.length ?? 0,
|
|
29928
30170
|
")"
|
|
29929
30171
|
] }),
|
|
29930
|
-
/* @__PURE__ */
|
|
30172
|
+
/* @__PURE__ */ jsx134("div", { className: "space-y-1", children: participants?.map((participant) => /* @__PURE__ */ jsx134(
|
|
29931
30173
|
ParticipantItem,
|
|
29932
30174
|
{
|
|
29933
30175
|
participant
|
|
@@ -29947,20 +30189,20 @@ function ChatContent({
|
|
|
29947
30189
|
children: [
|
|
29948
30190
|
view === "list" && renderRoomList(),
|
|
29949
30191
|
view === "room" && renderChatRoom(),
|
|
29950
|
-
/* @__PURE__ */
|
|
30192
|
+
/* @__PURE__ */ jsx134(
|
|
29951
30193
|
Modal_default,
|
|
29952
30194
|
{
|
|
29953
30195
|
isOpen: showCreateModal,
|
|
29954
30196
|
onClose: () => setShowCreateModal(false),
|
|
29955
30197
|
title: "Nova conversa",
|
|
29956
30198
|
children: /* @__PURE__ */ jsxs104("div", { className: "p-4", children: [
|
|
29957
|
-
/* @__PURE__ */
|
|
29958
|
-
roomsLoading && /* @__PURE__ */
|
|
29959
|
-
/* @__PURE__ */
|
|
29960
|
-
/* @__PURE__ */
|
|
30199
|
+
/* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-600 mb-4", children: "Selecione os participantes para iniciar uma conversa" }),
|
|
30200
|
+
roomsLoading && /* @__PURE__ */ jsx134("div", { className: "space-y-3", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs104("div", { className: "flex items-center gap-3", children: [
|
|
30201
|
+
/* @__PURE__ */ jsx134(SkeletonRounded, { className: "w-10 h-10" }),
|
|
30202
|
+
/* @__PURE__ */ jsx134(SkeletonText, { className: "flex-1 h-4" })
|
|
29961
30203
|
] }, i)) }),
|
|
29962
|
-
!roomsLoading && !availableUsers?.length && /* @__PURE__ */
|
|
29963
|
-
!roomsLoading && !!availableUsers?.length && /* @__PURE__ */
|
|
30204
|
+
!roomsLoading && !availableUsers?.length && /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-500 text-center py-4", children: "Nenhum usuario disponivel para chat" }),
|
|
30205
|
+
!roomsLoading && !!availableUsers?.length && /* @__PURE__ */ jsx134(
|
|
29964
30206
|
UserSelector,
|
|
29965
30207
|
{
|
|
29966
30208
|
users: availableUsers,
|
|
@@ -29969,8 +30211,8 @@ function ChatContent({
|
|
|
29969
30211
|
}
|
|
29970
30212
|
),
|
|
29971
30213
|
/* @__PURE__ */ jsxs104("div", { className: "flex justify-end gap-2 mt-6", children: [
|
|
29972
|
-
/* @__PURE__ */
|
|
29973
|
-
/* @__PURE__ */
|
|
30214
|
+
/* @__PURE__ */ jsx134(Button_default, { variant: "outline", onClick: () => setShowCreateModal(false), children: "Cancelar" }),
|
|
30215
|
+
/* @__PURE__ */ jsx134(
|
|
29974
30216
|
Button_default,
|
|
29975
30217
|
{
|
|
29976
30218
|
variant: "solid",
|
|
@@ -29989,9 +30231,9 @@ function ChatContent({
|
|
|
29989
30231
|
}
|
|
29990
30232
|
|
|
29991
30233
|
// src/components/Chat/ChatLoading.tsx
|
|
29992
|
-
import { jsx as
|
|
30234
|
+
import { jsx as jsx135 } from "react/jsx-runtime";
|
|
29993
30235
|
function ChatLoading() {
|
|
29994
|
-
return /* @__PURE__ */
|
|
30236
|
+
return /* @__PURE__ */ jsx135("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ jsx135(Text_default, { size: "sm", className: "text-text-500", children: "Carregando..." }) });
|
|
29995
30237
|
}
|
|
29996
30238
|
|
|
29997
30239
|
// src/utils/chatUtils.ts
|
|
@@ -30040,7 +30282,7 @@ var CalendarActivityStatus = /* @__PURE__ */ ((CalendarActivityStatus2) => {
|
|
|
30040
30282
|
})(CalendarActivityStatus || {});
|
|
30041
30283
|
|
|
30042
30284
|
// src/hooks/useSendActivity.ts
|
|
30043
|
-
import { useState as
|
|
30285
|
+
import { useState as useState60, useCallback as useCallback40, useMemo as useMemo33, useRef as useRef37 } from "react";
|
|
30044
30286
|
import dayjs8 from "dayjs";
|
|
30045
30287
|
function transformToCategoryConfig(data) {
|
|
30046
30288
|
return [
|
|
@@ -30095,13 +30337,13 @@ function useSendActivity(config) {
|
|
|
30095
30337
|
onSuccess,
|
|
30096
30338
|
onError
|
|
30097
30339
|
} = config;
|
|
30098
|
-
const [isOpen, setIsOpen] =
|
|
30099
|
-
const [selectedModel, setSelectedModel] =
|
|
30340
|
+
const [isOpen, setIsOpen] = useState60(false);
|
|
30341
|
+
const [selectedModel, setSelectedModel] = useState60(
|
|
30100
30342
|
null
|
|
30101
30343
|
);
|
|
30102
|
-
const [categories, setCategories] =
|
|
30103
|
-
const [isLoading, setIsLoading] =
|
|
30104
|
-
const [isCategoriesLoading, setIsCategoriesLoading] =
|
|
30344
|
+
const [categories, setCategories] = useState60([]);
|
|
30345
|
+
const [isLoading, setIsLoading] = useState60(false);
|
|
30346
|
+
const [isCategoriesLoading, setIsCategoriesLoading] = useState60(false);
|
|
30105
30347
|
const categoriesLoadedRef = useRef37(false);
|
|
30106
30348
|
const initialData = useMemo33(() => {
|
|
30107
30349
|
if (!selectedModel) return void 0;
|
|
@@ -30109,7 +30351,7 @@ function useSendActivity(config) {
|
|
|
30109
30351
|
title: selectedModel.title
|
|
30110
30352
|
};
|
|
30111
30353
|
}, [selectedModel]);
|
|
30112
|
-
const loadCategories =
|
|
30354
|
+
const loadCategories = useCallback40(async () => {
|
|
30113
30355
|
if (categoriesLoadedRef.current) return;
|
|
30114
30356
|
setIsCategoriesLoading(true);
|
|
30115
30357
|
try {
|
|
@@ -30124,7 +30366,7 @@ function useSendActivity(config) {
|
|
|
30124
30366
|
setIsCategoriesLoading(false);
|
|
30125
30367
|
}
|
|
30126
30368
|
}, [fetchCategories, onError]);
|
|
30127
|
-
const openModal =
|
|
30369
|
+
const openModal = useCallback40(
|
|
30128
30370
|
(model) => {
|
|
30129
30371
|
setSelectedModel(model);
|
|
30130
30372
|
setIsOpen(true);
|
|
@@ -30132,17 +30374,17 @@ function useSendActivity(config) {
|
|
|
30132
30374
|
},
|
|
30133
30375
|
[loadCategories]
|
|
30134
30376
|
);
|
|
30135
|
-
const closeModal =
|
|
30377
|
+
const closeModal = useCallback40(() => {
|
|
30136
30378
|
setIsOpen(false);
|
|
30137
30379
|
setSelectedModel(null);
|
|
30138
30380
|
}, []);
|
|
30139
|
-
const onCategoriesChange =
|
|
30381
|
+
const onCategoriesChange = useCallback40(
|
|
30140
30382
|
(updatedCategories) => {
|
|
30141
30383
|
setCategories(updatedCategories);
|
|
30142
30384
|
},
|
|
30143
30385
|
[]
|
|
30144
30386
|
);
|
|
30145
|
-
const handleSubmit =
|
|
30387
|
+
const handleSubmit = useCallback40(
|
|
30146
30388
|
async (data) => {
|
|
30147
30389
|
if (!selectedModel) return;
|
|
30148
30390
|
setIsLoading(true);
|
|
@@ -30250,6 +30492,7 @@ export {
|
|
|
30250
30492
|
CorrectActivityModal_default as CorrectActivityModal,
|
|
30251
30493
|
CreateActivity,
|
|
30252
30494
|
DEFAULT_ACTIVITIES_PAGINATION,
|
|
30495
|
+
DEFAULT_GOAL_DRAFTS_PAGINATION,
|
|
30253
30496
|
DEFAULT_GOAL_MODELS_PAGINATION,
|
|
30254
30497
|
DEFAULT_MODELS_PAGINATION,
|
|
30255
30498
|
DIFFICULTY_LEVEL_ENUM,
|
|
@@ -30273,12 +30516,14 @@ export {
|
|
|
30273
30516
|
BadgeActionType as GoalBadgeActionType,
|
|
30274
30517
|
GenericDisplayStatus as GoalDisplayStatus,
|
|
30275
30518
|
GoalDraftType,
|
|
30519
|
+
GoalDraftsTab,
|
|
30276
30520
|
GoalPageTab,
|
|
30277
30521
|
IconButton_default as IconButton,
|
|
30278
30522
|
IconRender_default as IconRender,
|
|
30279
30523
|
IconRoundedButton_default as IconRoundedButton,
|
|
30280
30524
|
ImageUpload,
|
|
30281
30525
|
Input_default as Input,
|
|
30526
|
+
LESSON_AVAILABILITY,
|
|
30282
30527
|
LatexRenderer_default as LatexRenderer,
|
|
30283
30528
|
LessonPreview,
|
|
30284
30529
|
loadingModal_default as LoadingModal,
|
|
@@ -30389,11 +30634,13 @@ export {
|
|
|
30389
30634
|
activitiesHistoryApiResponseSchema,
|
|
30390
30635
|
activityModelsApiResponseSchema,
|
|
30391
30636
|
buildUserFilterData,
|
|
30637
|
+
checkLessonAvailability,
|
|
30392
30638
|
cn,
|
|
30393
30639
|
convertActivityFiltersToQuestionsFilter,
|
|
30394
30640
|
createActivitiesHistoryHook,
|
|
30395
30641
|
createActivityFiltersDataHook,
|
|
30396
30642
|
createActivityModelsHook,
|
|
30643
|
+
createGoalDraftsHook,
|
|
30397
30644
|
createGoalModelsHook,
|
|
30398
30645
|
createNotificationStore,
|
|
30399
30646
|
createNotificationsHook,
|
|
@@ -30406,6 +30653,7 @@ export {
|
|
|
30406
30653
|
createUseActivityModels,
|
|
30407
30654
|
createUseChat,
|
|
30408
30655
|
createUseChatRooms,
|
|
30656
|
+
createUseGoalDrafts,
|
|
30409
30657
|
createUseGoalModels,
|
|
30410
30658
|
createUseNotificationStore,
|
|
30411
30659
|
createUseNotifications,
|
|
@@ -30452,6 +30700,7 @@ export {
|
|
|
30452
30700
|
goalModelsApiResponseSchema,
|
|
30453
30701
|
goalsHistoryApiResponseSchema,
|
|
30454
30702
|
handleActivityFetchError,
|
|
30703
|
+
handleGoalDraftFetchError,
|
|
30455
30704
|
handleGoalFetchError,
|
|
30456
30705
|
handleGoalModelFetchError,
|
|
30457
30706
|
handleLessonDetailsFetchError,
|
|
@@ -30460,6 +30709,8 @@ export {
|
|
|
30460
30709
|
isChatUserInfoValid,
|
|
30461
30710
|
isDeadlinePassed,
|
|
30462
30711
|
isFormValid,
|
|
30712
|
+
isLessonExpired,
|
|
30713
|
+
isLessonNotYetAvailable,
|
|
30463
30714
|
isStepValid,
|
|
30464
30715
|
mapActivityStatusToDisplay,
|
|
30465
30716
|
mapApiStatusToInternal,
|