analytica-frontend-lib 1.2.84 → 1.2.85
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 +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +635 -430
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +516 -316
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -85,6 +85,7 @@ __export(src_exports, {
|
|
|
85
85
|
CorrectActivityModal: () => CorrectActivityModal_default,
|
|
86
86
|
CreateActivity: () => CreateActivity,
|
|
87
87
|
DEFAULT_ACTIVITIES_PAGINATION: () => DEFAULT_ACTIVITIES_PAGINATION,
|
|
88
|
+
DEFAULT_GOAL_DRAFTS_PAGINATION: () => DEFAULT_GOAL_DRAFTS_PAGINATION,
|
|
88
89
|
DEFAULT_GOAL_MODELS_PAGINATION: () => DEFAULT_GOAL_MODELS_PAGINATION,
|
|
89
90
|
DEFAULT_MODELS_PAGINATION: () => DEFAULT_MODELS_PAGINATION,
|
|
90
91
|
DIFFICULTY_LEVEL_ENUM: () => DIFFICULTY_LEVEL_ENUM,
|
|
@@ -108,6 +109,7 @@ __export(src_exports, {
|
|
|
108
109
|
GoalBadgeActionType: () => BadgeActionType,
|
|
109
110
|
GoalDisplayStatus: () => GenericDisplayStatus,
|
|
110
111
|
GoalDraftType: () => GoalDraftType,
|
|
112
|
+
GoalDraftsTab: () => GoalDraftsTab,
|
|
111
113
|
GoalPageTab: () => GoalPageTab,
|
|
112
114
|
IconButton: () => IconButton_default,
|
|
113
115
|
IconRender: () => IconRender_default,
|
|
@@ -229,6 +231,7 @@ __export(src_exports, {
|
|
|
229
231
|
createActivitiesHistoryHook: () => createActivitiesHistoryHook,
|
|
230
232
|
createActivityFiltersDataHook: () => createActivityFiltersDataHook,
|
|
231
233
|
createActivityModelsHook: () => createActivityModelsHook,
|
|
234
|
+
createGoalDraftsHook: () => createGoalDraftsHook,
|
|
232
235
|
createGoalModelsHook: () => createGoalModelsHook,
|
|
233
236
|
createNotificationStore: () => createNotificationStore,
|
|
234
237
|
createNotificationsHook: () => createNotificationsHook,
|
|
@@ -241,6 +244,7 @@ __export(src_exports, {
|
|
|
241
244
|
createUseActivityModels: () => createUseActivityModels,
|
|
242
245
|
createUseChat: () => createUseChat,
|
|
243
246
|
createUseChatRooms: () => createUseChatRooms,
|
|
247
|
+
createUseGoalDrafts: () => createUseGoalDrafts,
|
|
244
248
|
createUseGoalModels: () => createUseGoalModels,
|
|
245
249
|
createUseNotificationStore: () => createUseNotificationStore,
|
|
246
250
|
createUseNotifications: () => createUseNotifications,
|
|
@@ -287,6 +291,7 @@ __export(src_exports, {
|
|
|
287
291
|
goalModelsApiResponseSchema: () => goalModelsApiResponseSchema,
|
|
288
292
|
goalsHistoryApiResponseSchema: () => goalsHistoryApiResponseSchema,
|
|
289
293
|
handleActivityFetchError: () => handleActivityFetchError,
|
|
294
|
+
handleGoalDraftFetchError: () => handleGoalDraftFetchError,
|
|
290
295
|
handleGoalFetchError: () => handleGoalFetchError,
|
|
291
296
|
handleGoalModelFetchError: () => handleGoalModelFetchError,
|
|
292
297
|
handleLessonDetailsFetchError: () => handleLessonDetailsFetchError,
|
|
@@ -26221,7 +26226,7 @@ var SendLessonModal = ({
|
|
|
26221
26226
|
var SendLessonModal_default = SendLessonModal;
|
|
26222
26227
|
|
|
26223
26228
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
26224
|
-
var
|
|
26229
|
+
var import_react83 = require("react");
|
|
26225
26230
|
var import_phosphor_react52 = require("phosphor-react");
|
|
26226
26231
|
|
|
26227
26232
|
// src/types/recommendedLessons.ts
|
|
@@ -26827,8 +26832,161 @@ var GoalModelsTab = ({
|
|
|
26827
26832
|
}
|
|
26828
26833
|
);
|
|
26829
26834
|
|
|
26830
|
-
// src/components/RecommendedLessonsHistory/
|
|
26835
|
+
// src/components/RecommendedLessonsHistory/config/draftsFiltersConfig.ts
|
|
26836
|
+
var getSubjectOptions2 = (data) => {
|
|
26837
|
+
if (!data?.subjects) return [];
|
|
26838
|
+
return data.subjects.map((subject) => ({
|
|
26839
|
+
id: subject.id,
|
|
26840
|
+
name: subject.name
|
|
26841
|
+
}));
|
|
26842
|
+
};
|
|
26843
|
+
var createGoalDraftsFiltersConfig = (userData) => [
|
|
26844
|
+
{
|
|
26845
|
+
key: "content",
|
|
26846
|
+
label: "CONTE\xDADO",
|
|
26847
|
+
categories: [
|
|
26848
|
+
{
|
|
26849
|
+
key: "subject",
|
|
26850
|
+
label: "Mat\xE9ria",
|
|
26851
|
+
selectedIds: [],
|
|
26852
|
+
itens: getSubjectOptions2(userData)
|
|
26853
|
+
}
|
|
26854
|
+
]
|
|
26855
|
+
}
|
|
26856
|
+
];
|
|
26857
|
+
|
|
26858
|
+
// src/hooks/useGoalDrafts.ts
|
|
26859
|
+
var import_react82 = require("react");
|
|
26860
|
+
var DEFAULT_GOAL_DRAFTS_PAGINATION = {
|
|
26861
|
+
total: 0,
|
|
26862
|
+
page: 1,
|
|
26863
|
+
limit: 10,
|
|
26864
|
+
totalPages: 0
|
|
26865
|
+
};
|
|
26866
|
+
var handleGoalDraftFetchError = createFetchErrorHandler(
|
|
26867
|
+
"Erro ao validar dados de rascunhos de aulas",
|
|
26868
|
+
"Erro ao carregar rascunhos de aulas"
|
|
26869
|
+
);
|
|
26870
|
+
var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
26871
|
+
return () => {
|
|
26872
|
+
const [state, setState] = (0, import_react82.useState)({
|
|
26873
|
+
models: [],
|
|
26874
|
+
loading: false,
|
|
26875
|
+
error: null,
|
|
26876
|
+
pagination: DEFAULT_GOAL_DRAFTS_PAGINATION
|
|
26877
|
+
});
|
|
26878
|
+
const fetchModels = (0, import_react82.useCallback)(
|
|
26879
|
+
async (filters, subjectsMap) => {
|
|
26880
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
26881
|
+
try {
|
|
26882
|
+
const responseData = await fetchGoalDrafts(filters);
|
|
26883
|
+
const validatedData = goalModelsApiResponseSchema.parse(responseData);
|
|
26884
|
+
const tableItems = validatedData.data.drafts.map(
|
|
26885
|
+
(draft) => transformGoalModelToTableItem(draft, subjectsMap)
|
|
26886
|
+
);
|
|
26887
|
+
const limit = filters?.limit || 10;
|
|
26888
|
+
const page = filters?.page || 1;
|
|
26889
|
+
const total = validatedData.data.total;
|
|
26890
|
+
const totalPages = Math.ceil(total / limit);
|
|
26891
|
+
setState({
|
|
26892
|
+
models: tableItems,
|
|
26893
|
+
loading: false,
|
|
26894
|
+
error: null,
|
|
26895
|
+
pagination: {
|
|
26896
|
+
total,
|
|
26897
|
+
page,
|
|
26898
|
+
limit,
|
|
26899
|
+
totalPages
|
|
26900
|
+
}
|
|
26901
|
+
});
|
|
26902
|
+
} catch (error) {
|
|
26903
|
+
const errorMessage = handleGoalDraftFetchError(error);
|
|
26904
|
+
setState((prev) => ({
|
|
26905
|
+
...prev,
|
|
26906
|
+
loading: false,
|
|
26907
|
+
error: errorMessage
|
|
26908
|
+
}));
|
|
26909
|
+
}
|
|
26910
|
+
},
|
|
26911
|
+
[fetchGoalDrafts]
|
|
26912
|
+
);
|
|
26913
|
+
const deleteModel = (0, import_react82.useCallback)(
|
|
26914
|
+
async (id) => {
|
|
26915
|
+
try {
|
|
26916
|
+
await deleteGoalDraft(id);
|
|
26917
|
+
return true;
|
|
26918
|
+
} catch (error) {
|
|
26919
|
+
console.error("Erro ao deletar rascunho:", error);
|
|
26920
|
+
return false;
|
|
26921
|
+
}
|
|
26922
|
+
},
|
|
26923
|
+
[deleteGoalDraft]
|
|
26924
|
+
);
|
|
26925
|
+
return {
|
|
26926
|
+
...state,
|
|
26927
|
+
fetchModels,
|
|
26928
|
+
deleteModel
|
|
26929
|
+
};
|
|
26930
|
+
};
|
|
26931
|
+
};
|
|
26932
|
+
var createGoalDraftsHook = createUseGoalDrafts;
|
|
26933
|
+
|
|
26934
|
+
// src/components/RecommendedLessonsHistory/tabs/DraftsTab.tsx
|
|
26831
26935
|
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
26936
|
+
var GOAL_DRAFTS_CONFIG = {
|
|
26937
|
+
entityName: "rascunho",
|
|
26938
|
+
entityNamePlural: "rascunhos",
|
|
26939
|
+
testId: "goal-drafts-tab",
|
|
26940
|
+
emptyStateTitle: "Voc\xEA n\xE3o tem aulas recomendadas em rascunho",
|
|
26941
|
+
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!",
|
|
26942
|
+
searchPlaceholder: "Buscar rascunho"
|
|
26943
|
+
};
|
|
26944
|
+
var GOAL_DRAFTS_COLUMNS_CONFIG = {
|
|
26945
|
+
sendButtonLabel: "Enviar aula",
|
|
26946
|
+
sendButtonAriaLabel: "Enviar rascunho",
|
|
26947
|
+
deleteButtonAriaLabel: "Deletar rascunho",
|
|
26948
|
+
editButtonAriaLabel: "Editar rascunho"
|
|
26949
|
+
};
|
|
26950
|
+
var GoalDraftsTab = ({
|
|
26951
|
+
fetchGoalDrafts,
|
|
26952
|
+
deleteGoalDraft,
|
|
26953
|
+
onCreateDraft,
|
|
26954
|
+
onSendDraft,
|
|
26955
|
+
onEditDraft,
|
|
26956
|
+
emptyStateImage,
|
|
26957
|
+
noSearchImage,
|
|
26958
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
26959
|
+
userFilterData,
|
|
26960
|
+
subjectsMap
|
|
26961
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
26962
|
+
ModelsTabBase,
|
|
26963
|
+
{
|
|
26964
|
+
fetchModels: fetchGoalDrafts,
|
|
26965
|
+
deleteModel: deleteGoalDraft,
|
|
26966
|
+
onCreateModel: onCreateDraft,
|
|
26967
|
+
onSend: onSendDraft,
|
|
26968
|
+
onEditModel: onEditDraft,
|
|
26969
|
+
emptyStateImage,
|
|
26970
|
+
noSearchImage,
|
|
26971
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
26972
|
+
userFilterData,
|
|
26973
|
+
subjectsMap,
|
|
26974
|
+
config: GOAL_DRAFTS_CONFIG,
|
|
26975
|
+
createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
|
|
26976
|
+
mapSubject,
|
|
26977
|
+
send,
|
|
26978
|
+
edit,
|
|
26979
|
+
del,
|
|
26980
|
+
GOAL_DRAFTS_COLUMNS_CONFIG
|
|
26981
|
+
),
|
|
26982
|
+
createFiltersConfig: createGoalDraftsFiltersConfig,
|
|
26983
|
+
buildFiltersFromParams: buildGoalModelsFiltersFromParams,
|
|
26984
|
+
createUseModels: createUseGoalDrafts
|
|
26985
|
+
}
|
|
26986
|
+
);
|
|
26987
|
+
|
|
26988
|
+
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
26989
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
26832
26990
|
var GoalPageTab = /* @__PURE__ */ ((GoalPageTab2) => {
|
|
26833
26991
|
GoalPageTab2["HISTORY"] = "history";
|
|
26834
26992
|
GoalPageTab2["DRAFTS"] = "drafts";
|
|
@@ -26874,7 +27032,7 @@ var getSchoolOptions = (data) => {
|
|
|
26874
27032
|
name: school.name
|
|
26875
27033
|
}));
|
|
26876
27034
|
};
|
|
26877
|
-
var
|
|
27035
|
+
var getSubjectOptions3 = (data) => {
|
|
26878
27036
|
if (!data?.subjects) return [];
|
|
26879
27037
|
return data.subjects.map((subject) => ({
|
|
26880
27038
|
id: subject.id,
|
|
@@ -26940,7 +27098,7 @@ var createGoalFiltersConfig = (userData) => [
|
|
|
26940
27098
|
key: "subject",
|
|
26941
27099
|
label: "Mat\xE9ria",
|
|
26942
27100
|
selectedIds: [],
|
|
26943
|
-
itens:
|
|
27101
|
+
itens: getSubjectOptions3(userData)
|
|
26944
27102
|
},
|
|
26945
27103
|
{
|
|
26946
27104
|
key: "theme",
|
|
@@ -26993,7 +27151,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
26993
27151
|
className: "max-w-[200px] truncate",
|
|
26994
27152
|
render: (value) => {
|
|
26995
27153
|
const title = typeof value === "string" ? value : "";
|
|
26996
|
-
return /* @__PURE__ */ (0,
|
|
27154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "sm", title, children: title });
|
|
26997
27155
|
}
|
|
26998
27156
|
},
|
|
26999
27157
|
{
|
|
@@ -27003,7 +27161,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27003
27161
|
className: "max-w-[150px] truncate",
|
|
27004
27162
|
render: (value) => {
|
|
27005
27163
|
const school = typeof value === "string" ? value : "";
|
|
27006
|
-
return /* @__PURE__ */ (0,
|
|
27164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "sm", title: school, children: school });
|
|
27007
27165
|
}
|
|
27008
27166
|
},
|
|
27009
27167
|
{
|
|
@@ -27020,11 +27178,11 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27020
27178
|
const subjectName = typeof value === "string" ? value : "";
|
|
27021
27179
|
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
27022
27180
|
if (!subjectEnum) {
|
|
27023
|
-
return /* @__PURE__ */ (0,
|
|
27181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
27024
27182
|
}
|
|
27025
27183
|
const subjectInfo = getSubjectInfo(subjectEnum);
|
|
27026
|
-
return /* @__PURE__ */ (0,
|
|
27027
|
-
/* @__PURE__ */ (0,
|
|
27184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center gap-2", title: subjectName, children: [
|
|
27185
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27028
27186
|
"span",
|
|
27029
27187
|
{
|
|
27030
27188
|
className: cn(
|
|
@@ -27034,7 +27192,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27034
27192
|
children: subjectInfo.icon
|
|
27035
27193
|
}
|
|
27036
27194
|
),
|
|
27037
|
-
/* @__PURE__ */ (0,
|
|
27195
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "sm", className: "truncate", children: subjectName })
|
|
27038
27196
|
] });
|
|
27039
27197
|
}
|
|
27040
27198
|
},
|
|
@@ -27050,9 +27208,9 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27050
27208
|
render: (value) => {
|
|
27051
27209
|
const status = typeof value === "string" ? value : "";
|
|
27052
27210
|
if (!status) {
|
|
27053
|
-
return /* @__PURE__ */ (0,
|
|
27211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "sm", color: "text-text-500", children: "-" });
|
|
27054
27212
|
}
|
|
27055
|
-
return /* @__PURE__ */ (0,
|
|
27213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27056
27214
|
Badge_default,
|
|
27057
27215
|
{
|
|
27058
27216
|
variant: "solid",
|
|
@@ -27067,7 +27225,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27067
27225
|
key: "completionPercentage",
|
|
27068
27226
|
label: "Conclus\xE3o",
|
|
27069
27227
|
sortable: true,
|
|
27070
|
-
render: (value) => /* @__PURE__ */ (0,
|
|
27228
|
+
render: (value) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27071
27229
|
ProgressBar_default,
|
|
27072
27230
|
{
|
|
27073
27231
|
value: Number(value),
|
|
@@ -27093,20 +27251,20 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27093
27251
|
e.stopPropagation();
|
|
27094
27252
|
onEditGoal?.(row.id);
|
|
27095
27253
|
};
|
|
27096
|
-
return /* @__PURE__ */ (0,
|
|
27097
|
-
/* @__PURE__ */ (0,
|
|
27254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex justify-center gap-2", children: [
|
|
27255
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27098
27256
|
IconButton_default,
|
|
27099
27257
|
{
|
|
27100
|
-
icon: /* @__PURE__ */ (0,
|
|
27258
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_phosphor_react52.Trash, { size: 20 }),
|
|
27101
27259
|
size: "sm",
|
|
27102
27260
|
title: "Excluir",
|
|
27103
27261
|
onClick: handleDelete
|
|
27104
27262
|
}
|
|
27105
27263
|
),
|
|
27106
|
-
/* @__PURE__ */ (0,
|
|
27264
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27107
27265
|
IconButton_default,
|
|
27108
27266
|
{
|
|
27109
|
-
icon: /* @__PURE__ */ (0,
|
|
27267
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_phosphor_react52.PencilSimple, { size: 20 }),
|
|
27110
27268
|
size: "sm",
|
|
27111
27269
|
title: "Editar",
|
|
27112
27270
|
onClick: handleEdit
|
|
@@ -27120,7 +27278,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27120
27278
|
label: "",
|
|
27121
27279
|
sortable: false,
|
|
27122
27280
|
className: "w-12",
|
|
27123
|
-
render: () => /* @__PURE__ */ (0,
|
|
27281
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_phosphor_react52.CaretRight, { size: 20, className: "text-text-600" }) })
|
|
27124
27282
|
}
|
|
27125
27283
|
];
|
|
27126
27284
|
var RecommendedLessonsHistory = ({
|
|
@@ -27142,18 +27300,22 @@ var RecommendedLessonsHistory = ({
|
|
|
27142
27300
|
onSendLesson,
|
|
27143
27301
|
onEditModel,
|
|
27144
27302
|
subjectsMap,
|
|
27303
|
+
fetchGoalDrafts,
|
|
27304
|
+
deleteGoalDraft,
|
|
27305
|
+
onSendDraft,
|
|
27306
|
+
onEditDraft,
|
|
27145
27307
|
defaultTab,
|
|
27146
27308
|
onTabChange
|
|
27147
27309
|
}) => {
|
|
27148
|
-
const [activeTab, setActiveTab] = (0,
|
|
27310
|
+
const [activeTab, setActiveTab] = (0, import_react83.useState)(
|
|
27149
27311
|
defaultTab ?? "history" /* HISTORY */
|
|
27150
27312
|
);
|
|
27151
|
-
(0,
|
|
27313
|
+
(0, import_react83.useEffect)(() => {
|
|
27152
27314
|
if (defaultTab !== void 0) {
|
|
27153
27315
|
setActiveTab(defaultTab);
|
|
27154
27316
|
}
|
|
27155
27317
|
}, [defaultTab]);
|
|
27156
|
-
const handleTabChange = (0,
|
|
27318
|
+
const handleTabChange = (0, import_react83.useCallback)(
|
|
27157
27319
|
(value) => {
|
|
27158
27320
|
const newTab = value;
|
|
27159
27321
|
setActiveTab(newTab);
|
|
@@ -27161,9 +27323,9 @@ var RecommendedLessonsHistory = ({
|
|
|
27161
27323
|
},
|
|
27162
27324
|
[onTabChange]
|
|
27163
27325
|
);
|
|
27164
|
-
const fetchGoalsHistoryRef = (0,
|
|
27326
|
+
const fetchGoalsHistoryRef = (0, import_react83.useRef)(fetchGoalsHistory);
|
|
27165
27327
|
fetchGoalsHistoryRef.current = fetchGoalsHistory;
|
|
27166
|
-
const useGoalsHistory = (0,
|
|
27328
|
+
const useGoalsHistory = (0, import_react83.useMemo)(
|
|
27167
27329
|
() => createUseRecommendedLessonsHistory(
|
|
27168
27330
|
(filters) => fetchGoalsHistoryRef.current(filters)
|
|
27169
27331
|
),
|
|
@@ -27176,31 +27338,31 @@ var RecommendedLessonsHistory = ({
|
|
|
27176
27338
|
pagination,
|
|
27177
27339
|
fetchGoals
|
|
27178
27340
|
} = useGoalsHistory();
|
|
27179
|
-
const initialFilterConfigs = (0,
|
|
27341
|
+
const initialFilterConfigs = (0, import_react83.useMemo)(
|
|
27180
27342
|
() => createGoalFiltersConfig(userFilterData),
|
|
27181
27343
|
[userFilterData]
|
|
27182
27344
|
);
|
|
27183
|
-
const tableColumns = (0,
|
|
27345
|
+
const tableColumns = (0, import_react83.useMemo)(
|
|
27184
27346
|
() => createTableColumns2(mapSubjectNameToEnum2, onDeleteGoal, onEditGoal),
|
|
27185
27347
|
[mapSubjectNameToEnum2, onDeleteGoal, onEditGoal]
|
|
27186
27348
|
);
|
|
27187
|
-
const handleParamsChange = (0,
|
|
27349
|
+
const handleParamsChange = (0, import_react83.useCallback)(
|
|
27188
27350
|
(params) => {
|
|
27189
27351
|
const filters = buildFiltersFromParams(params);
|
|
27190
27352
|
fetchGoals(filters);
|
|
27191
27353
|
},
|
|
27192
27354
|
[fetchGoals]
|
|
27193
27355
|
);
|
|
27194
|
-
return /* @__PURE__ */ (0,
|
|
27356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
27195
27357
|
"div",
|
|
27196
27358
|
{
|
|
27197
27359
|
"data-testid": "recommended-lessons-history",
|
|
27198
27360
|
className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
|
|
27199
27361
|
children: [
|
|
27200
|
-
/* @__PURE__ */ (0,
|
|
27201
|
-
/* @__PURE__ */ (0,
|
|
27202
|
-
/* @__PURE__ */ (0,
|
|
27203
|
-
/* @__PURE__ */ (0,
|
|
27362
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
|
|
27363
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("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: [
|
|
27364
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("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: [
|
|
27365
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27204
27366
|
Text_default,
|
|
27205
27367
|
{
|
|
27206
27368
|
as: "h1",
|
|
@@ -27209,7 +27371,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27209
27371
|
children: title
|
|
27210
27372
|
}
|
|
27211
27373
|
),
|
|
27212
|
-
/* @__PURE__ */ (0,
|
|
27374
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27213
27375
|
Menu,
|
|
27214
27376
|
{
|
|
27215
27377
|
defaultValue: "history" /* HISTORY */,
|
|
@@ -27217,13 +27379,13 @@ var RecommendedLessonsHistory = ({
|
|
|
27217
27379
|
onValueChange: handleTabChange,
|
|
27218
27380
|
variant: "menu2",
|
|
27219
27381
|
className: "bg-transparent shadow-none px-0",
|
|
27220
|
-
children: /* @__PURE__ */ (0,
|
|
27382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
27221
27383
|
MenuContent,
|
|
27222
27384
|
{
|
|
27223
27385
|
variant: "menu2",
|
|
27224
27386
|
className: "w-full lg:w-auto max-w-full min-w-0",
|
|
27225
27387
|
children: [
|
|
27226
|
-
/* @__PURE__ */ (0,
|
|
27388
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27227
27389
|
MenuItem,
|
|
27228
27390
|
{
|
|
27229
27391
|
variant: "menu2",
|
|
@@ -27233,7 +27395,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27233
27395
|
children: "Hist\xF3rico"
|
|
27234
27396
|
}
|
|
27235
27397
|
),
|
|
27236
|
-
/* @__PURE__ */ (0,
|
|
27398
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27237
27399
|
MenuItem,
|
|
27238
27400
|
{
|
|
27239
27401
|
variant: "menu2",
|
|
@@ -27243,7 +27405,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27243
27405
|
children: "Rascunhos"
|
|
27244
27406
|
}
|
|
27245
27407
|
),
|
|
27246
|
-
/* @__PURE__ */ (0,
|
|
27408
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27247
27409
|
MenuItem,
|
|
27248
27410
|
{
|
|
27249
27411
|
variant: "menu2",
|
|
@@ -27259,8 +27421,8 @@ var RecommendedLessonsHistory = ({
|
|
|
27259
27421
|
}
|
|
27260
27422
|
) })
|
|
27261
27423
|
] }),
|
|
27262
|
-
/* @__PURE__ */ (0,
|
|
27263
|
-
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0,
|
|
27424
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
|
|
27425
|
+
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_jsx_runtime120.Fragment, { children: error ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "lg", color: "text-error-500", children: error }) }) : /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27264
27426
|
TableProvider,
|
|
27265
27427
|
{
|
|
27266
27428
|
data: goals,
|
|
@@ -27285,14 +27447,14 @@ var RecommendedLessonsHistory = ({
|
|
|
27285
27447
|
image: noSearchImage
|
|
27286
27448
|
},
|
|
27287
27449
|
emptyState: {
|
|
27288
|
-
component: /* @__PURE__ */ (0,
|
|
27450
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27289
27451
|
EmptyState_default,
|
|
27290
27452
|
{
|
|
27291
27453
|
image: emptyStateImage,
|
|
27292
27454
|
title: "Crie uma nova aula",
|
|
27293
27455
|
description: "Selecione um conjunto de aulas organizadas por tema e ajude seus alunos a estudarem de forma estruturada e eficiente!",
|
|
27294
27456
|
buttonText: createButtonText,
|
|
27295
|
-
buttonIcon: /* @__PURE__ */ (0,
|
|
27457
|
+
buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_phosphor_react52.Plus, { size: 18 }),
|
|
27296
27458
|
buttonVariant: "outline",
|
|
27297
27459
|
buttonAction: "primary",
|
|
27298
27460
|
onButtonClick: onCreateLesson
|
|
@@ -27307,22 +27469,22 @@ var RecommendedLessonsHistory = ({
|
|
|
27307
27469
|
table,
|
|
27308
27470
|
pagination: paginationComponent
|
|
27309
27471
|
} = renderProps;
|
|
27310
|
-
return /* @__PURE__ */ (0,
|
|
27311
|
-
/* @__PURE__ */ (0,
|
|
27312
|
-
/* @__PURE__ */ (0,
|
|
27472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "space-y-4", children: [
|
|
27473
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
27474
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27313
27475
|
Button_default,
|
|
27314
27476
|
{
|
|
27315
27477
|
variant: "solid",
|
|
27316
27478
|
action: "primary",
|
|
27317
27479
|
size: "medium",
|
|
27318
27480
|
onClick: onCreateLesson,
|
|
27319
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
27481
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_phosphor_react52.Plus, { size: 18, weight: "bold" }),
|
|
27320
27482
|
children: createButtonText
|
|
27321
27483
|
}
|
|
27322
27484
|
),
|
|
27323
27485
|
controls
|
|
27324
27486
|
] }),
|
|
27325
|
-
/* @__PURE__ */ (0,
|
|
27487
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
|
|
27326
27488
|
table,
|
|
27327
27489
|
paginationComponent
|
|
27328
27490
|
] })
|
|
@@ -27330,8 +27492,22 @@ var RecommendedLessonsHistory = ({
|
|
|
27330
27492
|
}
|
|
27331
27493
|
}
|
|
27332
27494
|
) }) }),
|
|
27333
|
-
activeTab === "drafts" /* DRAFTS */ &&
|
|
27334
|
-
|
|
27495
|
+
activeTab === "drafts" /* DRAFTS */ && fetchGoalDrafts && deleteGoalDraft && onCreateLesson && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27496
|
+
GoalDraftsTab,
|
|
27497
|
+
{
|
|
27498
|
+
fetchGoalDrafts,
|
|
27499
|
+
deleteGoalDraft,
|
|
27500
|
+
onCreateDraft: onCreateLesson,
|
|
27501
|
+
onSendDraft,
|
|
27502
|
+
onEditDraft,
|
|
27503
|
+
emptyStateImage,
|
|
27504
|
+
noSearchImage,
|
|
27505
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
27506
|
+
userFilterData,
|
|
27507
|
+
subjectsMap
|
|
27508
|
+
}
|
|
27509
|
+
),
|
|
27510
|
+
activeTab === "models" /* MODELS */ && fetchGoalModels && deleteGoalModel && onCreateModel && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27335
27511
|
GoalModelsTab,
|
|
27336
27512
|
{
|
|
27337
27513
|
fetchGoalModels,
|
|
@@ -27354,19 +27530,19 @@ var RecommendedLessonsHistory = ({
|
|
|
27354
27530
|
};
|
|
27355
27531
|
|
|
27356
27532
|
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
27357
|
-
var
|
|
27533
|
+
var import_react91 = require("react");
|
|
27358
27534
|
|
|
27359
27535
|
// src/components/RecommendedLessonDetails/components/Breadcrumb.tsx
|
|
27360
|
-
var
|
|
27361
|
-
var
|
|
27362
|
-
var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ (0,
|
|
27536
|
+
var import_react84 = require("@phosphor-icons/react");
|
|
27537
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
27538
|
+
var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("nav", { className: "flex items-center gap-2 text-sm", "aria-label": "Breadcrumb", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
|
|
27363
27539
|
Text_default,
|
|
27364
27540
|
{
|
|
27365
27541
|
as: "span",
|
|
27366
27542
|
className: "flex items-center gap-2",
|
|
27367
27543
|
children: [
|
|
27368
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
27369
|
-
item.path ? /* @__PURE__ */ (0,
|
|
27544
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_react84.CaretRightIcon, { size: 14, className: "text-text-500" }),
|
|
27545
|
+
item.path ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
27370
27546
|
"button",
|
|
27371
27547
|
{
|
|
27372
27548
|
type: "button",
|
|
@@ -27374,14 +27550,14 @@ var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ (0, import_jsx_runt
|
|
|
27374
27550
|
className: "text-text-600 hover:text-primary-700 transition-colors",
|
|
27375
27551
|
children: item.label
|
|
27376
27552
|
}
|
|
27377
|
-
) : /* @__PURE__ */ (0,
|
|
27553
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Text_default, { as: "span", className: "text-text-950 font-medium", children: item.label })
|
|
27378
27554
|
]
|
|
27379
27555
|
},
|
|
27380
27556
|
item.path ?? item.label
|
|
27381
27557
|
)) });
|
|
27382
27558
|
|
|
27383
27559
|
// src/components/RecommendedLessonDetails/components/LessonHeader.tsx
|
|
27384
|
-
var
|
|
27560
|
+
var import_react85 = require("@phosphor-icons/react");
|
|
27385
27561
|
|
|
27386
27562
|
// src/components/RecommendedLessonDetails/utils/lessonDetailsUtils.ts
|
|
27387
27563
|
var formatDate = (dateString) => {
|
|
@@ -27403,7 +27579,7 @@ var transformStudentForDisplay = (student, deadline) => ({
|
|
|
27403
27579
|
});
|
|
27404
27580
|
|
|
27405
27581
|
// src/components/RecommendedLessonDetails/components/LessonHeader.tsx
|
|
27406
|
-
var
|
|
27582
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
27407
27583
|
var LessonHeader = ({
|
|
27408
27584
|
data,
|
|
27409
27585
|
onViewLesson,
|
|
@@ -27414,9 +27590,9 @@ var LessonHeader = ({
|
|
|
27414
27590
|
const subjectName = goal.lessonsGoals[0]?.supLessonsProgress?.lesson?.subject?.name || "";
|
|
27415
27591
|
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
27416
27592
|
const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
|
|
27417
|
-
return /* @__PURE__ */ (0,
|
|
27418
|
-
/* @__PURE__ */ (0,
|
|
27419
|
-
/* @__PURE__ */ (0,
|
|
27593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4", children: [
|
|
27594
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
27595
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
27420
27596
|
Text_default,
|
|
27421
27597
|
{
|
|
27422
27598
|
as: "h1",
|
|
@@ -27426,24 +27602,24 @@ var LessonHeader = ({
|
|
|
27426
27602
|
children: goal.title
|
|
27427
27603
|
}
|
|
27428
27604
|
),
|
|
27429
|
-
/* @__PURE__ */ (0,
|
|
27430
|
-
/* @__PURE__ */ (0,
|
|
27605
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "flex flex-wrap items-center gap-2 text-sm text-text-600", children: [
|
|
27606
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
27431
27607
|
"In\xEDcio em ",
|
|
27432
27608
|
formatDate(goal.startDate)
|
|
27433
27609
|
] }),
|
|
27434
|
-
/* @__PURE__ */ (0,
|
|
27435
|
-
/* @__PURE__ */ (0,
|
|
27610
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27611
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
27436
27612
|
"Prazo final ",
|
|
27437
27613
|
formatDate(goal.finalDate)
|
|
27438
27614
|
] }),
|
|
27439
|
-
breakdown?.schoolName && /* @__PURE__ */ (0,
|
|
27440
|
-
/* @__PURE__ */ (0,
|
|
27441
|
-
/* @__PURE__ */ (0,
|
|
27615
|
+
breakdown?.schoolName && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
27616
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27617
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.schoolName })
|
|
27442
27618
|
] }),
|
|
27443
|
-
subjectName && /* @__PURE__ */ (0,
|
|
27444
|
-
/* @__PURE__ */ (0,
|
|
27445
|
-
/* @__PURE__ */ (0,
|
|
27446
|
-
subjectInfo && /* @__PURE__ */ (0,
|
|
27619
|
+
subjectName && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
27620
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27621
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text_default, { as: "span", size: "sm", className: "flex items-center gap-1", children: [
|
|
27622
|
+
subjectInfo && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
27447
27623
|
Text_default,
|
|
27448
27624
|
{
|
|
27449
27625
|
as: "span",
|
|
@@ -27457,19 +27633,19 @@ var LessonHeader = ({
|
|
|
27457
27633
|
subjectName
|
|
27458
27634
|
] })
|
|
27459
27635
|
] }),
|
|
27460
|
-
breakdown?.className && /* @__PURE__ */ (0,
|
|
27461
|
-
/* @__PURE__ */ (0,
|
|
27462
|
-
/* @__PURE__ */ (0,
|
|
27636
|
+
breakdown?.className && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
27637
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27638
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.className })
|
|
27463
27639
|
] })
|
|
27464
27640
|
] })
|
|
27465
27641
|
] }),
|
|
27466
|
-
onViewLesson && /* @__PURE__ */ (0,
|
|
27642
|
+
onViewLesson && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
27467
27643
|
Button_default,
|
|
27468
27644
|
{
|
|
27469
27645
|
variant: "solid",
|
|
27470
27646
|
action: "primary",
|
|
27471
27647
|
size: "small",
|
|
27472
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
27648
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_react85.BookBookmarkIcon, { size: 16 }),
|
|
27473
27649
|
onClick: onViewLesson,
|
|
27474
27650
|
children: viewLessonLabel
|
|
27475
27651
|
}
|
|
@@ -27478,34 +27654,34 @@ var LessonHeader = ({
|
|
|
27478
27654
|
};
|
|
27479
27655
|
|
|
27480
27656
|
// src/components/RecommendedLessonDetails/components/LoadingSkeleton.tsx
|
|
27481
|
-
var
|
|
27482
|
-
var LoadingSkeleton = () => /* @__PURE__ */ (0,
|
|
27483
|
-
/* @__PURE__ */ (0,
|
|
27484
|
-
/* @__PURE__ */ (0,
|
|
27485
|
-
/* @__PURE__ */ (0,
|
|
27486
|
-
/* @__PURE__ */ (0,
|
|
27657
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
27658
|
+
var LoadingSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
27659
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonText, { width: 256 }),
|
|
27660
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
27661
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonText, { width: "75%", height: 28 }),
|
|
27662
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonText, { width: "50%" })
|
|
27487
27663
|
] }) }),
|
|
27488
|
-
/* @__PURE__ */ (0,
|
|
27489
|
-
/* @__PURE__ */ (0,
|
|
27490
|
-
/* @__PURE__ */ (0,
|
|
27491
|
-
/* @__PURE__ */ (0,
|
|
27492
|
-
/* @__PURE__ */ (0,
|
|
27493
|
-
/* @__PURE__ */ (0,
|
|
27664
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
27665
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonText, { width: 192, height: 20 }),
|
|
27666
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
|
|
27667
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonRounded, { height: 140 }),
|
|
27668
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonRounded, { height: 140 }),
|
|
27669
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonRounded, { height: 140 })
|
|
27494
27670
|
] })
|
|
27495
27671
|
] }),
|
|
27496
|
-
/* @__PURE__ */ (0,
|
|
27672
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonTable, { rows: 4, columns: 5 }) })
|
|
27497
27673
|
] });
|
|
27498
27674
|
|
|
27499
27675
|
// src/components/RecommendedLessonDetails/components/ResultsSection.tsx
|
|
27500
|
-
var
|
|
27501
|
-
var
|
|
27676
|
+
var import_react86 = require("@phosphor-icons/react");
|
|
27677
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
27502
27678
|
var ResultsSection = ({ data, labels }) => {
|
|
27503
27679
|
const { details } = data;
|
|
27504
27680
|
const { aggregated, contentPerformance } = details;
|
|
27505
|
-
return /* @__PURE__ */ (0,
|
|
27506
|
-
/* @__PURE__ */ (0,
|
|
27507
|
-
/* @__PURE__ */ (0,
|
|
27508
|
-
/* @__PURE__ */ (0,
|
|
27681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
27682
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Text_default, { as: "h2", size: "md", weight: "semibold", className: "text-text-950", children: labels.resultsTitle }),
|
|
27683
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
|
|
27684
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-primary-50", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27509
27685
|
ProgressCircle_default,
|
|
27510
27686
|
{
|
|
27511
27687
|
value: aggregated.completionPercentage,
|
|
@@ -27515,16 +27691,16 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27515
27691
|
showPercentage: true
|
|
27516
27692
|
}
|
|
27517
27693
|
) }),
|
|
27518
|
-
/* @__PURE__ */ (0,
|
|
27519
|
-
/* @__PURE__ */ (0,
|
|
27694
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-success-200", children: [
|
|
27695
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27520
27696
|
Text_default,
|
|
27521
27697
|
{
|
|
27522
27698
|
as: "span",
|
|
27523
27699
|
className: "size-8 rounded-full flex items-center justify-center bg-warning-300 mb-2",
|
|
27524
|
-
children: /* @__PURE__ */ (0,
|
|
27700
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_react86.TrophyIcon, { size: 18, weight: "fill", className: "text-white" })
|
|
27525
27701
|
}
|
|
27526
27702
|
),
|
|
27527
|
-
/* @__PURE__ */ (0,
|
|
27703
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27528
27704
|
Text_default,
|
|
27529
27705
|
{
|
|
27530
27706
|
size: "2xs",
|
|
@@ -27533,7 +27709,7 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27533
27709
|
children: labels.bestResultLabel
|
|
27534
27710
|
}
|
|
27535
27711
|
),
|
|
27536
|
-
/* @__PURE__ */ (0,
|
|
27712
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27537
27713
|
Text_default,
|
|
27538
27714
|
{
|
|
27539
27715
|
size: "xl",
|
|
@@ -27543,16 +27719,16 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27543
27719
|
}
|
|
27544
27720
|
)
|
|
27545
27721
|
] }),
|
|
27546
|
-
/* @__PURE__ */ (0,
|
|
27547
|
-
/* @__PURE__ */ (0,
|
|
27722
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-error-100", children: [
|
|
27723
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27548
27724
|
Text_default,
|
|
27549
27725
|
{
|
|
27550
27726
|
as: "span",
|
|
27551
27727
|
className: "size-8 rounded-full flex items-center justify-center bg-error-300 mb-2",
|
|
27552
|
-
children: /* @__PURE__ */ (0,
|
|
27728
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_react86.WarningIcon, { size: 18, weight: "fill", className: "text-error-700" })
|
|
27553
27729
|
}
|
|
27554
27730
|
),
|
|
27555
|
-
/* @__PURE__ */ (0,
|
|
27731
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27556
27732
|
Text_default,
|
|
27557
27733
|
{
|
|
27558
27734
|
size: "2xs",
|
|
@@ -27561,7 +27737,7 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27561
27737
|
children: labels.hardestTopicLabel
|
|
27562
27738
|
}
|
|
27563
27739
|
),
|
|
27564
|
-
/* @__PURE__ */ (0,
|
|
27740
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27565
27741
|
Text_default,
|
|
27566
27742
|
{
|
|
27567
27743
|
size: "xl",
|
|
@@ -27576,9 +27752,9 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27576
27752
|
};
|
|
27577
27753
|
|
|
27578
27754
|
// src/components/RecommendedLessonDetails/components/StudentsTable.tsx
|
|
27579
|
-
var
|
|
27580
|
-
var
|
|
27581
|
-
var
|
|
27755
|
+
var import_react87 = require("react");
|
|
27756
|
+
var import_react88 = require("@phosphor-icons/react");
|
|
27757
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
27582
27758
|
var StudentsTable = ({
|
|
27583
27759
|
students,
|
|
27584
27760
|
onViewPerformance,
|
|
@@ -27586,12 +27762,12 @@ var StudentsTable = ({
|
|
|
27586
27762
|
emptyMessage = "Nenhum aluno encontrado"
|
|
27587
27763
|
}) => {
|
|
27588
27764
|
const { sortedData, sortColumn, sortDirection, handleSort } = useTableSort(students);
|
|
27589
|
-
const canViewPerformance = (0,
|
|
27765
|
+
const canViewPerformance = (0, import_react87.useCallback)((student) => {
|
|
27590
27766
|
return student.status === "CONCLU\xCDDO" /* CONCLUIDO */ || student.status === "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
|
|
27591
27767
|
}, []);
|
|
27592
|
-
return /* @__PURE__ */ (0,
|
|
27593
|
-
/* @__PURE__ */ (0,
|
|
27594
|
-
/* @__PURE__ */ (0,
|
|
27768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { className: "bg-background rounded-xl border border-border-50 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(Table_default, { children: [
|
|
27769
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(TableRow, { children: [
|
|
27770
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27595
27771
|
TableHead,
|
|
27596
27772
|
{
|
|
27597
27773
|
sortable: true,
|
|
@@ -27600,7 +27776,7 @@ var StudentsTable = ({
|
|
|
27600
27776
|
children: labels.studentColumn
|
|
27601
27777
|
}
|
|
27602
27778
|
),
|
|
27603
|
-
/* @__PURE__ */ (0,
|
|
27779
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27604
27780
|
TableHead,
|
|
27605
27781
|
{
|
|
27606
27782
|
sortable: true,
|
|
@@ -27609,7 +27785,7 @@ var StudentsTable = ({
|
|
|
27609
27785
|
children: labels.statusColumn
|
|
27610
27786
|
}
|
|
27611
27787
|
),
|
|
27612
|
-
/* @__PURE__ */ (0,
|
|
27788
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27613
27789
|
TableHead,
|
|
27614
27790
|
{
|
|
27615
27791
|
sortable: true,
|
|
@@ -27618,22 +27794,22 @@ var StudentsTable = ({
|
|
|
27618
27794
|
children: labels.completionColumn
|
|
27619
27795
|
}
|
|
27620
27796
|
),
|
|
27621
|
-
/* @__PURE__ */ (0,
|
|
27622
|
-
/* @__PURE__ */ (0,
|
|
27797
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableHead, { children: labels.durationColumn }),
|
|
27798
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableHead, { className: "w-[140px]" })
|
|
27623
27799
|
] }) }),
|
|
27624
|
-
/* @__PURE__ */ (0,
|
|
27625
|
-
/* @__PURE__ */ (0,
|
|
27626
|
-
/* @__PURE__ */ (0,
|
|
27800
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableBody, { children: sortedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableCell, { colSpan: 5, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Text_default, { size: "sm", className: "text-text-500", children: emptyMessage }) }) }) : sortedData.map((student) => /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(TableRow, { children: [
|
|
27801
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
27802
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27627
27803
|
Text_default,
|
|
27628
27804
|
{
|
|
27629
27805
|
as: "span",
|
|
27630
27806
|
className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
|
|
27631
|
-
children: /* @__PURE__ */ (0,
|
|
27807
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_react88.UserIcon, { size: 16, className: "text-text-500" })
|
|
27632
27808
|
}
|
|
27633
27809
|
),
|
|
27634
|
-
/* @__PURE__ */ (0,
|
|
27810
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Text_default, { size: "sm", className: "text-text-950", children: student.name })
|
|
27635
27811
|
] }) }),
|
|
27636
|
-
/* @__PURE__ */ (0,
|
|
27812
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27637
27813
|
Badge_default,
|
|
27638
27814
|
{
|
|
27639
27815
|
variant: "solid",
|
|
@@ -27642,12 +27818,12 @@ var StudentsTable = ({
|
|
|
27642
27818
|
children: student.status
|
|
27643
27819
|
}
|
|
27644
27820
|
) }),
|
|
27645
|
-
/* @__PURE__ */ (0,
|
|
27646
|
-
/* @__PURE__ */ (0,
|
|
27821
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "flex flex-col gap-1 min-w-[120px]", children: [
|
|
27822
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(Text_default, { size: "sm", className: "text-primary-700 font-medium", children: [
|
|
27647
27823
|
student.completionPercentage,
|
|
27648
27824
|
"%"
|
|
27649
27825
|
] }),
|
|
27650
|
-
/* @__PURE__ */ (0,
|
|
27826
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27651
27827
|
ProgressBar_default,
|
|
27652
27828
|
{
|
|
27653
27829
|
value: student.completionPercentage,
|
|
@@ -27657,8 +27833,8 @@ var StudentsTable = ({
|
|
|
27657
27833
|
}
|
|
27658
27834
|
)
|
|
27659
27835
|
] }) }),
|
|
27660
|
-
/* @__PURE__ */ (0,
|
|
27661
|
-
/* @__PURE__ */ (0,
|
|
27836
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Text_default, { size: "sm", className: "text-text-700", children: student.duration ?? "-" }) }),
|
|
27837
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableCell, { children: canViewPerformance(student) ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27662
27838
|
Button_default,
|
|
27663
27839
|
{
|
|
27664
27840
|
variant: "outline",
|
|
@@ -27666,14 +27842,14 @@ var StudentsTable = ({
|
|
|
27666
27842
|
onClick: () => onViewPerformance?.(student.id),
|
|
27667
27843
|
children: labels.viewPerformance
|
|
27668
27844
|
}
|
|
27669
|
-
) : /* @__PURE__ */ (0,
|
|
27845
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Button_default, { variant: "outline", size: "extra-small", disabled: true, children: labels.viewPerformance }) })
|
|
27670
27846
|
] }, student.id)) })
|
|
27671
27847
|
] }) });
|
|
27672
27848
|
};
|
|
27673
27849
|
|
|
27674
27850
|
// src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
|
|
27675
|
-
var
|
|
27676
|
-
var
|
|
27851
|
+
var import_react89 = require("react");
|
|
27852
|
+
var import_react90 = require("@phosphor-icons/react");
|
|
27677
27853
|
|
|
27678
27854
|
// src/components/RecommendedLessonDetails/types.ts
|
|
27679
27855
|
var DEFAULT_LABELS = {
|
|
@@ -27698,7 +27874,7 @@ var DEFAULT_PERFORMANCE_LABELS = {
|
|
|
27698
27874
|
};
|
|
27699
27875
|
|
|
27700
27876
|
// src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
|
|
27701
|
-
var
|
|
27877
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
27702
27878
|
var PerformanceCard = ({
|
|
27703
27879
|
icon,
|
|
27704
27880
|
label,
|
|
@@ -27723,13 +27899,13 @@ var PerformanceCard = ({
|
|
|
27723
27899
|
success: "text-success-600",
|
|
27724
27900
|
error: "text-error-600"
|
|
27725
27901
|
}[variant];
|
|
27726
|
-
return /* @__PURE__ */ (0,
|
|
27727
|
-
/* @__PURE__ */ (0,
|
|
27902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col rounded-xl border border-border-50 bg-background overflow-hidden", children: [
|
|
27903
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
27728
27904
|
"div",
|
|
27729
27905
|
{
|
|
27730
27906
|
className: `flex flex-col items-center justify-center p-4 gap-1 ${headerBgColor}`,
|
|
27731
27907
|
children: [
|
|
27732
|
-
/* @__PURE__ */ (0,
|
|
27908
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27733
27909
|
Text_default,
|
|
27734
27910
|
{
|
|
27735
27911
|
as: "span",
|
|
@@ -27737,7 +27913,7 @@ var PerformanceCard = ({
|
|
|
27737
27913
|
children: icon
|
|
27738
27914
|
}
|
|
27739
27915
|
),
|
|
27740
|
-
/* @__PURE__ */ (0,
|
|
27916
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27741
27917
|
Text_default,
|
|
27742
27918
|
{
|
|
27743
27919
|
size: "2xs",
|
|
@@ -27746,12 +27922,12 @@ var PerformanceCard = ({
|
|
|
27746
27922
|
children: label
|
|
27747
27923
|
}
|
|
27748
27924
|
),
|
|
27749
|
-
/* @__PURE__ */ (0,
|
|
27925
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "xl", weight: "bold", className: `${valueColor} text-center`, children: value })
|
|
27750
27926
|
]
|
|
27751
27927
|
}
|
|
27752
27928
|
),
|
|
27753
|
-
/* @__PURE__ */ (0,
|
|
27754
|
-
/* @__PURE__ */ (0,
|
|
27929
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col items-center gap-2 px-4 py-3", children: [
|
|
27930
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27755
27931
|
Text_default,
|
|
27756
27932
|
{
|
|
27757
27933
|
size: "2xs",
|
|
@@ -27760,7 +27936,7 @@ var PerformanceCard = ({
|
|
|
27760
27936
|
children: secondaryLabel
|
|
27761
27937
|
}
|
|
27762
27938
|
),
|
|
27763
|
-
/* @__PURE__ */ (0,
|
|
27939
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Badge_default, { size: "large", action: "info", children: secondaryValue || "-" })
|
|
27764
27940
|
] })
|
|
27765
27941
|
] });
|
|
27766
27942
|
};
|
|
@@ -27787,40 +27963,40 @@ var getSelectedValue = (question) => {
|
|
|
27787
27963
|
var QuestionAccordionItem = ({
|
|
27788
27964
|
question,
|
|
27789
27965
|
index
|
|
27790
|
-
}) => /* @__PURE__ */ (0,
|
|
27966
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27791
27967
|
CardAccordation,
|
|
27792
27968
|
{
|
|
27793
27969
|
value: question.id,
|
|
27794
27970
|
className: "bg-background rounded-xl border border-border-50",
|
|
27795
27971
|
triggerClassName: "py-5 px-5",
|
|
27796
27972
|
contentClassName: "px-5 pb-5",
|
|
27797
|
-
trigger: /* @__PURE__ */ (0,
|
|
27798
|
-
/* @__PURE__ */ (0,
|
|
27973
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex items-center justify-between flex-1", children: [
|
|
27974
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: [
|
|
27799
27975
|
"Quest\xE3o ",
|
|
27800
27976
|
index + 1
|
|
27801
27977
|
] }),
|
|
27802
|
-
/* @__PURE__ */ (0,
|
|
27978
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27803
27979
|
Badge_default,
|
|
27804
27980
|
{
|
|
27805
27981
|
size: "small",
|
|
27806
27982
|
action: question.isCorrect ? "success" : "error",
|
|
27807
27983
|
variant: "solid",
|
|
27808
|
-
iconLeft: question.isCorrect ? /* @__PURE__ */ (0,
|
|
27984
|
+
iconLeft: question.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_react90.CheckCircleIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_react90.XCircleIcon, {}),
|
|
27809
27985
|
children: question.isCorrect ? "Correta" : "Incorreta"
|
|
27810
27986
|
}
|
|
27811
27987
|
)
|
|
27812
27988
|
] }),
|
|
27813
|
-
children: /* @__PURE__ */ (0,
|
|
27814
|
-
/* @__PURE__ */ (0,
|
|
27815
|
-
/* @__PURE__ */ (0,
|
|
27989
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
27990
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "sm", className: "text-text-700", children: question.statement }),
|
|
27991
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27816
27992
|
CardAccordation,
|
|
27817
27993
|
{
|
|
27818
27994
|
value: `${question.id}-alternatives`,
|
|
27819
27995
|
className: "bg-background rounded-lg border border-border-50",
|
|
27820
27996
|
triggerClassName: "py-5 px-5",
|
|
27821
27997
|
contentClassName: "px-5 py-5",
|
|
27822
|
-
trigger: /* @__PURE__ */ (0,
|
|
27823
|
-
children: /* @__PURE__ */ (0,
|
|
27998
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "sm", weight: "medium", className: "text-text-800", children: "Alternativas" }),
|
|
27999
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27824
28000
|
AlternativesList,
|
|
27825
28001
|
{
|
|
27826
28002
|
mode: "readonly",
|
|
@@ -27834,16 +28010,16 @@ var QuestionAccordionItem = ({
|
|
|
27834
28010
|
] })
|
|
27835
28011
|
}
|
|
27836
28012
|
);
|
|
27837
|
-
var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0,
|
|
28013
|
+
var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27838
28014
|
CardAccordation,
|
|
27839
28015
|
{
|
|
27840
28016
|
value: lesson.id,
|
|
27841
28017
|
className: "bg-background rounded-xl border border-border-50",
|
|
27842
28018
|
triggerClassName: "py-5 px-5",
|
|
27843
28019
|
contentClassName: "px-5 pb-5",
|
|
27844
|
-
trigger: /* @__PURE__ */ (0,
|
|
27845
|
-
/* @__PURE__ */ (0,
|
|
27846
|
-
/* @__PURE__ */ (0,
|
|
28020
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-1 flex-1", children: [
|
|
28021
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: lesson.title }),
|
|
28022
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27847
28023
|
ProgressBar_default,
|
|
27848
28024
|
{
|
|
27849
28025
|
value: lesson.progress,
|
|
@@ -27854,7 +28030,7 @@ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0, import_jsx_runtime
|
|
|
27854
28030
|
}
|
|
27855
28031
|
)
|
|
27856
28032
|
] }),
|
|
27857
|
-
children: /* @__PURE__ */ (0,
|
|
28033
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex flex-col gap-2", children: lesson.questions.map((question, index) => /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27858
28034
|
QuestionAccordionItem,
|
|
27859
28035
|
{
|
|
27860
28036
|
question,
|
|
@@ -27864,45 +28040,45 @@ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0, import_jsx_runtime
|
|
|
27864
28040
|
)) })
|
|
27865
28041
|
}
|
|
27866
28042
|
);
|
|
27867
|
-
var LoadingSkeleton2 = () => /* @__PURE__ */ (0,
|
|
27868
|
-
/* @__PURE__ */ (0,
|
|
27869
|
-
/* @__PURE__ */ (0,
|
|
27870
|
-
/* @__PURE__ */ (0,
|
|
27871
|
-
/* @__PURE__ */ (0,
|
|
28043
|
+
var LoadingSkeleton2 = () => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-4 animate-pulse", children: [
|
|
28044
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "h-6 bg-background-200 rounded w-48" }),
|
|
28045
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
28046
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "h-44 bg-background-200 rounded-xl" }),
|
|
28047
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "h-44 bg-background-200 rounded-xl" })
|
|
27872
28048
|
] })
|
|
27873
28049
|
] });
|
|
27874
|
-
var ErrorContent = ({ message }) => /* @__PURE__ */ (0,
|
|
27875
|
-
/* @__PURE__ */ (0,
|
|
28050
|
+
var ErrorContent = ({ message }) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col items-center justify-center py-8 gap-3", children: [
|
|
28051
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27876
28052
|
Text_default,
|
|
27877
28053
|
{
|
|
27878
28054
|
as: "span",
|
|
27879
28055
|
className: "size-12 rounded-full bg-error-100 flex items-center justify-center",
|
|
27880
|
-
children: /* @__PURE__ */ (0,
|
|
28056
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_react90.WarningCircleIcon, { size: 24, className: "text-error-700" })
|
|
27881
28057
|
}
|
|
27882
28058
|
),
|
|
27883
|
-
/* @__PURE__ */ (0,
|
|
28059
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "md", className: "text-error-700 text-center", children: message })
|
|
27884
28060
|
] });
|
|
27885
28061
|
var PerformanceContent = ({
|
|
27886
28062
|
data,
|
|
27887
28063
|
labels
|
|
27888
|
-
}) => /* @__PURE__ */ (0,
|
|
27889
|
-
/* @__PURE__ */ (0,
|
|
27890
|
-
/* @__PURE__ */ (0,
|
|
28064
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-5", children: [
|
|
28065
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
28066
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27891
28067
|
Text_default,
|
|
27892
28068
|
{
|
|
27893
28069
|
as: "span",
|
|
27894
28070
|
className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
|
|
27895
|
-
children: /* @__PURE__ */ (0,
|
|
28071
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_react90.UserIcon, { size: 16, className: "text-text-500" })
|
|
27896
28072
|
}
|
|
27897
28073
|
),
|
|
27898
|
-
/* @__PURE__ */ (0,
|
|
28074
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "md", weight: "medium", className: "text-text-950", children: data.studentName })
|
|
27899
28075
|
] }),
|
|
27900
|
-
/* @__PURE__ */ (0,
|
|
27901
|
-
/* @__PURE__ */ (0,
|
|
28076
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
28077
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27902
28078
|
PerformanceCard,
|
|
27903
28079
|
{
|
|
27904
|
-
icon: /* @__PURE__ */ (0,
|
|
27905
|
-
|
|
28080
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
28081
|
+
import_react90.LightbulbFilamentIcon,
|
|
27906
28082
|
{
|
|
27907
28083
|
size: 18,
|
|
27908
28084
|
weight: "fill",
|
|
@@ -27916,11 +28092,11 @@ var PerformanceContent = ({
|
|
|
27916
28092
|
variant: "success"
|
|
27917
28093
|
}
|
|
27918
28094
|
),
|
|
27919
|
-
/* @__PURE__ */ (0,
|
|
28095
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27920
28096
|
PerformanceCard,
|
|
27921
28097
|
{
|
|
27922
|
-
icon: /* @__PURE__ */ (0,
|
|
27923
|
-
|
|
28098
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
28099
|
+
import_react90.WarningCircleIcon,
|
|
27924
28100
|
{
|
|
27925
28101
|
size: 18,
|
|
27926
28102
|
weight: "fill",
|
|
@@ -27935,20 +28111,20 @@ var PerformanceContent = ({
|
|
|
27935
28111
|
}
|
|
27936
28112
|
)
|
|
27937
28113
|
] }),
|
|
27938
|
-
data.lessons.length > 0 && /* @__PURE__ */ (0,
|
|
27939
|
-
/* @__PURE__ */ (0,
|
|
27940
|
-
/* @__PURE__ */ (0,
|
|
28114
|
+
data.lessons.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
28115
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "md", weight: "semibold", className: "text-text-950", children: labels.lessonsTitle }),
|
|
28116
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex flex-col gap-2", children: data.lessons.map((lesson) => /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(LessonAccordionItem, { lesson }, lesson.id)) })
|
|
27941
28117
|
] })
|
|
27942
28118
|
] });
|
|
27943
28119
|
var renderModalContent = (loading, error, data, labels) => {
|
|
27944
28120
|
if (loading) {
|
|
27945
|
-
return /* @__PURE__ */ (0,
|
|
28121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(LoadingSkeleton2, {});
|
|
27946
28122
|
}
|
|
27947
28123
|
if (error) {
|
|
27948
|
-
return /* @__PURE__ */ (0,
|
|
28124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(ErrorContent, { message: error });
|
|
27949
28125
|
}
|
|
27950
28126
|
if (data) {
|
|
27951
|
-
return /* @__PURE__ */ (0,
|
|
28127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(PerformanceContent, { data, labels });
|
|
27952
28128
|
}
|
|
27953
28129
|
return null;
|
|
27954
28130
|
};
|
|
@@ -27960,14 +28136,14 @@ var StudentPerformanceModal = ({
|
|
|
27960
28136
|
error = null,
|
|
27961
28137
|
labels: customLabels
|
|
27962
28138
|
}) => {
|
|
27963
|
-
const labels = (0,
|
|
28139
|
+
const labels = (0, import_react89.useMemo)(
|
|
27964
28140
|
() => ({ ...DEFAULT_PERFORMANCE_LABELS, ...customLabels }),
|
|
27965
28141
|
[customLabels]
|
|
27966
28142
|
);
|
|
27967
28143
|
if (!data && !loading && !error) {
|
|
27968
28144
|
return null;
|
|
27969
28145
|
}
|
|
27970
|
-
return /* @__PURE__ */ (0,
|
|
28146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27971
28147
|
Modal_default,
|
|
27972
28148
|
{
|
|
27973
28149
|
isOpen,
|
|
@@ -27981,7 +28157,7 @@ var StudentPerformanceModal = ({
|
|
|
27981
28157
|
};
|
|
27982
28158
|
|
|
27983
28159
|
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
27984
|
-
var
|
|
28160
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
27985
28161
|
var RecommendedLessonDetails = ({
|
|
27986
28162
|
goalId,
|
|
27987
28163
|
data,
|
|
@@ -27995,15 +28171,15 @@ var RecommendedLessonDetails = ({
|
|
|
27995
28171
|
labels: customLabels,
|
|
27996
28172
|
className
|
|
27997
28173
|
}) => {
|
|
27998
|
-
const labels = (0,
|
|
28174
|
+
const labels = (0, import_react91.useMemo)(
|
|
27999
28175
|
() => ({ ...DEFAULT_LABELS, ...customLabels }),
|
|
28000
28176
|
[customLabels]
|
|
28001
28177
|
);
|
|
28002
|
-
const [performanceModalOpen, setPerformanceModalOpen] = (0,
|
|
28003
|
-
const [performanceData, setPerformanceData] = (0,
|
|
28004
|
-
const [performanceLoading, setPerformanceLoading] = (0,
|
|
28005
|
-
const [performanceError, setPerformanceError] = (0,
|
|
28006
|
-
const handleViewStudentPerformance = (0,
|
|
28178
|
+
const [performanceModalOpen, setPerformanceModalOpen] = (0, import_react91.useState)(false);
|
|
28179
|
+
const [performanceData, setPerformanceData] = (0, import_react91.useState)(null);
|
|
28180
|
+
const [performanceLoading, setPerformanceLoading] = (0, import_react91.useState)(false);
|
|
28181
|
+
const [performanceError, setPerformanceError] = (0, import_react91.useState)(null);
|
|
28182
|
+
const handleViewStudentPerformance = (0, import_react91.useCallback)(
|
|
28007
28183
|
async (studentId) => {
|
|
28008
28184
|
if (!fetchStudentPerformance || !goalId) return;
|
|
28009
28185
|
setPerformanceModalOpen(true);
|
|
@@ -28024,12 +28200,12 @@ var RecommendedLessonDetails = ({
|
|
|
28024
28200
|
},
|
|
28025
28201
|
[fetchStudentPerformance, goalId]
|
|
28026
28202
|
);
|
|
28027
|
-
const handleClosePerformanceModal = (0,
|
|
28203
|
+
const handleClosePerformanceModal = (0, import_react91.useCallback)(() => {
|
|
28028
28204
|
setPerformanceModalOpen(false);
|
|
28029
28205
|
setPerformanceData(null);
|
|
28030
28206
|
setPerformanceError(null);
|
|
28031
28207
|
}, []);
|
|
28032
|
-
const defaultBreadcrumbs = (0,
|
|
28208
|
+
const defaultBreadcrumbs = (0, import_react91.useMemo)(
|
|
28033
28209
|
() => [
|
|
28034
28210
|
{ label: "Aulas recomendadas", path: "/aulas-recomendadas" },
|
|
28035
28211
|
{ label: data?.goal.title || "Detalhes" }
|
|
@@ -28037,7 +28213,7 @@ var RecommendedLessonDetails = ({
|
|
|
28037
28213
|
[data?.goal.title]
|
|
28038
28214
|
);
|
|
28039
28215
|
const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
|
|
28040
|
-
const displayStudents = (0,
|
|
28216
|
+
const displayStudents = (0, import_react91.useMemo)(() => {
|
|
28041
28217
|
if (!data?.details.students) return [];
|
|
28042
28218
|
const deadline = data?.goal.finalDate;
|
|
28043
28219
|
return data.details.students.map(
|
|
@@ -28045,17 +28221,17 @@ var RecommendedLessonDetails = ({
|
|
|
28045
28221
|
);
|
|
28046
28222
|
}, [data?.details.students, data?.goal.finalDate]);
|
|
28047
28223
|
if (loading) {
|
|
28048
|
-
return /* @__PURE__ */ (0,
|
|
28224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28049
28225
|
"div",
|
|
28050
28226
|
{
|
|
28051
28227
|
className: cn("flex flex-col gap-6", className),
|
|
28052
28228
|
"data-testid": "lesson-details-loading",
|
|
28053
|
-
children: /* @__PURE__ */ (0,
|
|
28229
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LoadingSkeleton, {})
|
|
28054
28230
|
}
|
|
28055
28231
|
);
|
|
28056
28232
|
}
|
|
28057
28233
|
if (error) {
|
|
28058
|
-
return /* @__PURE__ */ (0,
|
|
28234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28059
28235
|
"div",
|
|
28060
28236
|
{
|
|
28061
28237
|
className: cn(
|
|
@@ -28063,22 +28239,22 @@ var RecommendedLessonDetails = ({
|
|
|
28063
28239
|
className
|
|
28064
28240
|
),
|
|
28065
28241
|
"data-testid": "lesson-details-error",
|
|
28066
|
-
children: /* @__PURE__ */ (0,
|
|
28242
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Text_default, { size: "md", className: "text-error-700", children: error })
|
|
28067
28243
|
}
|
|
28068
28244
|
);
|
|
28069
28245
|
}
|
|
28070
28246
|
if (!data) {
|
|
28071
28247
|
return null;
|
|
28072
28248
|
}
|
|
28073
|
-
return /* @__PURE__ */ (0,
|
|
28074
|
-
/* @__PURE__ */ (0,
|
|
28249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
|
|
28250
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
28075
28251
|
"div",
|
|
28076
28252
|
{
|
|
28077
28253
|
className: cn("flex flex-col gap-6", className),
|
|
28078
28254
|
"data-testid": "recommended-lesson-details",
|
|
28079
28255
|
children: [
|
|
28080
|
-
/* @__PURE__ */ (0,
|
|
28081
|
-
/* @__PURE__ */ (0,
|
|
28256
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
|
|
28257
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28082
28258
|
LessonHeader,
|
|
28083
28259
|
{
|
|
28084
28260
|
data,
|
|
@@ -28087,8 +28263,8 @@ var RecommendedLessonDetails = ({
|
|
|
28087
28263
|
viewLessonLabel: labels.viewLesson
|
|
28088
28264
|
}
|
|
28089
28265
|
),
|
|
28090
|
-
/* @__PURE__ */ (0,
|
|
28091
|
-
/* @__PURE__ */ (0,
|
|
28266
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ResultsSection, { data, labels }),
|
|
28267
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28092
28268
|
StudentsTable,
|
|
28093
28269
|
{
|
|
28094
28270
|
students: displayStudents,
|
|
@@ -28099,7 +28275,7 @@ var RecommendedLessonDetails = ({
|
|
|
28099
28275
|
]
|
|
28100
28276
|
}
|
|
28101
28277
|
),
|
|
28102
|
-
fetchStudentPerformance && /* @__PURE__ */ (0,
|
|
28278
|
+
fetchStudentPerformance && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28103
28279
|
StudentPerformanceModal,
|
|
28104
28280
|
{
|
|
28105
28281
|
isOpen: performanceModalOpen,
|
|
@@ -28114,7 +28290,7 @@ var RecommendedLessonDetails = ({
|
|
|
28114
28290
|
var RecommendedLessonDetails_default = RecommendedLessonDetails;
|
|
28115
28291
|
|
|
28116
28292
|
// src/hooks/useRecommendedLessonsPage.ts
|
|
28117
|
-
var
|
|
28293
|
+
var import_react92 = require("react");
|
|
28118
28294
|
var buildQueryParams2 = (filters) => {
|
|
28119
28295
|
if (!filters) return {};
|
|
28120
28296
|
const params = {};
|
|
@@ -28148,7 +28324,7 @@ var getClassOptions2 = (userData) => {
|
|
|
28148
28324
|
});
|
|
28149
28325
|
return Array.from(classMap.entries()).map(([id, name]) => ({ id, name }));
|
|
28150
28326
|
};
|
|
28151
|
-
var
|
|
28327
|
+
var getSubjectOptions4 = (userData) => {
|
|
28152
28328
|
if (!userData?.subTeacherTopicClasses) return [];
|
|
28153
28329
|
const subjectMap = /* @__PURE__ */ new Map();
|
|
28154
28330
|
userData.subTeacherTopicClasses.forEach((stc) => {
|
|
@@ -28171,26 +28347,26 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28171
28347
|
mapSubjectNameToEnum: mapSubjectNameToEnum2
|
|
28172
28348
|
} = config;
|
|
28173
28349
|
return () => {
|
|
28174
|
-
const goalsMapRef = (0,
|
|
28175
|
-
const [sendModalOpen, setSendModalOpen] = (0,
|
|
28176
|
-
const [selectedModel, setSelectedModel] = (0,
|
|
28177
|
-
const [sendModalLoading, setSendModalLoading] = (0,
|
|
28178
|
-
const [sendModalCategories, setSendModalCategories] = (0,
|
|
28179
|
-
const userFilterData = (0,
|
|
28350
|
+
const goalsMapRef = (0, import_react92.useRef)(/* @__PURE__ */ new Map());
|
|
28351
|
+
const [sendModalOpen, setSendModalOpen] = (0, import_react92.useState)(false);
|
|
28352
|
+
const [selectedModel, setSelectedModel] = (0, import_react92.useState)(null);
|
|
28353
|
+
const [sendModalLoading, setSendModalLoading] = (0, import_react92.useState)(false);
|
|
28354
|
+
const [sendModalCategories, setSendModalCategories] = (0, import_react92.useState)([]);
|
|
28355
|
+
const userFilterData = (0, import_react92.useMemo)(
|
|
28180
28356
|
() => ({
|
|
28181
28357
|
schools: getSchoolOptions2(userData),
|
|
28182
28358
|
classes: getClassOptions2(userData),
|
|
28183
|
-
subjects:
|
|
28359
|
+
subjects: getSubjectOptions4(userData)
|
|
28184
28360
|
}),
|
|
28185
28361
|
[userData]
|
|
28186
28362
|
);
|
|
28187
|
-
const subjectsMap = (0,
|
|
28363
|
+
const subjectsMap = (0, import_react92.useMemo)(() => {
|
|
28188
28364
|
const map = /* @__PURE__ */ new Map();
|
|
28189
|
-
const subjects =
|
|
28365
|
+
const subjects = getSubjectOptions4(userData);
|
|
28190
28366
|
subjects.forEach((s) => map.set(s.id, s.name));
|
|
28191
28367
|
return map;
|
|
28192
28368
|
}, [userData]);
|
|
28193
|
-
const fetchGoalsHistory = (0,
|
|
28369
|
+
const fetchGoalsHistory = (0, import_react92.useCallback)(
|
|
28194
28370
|
async (filters) => {
|
|
28195
28371
|
const params = buildQueryParams2(filters);
|
|
28196
28372
|
const response = await api.get(
|
|
@@ -28205,7 +28381,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28205
28381
|
},
|
|
28206
28382
|
[api, endpoints.goalsHistory]
|
|
28207
28383
|
);
|
|
28208
|
-
const fetchGoalModels = (0,
|
|
28384
|
+
const fetchGoalModels = (0, import_react92.useCallback)(
|
|
28209
28385
|
async (filters) => {
|
|
28210
28386
|
const params = buildQueryParams2({
|
|
28211
28387
|
...filters,
|
|
@@ -28219,31 +28395,51 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28219
28395
|
},
|
|
28220
28396
|
[api, endpoints.goalDrafts]
|
|
28221
28397
|
);
|
|
28222
|
-
const deleteGoalModel = (0,
|
|
28398
|
+
const deleteGoalModel = (0, import_react92.useCallback)(
|
|
28223
28399
|
async (id) => {
|
|
28224
28400
|
await api.delete(`${endpoints.goalDrafts}/${id}`);
|
|
28225
28401
|
},
|
|
28226
28402
|
[api, endpoints.goalDrafts]
|
|
28227
28403
|
);
|
|
28228
|
-
const
|
|
28404
|
+
const fetchGoalDrafts = (0, import_react92.useCallback)(
|
|
28405
|
+
async (filters) => {
|
|
28406
|
+
const params = buildQueryParams2({
|
|
28407
|
+
...filters,
|
|
28408
|
+
type: "RASCUNHO" /* RASCUNHO */
|
|
28409
|
+
});
|
|
28410
|
+
const response = await api.get(
|
|
28411
|
+
endpoints.goalDrafts,
|
|
28412
|
+
{ params }
|
|
28413
|
+
);
|
|
28414
|
+
return response.data;
|
|
28415
|
+
},
|
|
28416
|
+
[api, endpoints.goalDrafts]
|
|
28417
|
+
);
|
|
28418
|
+
const deleteGoalDraft = (0, import_react92.useCallback)(
|
|
28419
|
+
async (id) => {
|
|
28420
|
+
await api.delete(`${endpoints.goalDrafts}/${id}`);
|
|
28421
|
+
},
|
|
28422
|
+
[api, endpoints.goalDrafts]
|
|
28423
|
+
);
|
|
28424
|
+
const handleCreateLesson = (0, import_react92.useCallback)(() => {
|
|
28229
28425
|
navigate(paths.createLesson);
|
|
28230
28426
|
}, []);
|
|
28231
|
-
const handleCreateModel = (0,
|
|
28427
|
+
const handleCreateModel = (0, import_react92.useCallback)(() => {
|
|
28232
28428
|
navigate(paths.createModel);
|
|
28233
28429
|
}, []);
|
|
28234
|
-
const handleRowClick = (0,
|
|
28430
|
+
const handleRowClick = (0, import_react92.useCallback)((row) => {
|
|
28235
28431
|
const originalData = goalsMapRef.current.get(row.id);
|
|
28236
28432
|
navigate(`${paths.lessonDetails}/${row.id}`, {
|
|
28237
28433
|
state: { goalData: originalData }
|
|
28238
28434
|
});
|
|
28239
28435
|
}, []);
|
|
28240
|
-
const handleEditGoal = (0,
|
|
28436
|
+
const handleEditGoal = (0, import_react92.useCallback)((id) => {
|
|
28241
28437
|
navigate(`${paths.editLesson}/${id}/editar`);
|
|
28242
28438
|
}, []);
|
|
28243
|
-
const handleEditModel = (0,
|
|
28439
|
+
const handleEditModel = (0, import_react92.useCallback)((model) => {
|
|
28244
28440
|
navigate(`${paths.editModel}${model.id}`);
|
|
28245
28441
|
}, []);
|
|
28246
|
-
const handleSendLesson = (0,
|
|
28442
|
+
const handleSendLesson = (0, import_react92.useCallback)(
|
|
28247
28443
|
(model) => {
|
|
28248
28444
|
setSelectedModel(model);
|
|
28249
28445
|
const classes = getClassOptions2(userData);
|
|
@@ -28266,7 +28462,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28266
28462
|
},
|
|
28267
28463
|
[userData]
|
|
28268
28464
|
);
|
|
28269
|
-
const handleSendLessonSubmit = (0,
|
|
28465
|
+
const handleSendLessonSubmit = (0, import_react92.useCallback)(
|
|
28270
28466
|
async (formData) => {
|
|
28271
28467
|
if (!selectedModel) return;
|
|
28272
28468
|
setSendModalLoading(true);
|
|
@@ -28285,11 +28481,11 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28285
28481
|
},
|
|
28286
28482
|
[api, endpoints.submitGoal, selectedModel]
|
|
28287
28483
|
);
|
|
28288
|
-
const handleSendModalClose = (0,
|
|
28484
|
+
const handleSendModalClose = (0, import_react92.useCallback)(() => {
|
|
28289
28485
|
setSendModalOpen(false);
|
|
28290
28486
|
setSelectedModel(null);
|
|
28291
28487
|
}, []);
|
|
28292
|
-
const handleCategoriesChange = (0,
|
|
28488
|
+
const handleCategoriesChange = (0, import_react92.useCallback)(
|
|
28293
28489
|
(categories) => {
|
|
28294
28490
|
setSendModalCategories(categories);
|
|
28295
28491
|
},
|
|
@@ -28306,6 +28502,10 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28306
28502
|
onEditGoal: handleEditGoal,
|
|
28307
28503
|
onEditModel: handleEditModel,
|
|
28308
28504
|
onSendLesson: handleSendLesson,
|
|
28505
|
+
fetchGoalDrafts,
|
|
28506
|
+
deleteGoalDraft,
|
|
28507
|
+
onSendDraft: handleSendLesson,
|
|
28508
|
+
onEditDraft: handleEditModel,
|
|
28309
28509
|
emptyStateImage,
|
|
28310
28510
|
noSearchImage,
|
|
28311
28511
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
@@ -28331,7 +28531,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28331
28531
|
var createRecommendedLessonsPageHook = createUseRecommendedLessonsPage;
|
|
28332
28532
|
|
|
28333
28533
|
// src/hooks/useRecommendedLessonDetails.ts
|
|
28334
|
-
var
|
|
28534
|
+
var import_react93 = require("react");
|
|
28335
28535
|
var import_zod8 = require("zod");
|
|
28336
28536
|
var goalLessonSubjectSchema = import_zod8.z.object({
|
|
28337
28537
|
id: import_zod8.z.string(),
|
|
@@ -28434,12 +28634,12 @@ var handleLessonDetailsFetchError = (error) => {
|
|
|
28434
28634
|
};
|
|
28435
28635
|
var createUseRecommendedLessonDetails = (apiClient) => {
|
|
28436
28636
|
return (lessonId) => {
|
|
28437
|
-
const [state, setState] = (0,
|
|
28637
|
+
const [state, setState] = (0, import_react93.useState)({
|
|
28438
28638
|
data: null,
|
|
28439
28639
|
loading: true,
|
|
28440
28640
|
error: null
|
|
28441
28641
|
});
|
|
28442
|
-
const fetchLessonDetails = (0,
|
|
28642
|
+
const fetchLessonDetails = (0, import_react93.useCallback)(async () => {
|
|
28443
28643
|
if (!lessonId) {
|
|
28444
28644
|
setState({
|
|
28445
28645
|
data: null,
|
|
@@ -28485,7 +28685,7 @@ var createUseRecommendedLessonDetails = (apiClient) => {
|
|
|
28485
28685
|
});
|
|
28486
28686
|
}
|
|
28487
28687
|
}, [lessonId]);
|
|
28488
|
-
(0,
|
|
28688
|
+
(0, import_react93.useEffect)(() => {
|
|
28489
28689
|
fetchLessonDetails();
|
|
28490
28690
|
}, [fetchLessonDetails]);
|
|
28491
28691
|
return {
|
|
@@ -28497,20 +28697,20 @@ var createUseRecommendedLessonDetails = (apiClient) => {
|
|
|
28497
28697
|
var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
28498
28698
|
|
|
28499
28699
|
// src/components/ActivitiesHistory/ActivitiesHistory.tsx
|
|
28500
|
-
var
|
|
28700
|
+
var import_react97 = require("react");
|
|
28501
28701
|
|
|
28502
28702
|
// src/components/ActivitiesHistory/tabs/HistoryTab.tsx
|
|
28503
|
-
var
|
|
28703
|
+
var import_react95 = require("react");
|
|
28504
28704
|
var import_phosphor_react54 = require("phosphor-react");
|
|
28505
28705
|
|
|
28506
28706
|
// src/components/ActivitiesHistory/config/historyTableColumns.tsx
|
|
28507
28707
|
var import_phosphor_react53 = require("phosphor-react");
|
|
28508
28708
|
|
|
28509
28709
|
// src/components/ActivitiesHistory/utils/renderTruncatedText.tsx
|
|
28510
|
-
var
|
|
28710
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
28511
28711
|
var renderTruncatedText = (value) => {
|
|
28512
28712
|
const text = typeof value === "string" ? value : "";
|
|
28513
|
-
return /* @__PURE__ */ (0,
|
|
28713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Text_default, { size: "sm", title: text, children: text });
|
|
28514
28714
|
};
|
|
28515
28715
|
|
|
28516
28716
|
// src/components/ActivitiesHistory/utils/filterBuilders.ts
|
|
@@ -28556,7 +28756,7 @@ var getSchoolOptions3 = (data) => {
|
|
|
28556
28756
|
name: school.name
|
|
28557
28757
|
}));
|
|
28558
28758
|
};
|
|
28559
|
-
var
|
|
28759
|
+
var getSubjectOptions5 = (data) => {
|
|
28560
28760
|
if (!data?.subjects) return [];
|
|
28561
28761
|
return data.subjects.map((subject) => ({
|
|
28562
28762
|
id: subject.id,
|
|
@@ -28565,7 +28765,7 @@ var getSubjectOptions4 = (data) => {
|
|
|
28565
28765
|
};
|
|
28566
28766
|
|
|
28567
28767
|
// src/components/ActivitiesHistory/config/historyTableColumns.tsx
|
|
28568
|
-
var
|
|
28768
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
28569
28769
|
var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
28570
28770
|
{
|
|
28571
28771
|
key: "startDate",
|
|
@@ -28618,9 +28818,9 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
|
28618
28818
|
render: (value) => {
|
|
28619
28819
|
const status = typeof value === "string" ? value : "";
|
|
28620
28820
|
if (!status) {
|
|
28621
|
-
return /* @__PURE__ */ (0,
|
|
28821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Text_default, { size: "sm", color: "text-text-500", children: "-" });
|
|
28622
28822
|
}
|
|
28623
|
-
return /* @__PURE__ */ (0,
|
|
28823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
28624
28824
|
Badge_default,
|
|
28625
28825
|
{
|
|
28626
28826
|
variant: "solid",
|
|
@@ -28635,7 +28835,7 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
|
28635
28835
|
key: "completionPercentage",
|
|
28636
28836
|
label: "Conclus\xE3o",
|
|
28637
28837
|
sortable: true,
|
|
28638
|
-
render: (value) => /* @__PURE__ */ (0,
|
|
28838
|
+
render: (value) => /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
28639
28839
|
ProgressBar_default,
|
|
28640
28840
|
{
|
|
28641
28841
|
value: Number(value),
|
|
@@ -28652,7 +28852,7 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
|
28652
28852
|
label: "",
|
|
28653
28853
|
sortable: false,
|
|
28654
28854
|
className: "w-12",
|
|
28655
|
-
render: () => /* @__PURE__ */ (0,
|
|
28855
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_phosphor_react53.CaretRight, { size: 20, className: "text-text-600" }) })
|
|
28656
28856
|
}
|
|
28657
28857
|
];
|
|
28658
28858
|
|
|
@@ -28690,14 +28890,14 @@ var createHistoryFiltersConfig = (userData) => [
|
|
|
28690
28890
|
key: "subject",
|
|
28691
28891
|
label: "Mat\xE9ria",
|
|
28692
28892
|
selectedIds: [],
|
|
28693
|
-
itens:
|
|
28893
|
+
itens: getSubjectOptions5(userData)
|
|
28694
28894
|
}
|
|
28695
28895
|
]
|
|
28696
28896
|
}
|
|
28697
28897
|
];
|
|
28698
28898
|
|
|
28699
28899
|
// src/hooks/useActivitiesHistory.ts
|
|
28700
|
-
var
|
|
28900
|
+
var import_react94 = require("react");
|
|
28701
28901
|
var import_zod9 = require("zod");
|
|
28702
28902
|
var import_dayjs6 = __toESM(require("dayjs"));
|
|
28703
28903
|
var activityHistoryResponseSchema = import_zod9.z.object({
|
|
@@ -28756,13 +28956,13 @@ var handleActivityFetchError = createFetchErrorHandler(
|
|
|
28756
28956
|
);
|
|
28757
28957
|
var createUseActivitiesHistory = (fetchActivitiesHistory) => {
|
|
28758
28958
|
return () => {
|
|
28759
|
-
const [state, setState] = (0,
|
|
28959
|
+
const [state, setState] = (0, import_react94.useState)({
|
|
28760
28960
|
activities: [],
|
|
28761
28961
|
loading: false,
|
|
28762
28962
|
error: null,
|
|
28763
28963
|
pagination: DEFAULT_ACTIVITIES_PAGINATION
|
|
28764
28964
|
});
|
|
28765
|
-
const fetchActivities = (0,
|
|
28965
|
+
const fetchActivities = (0, import_react94.useCallback)(
|
|
28766
28966
|
async (filters) => {
|
|
28767
28967
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
28768
28968
|
try {
|
|
@@ -28797,7 +28997,7 @@ var createUseActivitiesHistory = (fetchActivitiesHistory) => {
|
|
|
28797
28997
|
var createActivitiesHistoryHook = createUseActivitiesHistory;
|
|
28798
28998
|
|
|
28799
28999
|
// src/components/ActivitiesHistory/tabs/HistoryTab.tsx
|
|
28800
|
-
var
|
|
29000
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
28801
29001
|
var HistoryTab = ({
|
|
28802
29002
|
fetchActivitiesHistory,
|
|
28803
29003
|
onCreateActivity,
|
|
@@ -28807,9 +29007,9 @@ var HistoryTab = ({
|
|
|
28807
29007
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
28808
29008
|
userFilterData
|
|
28809
29009
|
}) => {
|
|
28810
|
-
const fetchActivitiesHistoryRef = (0,
|
|
29010
|
+
const fetchActivitiesHistoryRef = (0, import_react95.useRef)(fetchActivitiesHistory);
|
|
28811
29011
|
fetchActivitiesHistoryRef.current = fetchActivitiesHistory;
|
|
28812
|
-
const useActivitiesHistory = (0,
|
|
29012
|
+
const useActivitiesHistory = (0, import_react95.useMemo)(
|
|
28813
29013
|
() => createUseActivitiesHistory(
|
|
28814
29014
|
(filters) => fetchActivitiesHistoryRef.current(filters)
|
|
28815
29015
|
),
|
|
@@ -28822,15 +29022,15 @@ var HistoryTab = ({
|
|
|
28822
29022
|
pagination,
|
|
28823
29023
|
fetchActivities
|
|
28824
29024
|
} = useActivitiesHistory();
|
|
28825
|
-
const historyFilterConfigs = (0,
|
|
29025
|
+
const historyFilterConfigs = (0, import_react95.useMemo)(
|
|
28826
29026
|
() => createHistoryFiltersConfig(userFilterData),
|
|
28827
29027
|
[userFilterData]
|
|
28828
29028
|
);
|
|
28829
|
-
const historyTableColumns = (0,
|
|
29029
|
+
const historyTableColumns = (0, import_react95.useMemo)(
|
|
28830
29030
|
() => createHistoryTableColumns(mapSubjectNameToEnum2),
|
|
28831
29031
|
[mapSubjectNameToEnum2]
|
|
28832
29032
|
);
|
|
28833
|
-
const handleParamsChange = (0,
|
|
29033
|
+
const handleParamsChange = (0, import_react95.useCallback)(
|
|
28834
29034
|
(params) => {
|
|
28835
29035
|
const filters = buildHistoryFiltersFromParams(params);
|
|
28836
29036
|
fetchActivities(filters);
|
|
@@ -28838,9 +29038,9 @@ var HistoryTab = ({
|
|
|
28838
29038
|
[fetchActivities]
|
|
28839
29039
|
);
|
|
28840
29040
|
if (error) {
|
|
28841
|
-
return /* @__PURE__ */ (0,
|
|
29041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(ErrorDisplay, { error });
|
|
28842
29042
|
}
|
|
28843
|
-
return /* @__PURE__ */ (0,
|
|
29043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
28844
29044
|
TableProvider,
|
|
28845
29045
|
{
|
|
28846
29046
|
data: activities,
|
|
@@ -28865,14 +29065,14 @@ var HistoryTab = ({
|
|
|
28865
29065
|
image: noSearchImage
|
|
28866
29066
|
},
|
|
28867
29067
|
emptyState: {
|
|
28868
|
-
component: /* @__PURE__ */ (0,
|
|
29068
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
28869
29069
|
EmptyState_default,
|
|
28870
29070
|
{
|
|
28871
29071
|
image: emptyStateImage,
|
|
28872
29072
|
title: "Incentive sua turma ao aprendizado",
|
|
28873
29073
|
description: "Crie uma nova atividade e ajude seus alunos a colocarem o conte\xFAdo em pr\xE1tica!",
|
|
28874
29074
|
buttonText: "Criar atividade",
|
|
28875
|
-
buttonIcon: /* @__PURE__ */ (0,
|
|
29075
|
+
buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_phosphor_react54.Plus, { size: 18 }),
|
|
28876
29076
|
buttonVariant: "outline",
|
|
28877
29077
|
buttonAction: "primary",
|
|
28878
29078
|
onButtonClick: onCreateActivity
|
|
@@ -28887,22 +29087,22 @@ var HistoryTab = ({
|
|
|
28887
29087
|
table,
|
|
28888
29088
|
pagination: paginationComponent
|
|
28889
29089
|
} = renderProps;
|
|
28890
|
-
return /* @__PURE__ */ (0,
|
|
28891
|
-
/* @__PURE__ */ (0,
|
|
28892
|
-
/* @__PURE__ */ (0,
|
|
29090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "space-y-4", children: [
|
|
29091
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
29092
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
28893
29093
|
Button_default,
|
|
28894
29094
|
{
|
|
28895
29095
|
variant: "solid",
|
|
28896
29096
|
action: "primary",
|
|
28897
29097
|
size: "medium",
|
|
28898
29098
|
onClick: onCreateActivity,
|
|
28899
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
29099
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_phosphor_react54.Plus, { size: 18, weight: "bold" }),
|
|
28900
29100
|
children: "Criar atividade"
|
|
28901
29101
|
}
|
|
28902
29102
|
),
|
|
28903
29103
|
controls
|
|
28904
29104
|
] }),
|
|
28905
|
-
/* @__PURE__ */ (0,
|
|
29105
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
|
|
28906
29106
|
table,
|
|
28907
29107
|
paginationComponent
|
|
28908
29108
|
] })
|
|
@@ -28922,14 +29122,14 @@ var createModelsFiltersConfig = (userData) => [
|
|
|
28922
29122
|
key: "subject",
|
|
28923
29123
|
label: "Mat\xE9ria",
|
|
28924
29124
|
selectedIds: [],
|
|
28925
|
-
itens:
|
|
29125
|
+
itens: getSubjectOptions5(userData)
|
|
28926
29126
|
}
|
|
28927
29127
|
]
|
|
28928
29128
|
}
|
|
28929
29129
|
];
|
|
28930
29130
|
|
|
28931
29131
|
// src/hooks/useActivityModels.ts
|
|
28932
|
-
var
|
|
29132
|
+
var import_react96 = require("react");
|
|
28933
29133
|
var import_zod10 = require("zod");
|
|
28934
29134
|
var import_dayjs7 = __toESM(require("dayjs"));
|
|
28935
29135
|
var activityDraftFiltersSchema = import_zod10.z.object({
|
|
@@ -28990,13 +29190,13 @@ var handleModelFetchError = createFetchErrorHandler(
|
|
|
28990
29190
|
);
|
|
28991
29191
|
var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
28992
29192
|
return () => {
|
|
28993
|
-
const [state, setState] = (0,
|
|
29193
|
+
const [state, setState] = (0, import_react96.useState)({
|
|
28994
29194
|
models: [],
|
|
28995
29195
|
loading: false,
|
|
28996
29196
|
error: null,
|
|
28997
29197
|
pagination: DEFAULT_MODELS_PAGINATION
|
|
28998
29198
|
});
|
|
28999
|
-
const fetchModels = (0,
|
|
29199
|
+
const fetchModels = (0, import_react96.useCallback)(
|
|
29000
29200
|
async (filters, subjectsMap) => {
|
|
29001
29201
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
29002
29202
|
try {
|
|
@@ -29031,7 +29231,7 @@ var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
|
29031
29231
|
},
|
|
29032
29232
|
[fetchActivityModels]
|
|
29033
29233
|
);
|
|
29034
|
-
const deleteModel = (0,
|
|
29234
|
+
const deleteModel = (0, import_react96.useCallback)(
|
|
29035
29235
|
async (id) => {
|
|
29036
29236
|
try {
|
|
29037
29237
|
await deleteActivityModel(id);
|
|
@@ -29053,7 +29253,7 @@ var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
|
29053
29253
|
var createActivityModelsHook = createUseActivityModels;
|
|
29054
29254
|
|
|
29055
29255
|
// src/components/ActivitiesHistory/tabs/ModelsTab.tsx
|
|
29056
|
-
var
|
|
29256
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
29057
29257
|
var ACTIVITY_MODELS_CONFIG = {
|
|
29058
29258
|
entityName: "atividade",
|
|
29059
29259
|
entityNamePlural: "atividades",
|
|
@@ -29079,7 +29279,7 @@ var ModelsTab = ({
|
|
|
29079
29279
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
29080
29280
|
userFilterData,
|
|
29081
29281
|
subjectsMap
|
|
29082
|
-
}) => /* @__PURE__ */ (0,
|
|
29282
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
29083
29283
|
ModelsTabBase,
|
|
29084
29284
|
{
|
|
29085
29285
|
fetchModels: fetchActivityModels,
|
|
@@ -29107,13 +29307,13 @@ var ModelsTab = ({
|
|
|
29107
29307
|
);
|
|
29108
29308
|
|
|
29109
29309
|
// src/components/ActivitiesHistory/tabs/DraftsTab.tsx
|
|
29110
|
-
var
|
|
29310
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
29111
29311
|
var DraftsTab = () => {
|
|
29112
|
-
return /* @__PURE__ */ (0,
|
|
29312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Text_default, { size: "lg", color: "text-text-600", children: "Rascunhos em desenvolvimento" }) });
|
|
29113
29313
|
};
|
|
29114
29314
|
|
|
29115
29315
|
// src/components/ActivitiesHistory/ActivitiesHistory.tsx
|
|
29116
|
-
var
|
|
29316
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
29117
29317
|
var PAGE_TITLES = {
|
|
29118
29318
|
["history" /* HISTORY */]: "Hist\xF3rico de atividades",
|
|
29119
29319
|
["drafts" /* DRAFTS */]: "Rascunhos",
|
|
@@ -29134,17 +29334,17 @@ var ActivitiesHistory = ({
|
|
|
29134
29334
|
userFilterData,
|
|
29135
29335
|
subjectsMap
|
|
29136
29336
|
}) => {
|
|
29137
|
-
const [activeTab, setActiveTab] = (0,
|
|
29138
|
-
return /* @__PURE__ */ (0,
|
|
29337
|
+
const [activeTab, setActiveTab] = (0, import_react97.useState)("history" /* HISTORY */);
|
|
29338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
29139
29339
|
"div",
|
|
29140
29340
|
{
|
|
29141
29341
|
"data-testid": "activities-history",
|
|
29142
29342
|
className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
|
|
29143
29343
|
children: [
|
|
29144
|
-
/* @__PURE__ */ (0,
|
|
29145
|
-
/* @__PURE__ */ (0,
|
|
29146
|
-
/* @__PURE__ */ (0,
|
|
29147
|
-
/* @__PURE__ */ (0,
|
|
29344
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
|
|
29345
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("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: [
|
|
29346
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("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: [
|
|
29347
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29148
29348
|
Text_default,
|
|
29149
29349
|
{
|
|
29150
29350
|
as: "h1",
|
|
@@ -29153,7 +29353,7 @@ var ActivitiesHistory = ({
|
|
|
29153
29353
|
children: PAGE_TITLES[activeTab]
|
|
29154
29354
|
}
|
|
29155
29355
|
),
|
|
29156
|
-
/* @__PURE__ */ (0,
|
|
29356
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29157
29357
|
Menu,
|
|
29158
29358
|
{
|
|
29159
29359
|
defaultValue: "history" /* HISTORY */,
|
|
@@ -29161,13 +29361,13 @@ var ActivitiesHistory = ({
|
|
|
29161
29361
|
onValueChange: (value) => setActiveTab(value),
|
|
29162
29362
|
variant: "menu2",
|
|
29163
29363
|
className: "bg-transparent shadow-none px-0",
|
|
29164
|
-
children: /* @__PURE__ */ (0,
|
|
29364
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
29165
29365
|
MenuContent,
|
|
29166
29366
|
{
|
|
29167
29367
|
variant: "menu2",
|
|
29168
29368
|
className: "w-full lg:w-auto max-w-full min-w-0",
|
|
29169
29369
|
children: [
|
|
29170
|
-
/* @__PURE__ */ (0,
|
|
29370
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29171
29371
|
MenuItem,
|
|
29172
29372
|
{
|
|
29173
29373
|
variant: "menu2",
|
|
@@ -29177,7 +29377,7 @@ var ActivitiesHistory = ({
|
|
|
29177
29377
|
children: "Hist\xF3rico"
|
|
29178
29378
|
}
|
|
29179
29379
|
),
|
|
29180
|
-
/* @__PURE__ */ (0,
|
|
29380
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29181
29381
|
MenuItem,
|
|
29182
29382
|
{
|
|
29183
29383
|
variant: "menu2",
|
|
@@ -29187,7 +29387,7 @@ var ActivitiesHistory = ({
|
|
|
29187
29387
|
children: "Rascunhos"
|
|
29188
29388
|
}
|
|
29189
29389
|
),
|
|
29190
|
-
/* @__PURE__ */ (0,
|
|
29390
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29191
29391
|
MenuItem,
|
|
29192
29392
|
{
|
|
29193
29393
|
variant: "menu2",
|
|
@@ -29203,8 +29403,8 @@ var ActivitiesHistory = ({
|
|
|
29203
29403
|
}
|
|
29204
29404
|
) })
|
|
29205
29405
|
] }),
|
|
29206
|
-
/* @__PURE__ */ (0,
|
|
29207
|
-
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0,
|
|
29406
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
|
|
29407
|
+
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29208
29408
|
HistoryTab,
|
|
29209
29409
|
{
|
|
29210
29410
|
fetchActivitiesHistory,
|
|
@@ -29216,8 +29416,8 @@ var ActivitiesHistory = ({
|
|
|
29216
29416
|
userFilterData
|
|
29217
29417
|
}
|
|
29218
29418
|
),
|
|
29219
|
-
activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */ (0,
|
|
29220
|
-
activeTab === "models" /* MODELS */ && /* @__PURE__ */ (0,
|
|
29419
|
+
activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(DraftsTab, {}),
|
|
29420
|
+
activeTab === "models" /* MODELS */ && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29221
29421
|
ModelsTab,
|
|
29222
29422
|
{
|
|
29223
29423
|
fetchActivityModels,
|
|
@@ -29373,7 +29573,7 @@ var buildUserFilterData = (userData) => ({
|
|
|
29373
29573
|
});
|
|
29374
29574
|
|
|
29375
29575
|
// src/hooks/useChat.ts
|
|
29376
|
-
var
|
|
29576
|
+
var import_react98 = require("react");
|
|
29377
29577
|
var WS_STATES = {
|
|
29378
29578
|
CONNECTING: 0,
|
|
29379
29579
|
OPEN: 1,
|
|
@@ -29392,25 +29592,25 @@ function useChat({
|
|
|
29392
29592
|
reconnectInterval = 3e3,
|
|
29393
29593
|
maxReconnectAttempts = 5
|
|
29394
29594
|
}) {
|
|
29395
|
-
const [isConnected, setIsConnected] = (0,
|
|
29396
|
-
const [messages, setMessages] = (0,
|
|
29397
|
-
const [participants, setParticipants] = (0,
|
|
29398
|
-
const [error, setError] = (0,
|
|
29399
|
-
const wsRef = (0,
|
|
29400
|
-
const reconnectAttemptsRef = (0,
|
|
29401
|
-
const reconnectTimeoutRef = (0,
|
|
29595
|
+
const [isConnected, setIsConnected] = (0, import_react98.useState)(false);
|
|
29596
|
+
const [messages, setMessages] = (0, import_react98.useState)([]);
|
|
29597
|
+
const [participants, setParticipants] = (0, import_react98.useState)([]);
|
|
29598
|
+
const [error, setError] = (0, import_react98.useState)(null);
|
|
29599
|
+
const wsRef = (0, import_react98.useRef)(null);
|
|
29600
|
+
const reconnectAttemptsRef = (0, import_react98.useRef)(0);
|
|
29601
|
+
const reconnectTimeoutRef = (0, import_react98.useRef)(
|
|
29402
29602
|
null
|
|
29403
29603
|
);
|
|
29404
|
-
const isManualDisconnectRef = (0,
|
|
29405
|
-
const isConnectingRef = (0,
|
|
29406
|
-
const connectRef = (0,
|
|
29604
|
+
const isManualDisconnectRef = (0, import_react98.useRef)(false);
|
|
29605
|
+
const isConnectingRef = (0, import_react98.useRef)(false);
|
|
29606
|
+
const connectRef = (0, import_react98.useRef)(() => {
|
|
29407
29607
|
});
|
|
29408
|
-
const sendWsMessage = (0,
|
|
29608
|
+
const sendWsMessage = (0, import_react98.useCallback)((message) => {
|
|
29409
29609
|
if (wsRef.current?.readyState === WS_STATES.OPEN) {
|
|
29410
29610
|
wsRef.current.send(JSON.stringify(message));
|
|
29411
29611
|
}
|
|
29412
29612
|
}, []);
|
|
29413
|
-
const sendMessage = (0,
|
|
29613
|
+
const sendMessage = (0, import_react98.useCallback)(
|
|
29414
29614
|
(content) => {
|
|
29415
29615
|
const trimmedContent = content.trim();
|
|
29416
29616
|
if (!trimmedContent) return;
|
|
@@ -29421,12 +29621,12 @@ function useChat({
|
|
|
29421
29621
|
},
|
|
29422
29622
|
[sendWsMessage]
|
|
29423
29623
|
);
|
|
29424
|
-
const leave = (0,
|
|
29624
|
+
const leave = (0, import_react98.useCallback)(() => {
|
|
29425
29625
|
isManualDisconnectRef.current = true;
|
|
29426
29626
|
sendWsMessage({ type: "leave" });
|
|
29427
29627
|
wsRef.current?.close(1e3, "User left");
|
|
29428
29628
|
}, [sendWsMessage]);
|
|
29429
|
-
const handleMessage = (0,
|
|
29629
|
+
const handleMessage = (0, import_react98.useCallback)(
|
|
29430
29630
|
(event) => {
|
|
29431
29631
|
try {
|
|
29432
29632
|
const data = JSON.parse(event.data);
|
|
@@ -29494,7 +29694,7 @@ function useChat({
|
|
|
29494
29694
|
},
|
|
29495
29695
|
[onError]
|
|
29496
29696
|
);
|
|
29497
|
-
const connect = (0,
|
|
29697
|
+
const connect = (0, import_react98.useCallback)(() => {
|
|
29498
29698
|
if (isConnectingRef.current) {
|
|
29499
29699
|
return;
|
|
29500
29700
|
}
|
|
@@ -29548,12 +29748,12 @@ function useChat({
|
|
|
29548
29748
|
maxReconnectAttempts
|
|
29549
29749
|
]);
|
|
29550
29750
|
connectRef.current = connect;
|
|
29551
|
-
const reconnect = (0,
|
|
29751
|
+
const reconnect = (0, import_react98.useCallback)(() => {
|
|
29552
29752
|
isManualDisconnectRef.current = false;
|
|
29553
29753
|
reconnectAttemptsRef.current = 0;
|
|
29554
29754
|
connectRef.current();
|
|
29555
29755
|
}, []);
|
|
29556
|
-
(0,
|
|
29756
|
+
(0, import_react98.useEffect)(() => {
|
|
29557
29757
|
if (!roomId) {
|
|
29558
29758
|
return;
|
|
29559
29759
|
}
|
|
@@ -29597,15 +29797,15 @@ function createUseChat(baseWsUrl) {
|
|
|
29597
29797
|
}
|
|
29598
29798
|
|
|
29599
29799
|
// src/hooks/useChatRooms.ts
|
|
29600
|
-
var
|
|
29800
|
+
var import_react99 = require("react");
|
|
29601
29801
|
function useChatRooms({
|
|
29602
29802
|
apiClient
|
|
29603
29803
|
}) {
|
|
29604
|
-
const [rooms, setRooms] = (0,
|
|
29605
|
-
const [availableUsers, setAvailableUsers] = (0,
|
|
29606
|
-
const [loading, setLoading] = (0,
|
|
29607
|
-
const [error, setError] = (0,
|
|
29608
|
-
const fetchRooms = (0,
|
|
29804
|
+
const [rooms, setRooms] = (0, import_react99.useState)([]);
|
|
29805
|
+
const [availableUsers, setAvailableUsers] = (0, import_react99.useState)([]);
|
|
29806
|
+
const [loading, setLoading] = (0, import_react99.useState)(false);
|
|
29807
|
+
const [error, setError] = (0, import_react99.useState)(null);
|
|
29808
|
+
const fetchRooms = (0, import_react99.useCallback)(async () => {
|
|
29609
29809
|
setLoading(true);
|
|
29610
29810
|
setError(null);
|
|
29611
29811
|
try {
|
|
@@ -29621,7 +29821,7 @@ function useChatRooms({
|
|
|
29621
29821
|
setLoading(false);
|
|
29622
29822
|
}
|
|
29623
29823
|
}, [apiClient]);
|
|
29624
|
-
const fetchAvailableUsers = (0,
|
|
29824
|
+
const fetchAvailableUsers = (0, import_react99.useCallback)(async () => {
|
|
29625
29825
|
setLoading(true);
|
|
29626
29826
|
setError(null);
|
|
29627
29827
|
try {
|
|
@@ -29637,7 +29837,7 @@ function useChatRooms({
|
|
|
29637
29837
|
setLoading(false);
|
|
29638
29838
|
}
|
|
29639
29839
|
}, [apiClient]);
|
|
29640
|
-
const createRoom = (0,
|
|
29840
|
+
const createRoom = (0, import_react99.useCallback)(
|
|
29641
29841
|
async (participantIds) => {
|
|
29642
29842
|
setLoading(true);
|
|
29643
29843
|
setError(null);
|
|
@@ -29661,7 +29861,7 @@ function useChatRooms({
|
|
|
29661
29861
|
},
|
|
29662
29862
|
[apiClient, fetchRooms]
|
|
29663
29863
|
);
|
|
29664
|
-
const clearError = (0,
|
|
29864
|
+
const clearError = (0, import_react99.useCallback)(() => {
|
|
29665
29865
|
setError(null);
|
|
29666
29866
|
}, []);
|
|
29667
29867
|
return {
|
|
@@ -29695,14 +29895,14 @@ var CHAT_MESSAGE_TYPES = {
|
|
|
29695
29895
|
};
|
|
29696
29896
|
|
|
29697
29897
|
// src/components/Chat/Chat.tsx
|
|
29698
|
-
var
|
|
29699
|
-
var
|
|
29700
|
-
var
|
|
29898
|
+
var import_react100 = require("react");
|
|
29899
|
+
var import_react101 = require("@phosphor-icons/react");
|
|
29900
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
29701
29901
|
var RoomItem = ({
|
|
29702
29902
|
room,
|
|
29703
29903
|
onClick,
|
|
29704
29904
|
isActive
|
|
29705
|
-
}) => /* @__PURE__ */ (0,
|
|
29905
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29706
29906
|
Button_default,
|
|
29707
29907
|
{
|
|
29708
29908
|
variant: "link",
|
|
@@ -29712,16 +29912,16 @@ var RoomItem = ({
|
|
|
29712
29912
|
"hover:bg-background-100",
|
|
29713
29913
|
isActive && "bg-primary-50 border-l-4 border-primary-500"
|
|
29714
29914
|
),
|
|
29715
|
-
children: /* @__PURE__ */ (0,
|
|
29716
|
-
/* @__PURE__ */ (0,
|
|
29717
|
-
/* @__PURE__ */ (0,
|
|
29718
|
-
/* @__PURE__ */ (0,
|
|
29719
|
-
room.lastMessage && /* @__PURE__ */ (0,
|
|
29915
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-start gap-3 w-full", children: [
|
|
29916
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react101.UsersIcon, { size: 20, className: "text-primary-600" }) }),
|
|
29917
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
29918
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", weight: "semibold", className: "text-text-900 truncate", children: room.name }),
|
|
29919
|
+
room.lastMessage && /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Text_default, { size: "xs", className: "text-text-500 truncate mt-1", children: [
|
|
29720
29920
|
room.lastMessage.senderName,
|
|
29721
29921
|
": ",
|
|
29722
29922
|
room.lastMessage.content
|
|
29723
29923
|
] }),
|
|
29724
|
-
/* @__PURE__ */ (0,
|
|
29924
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Text_default, { size: "xs", className: "text-text-400 mt-1", children: [
|
|
29725
29925
|
room.participantCount,
|
|
29726
29926
|
" participantes"
|
|
29727
29927
|
] })
|
|
@@ -29732,28 +29932,28 @@ var RoomItem = ({
|
|
|
29732
29932
|
var MessageBubble = ({
|
|
29733
29933
|
message,
|
|
29734
29934
|
isOwn
|
|
29735
|
-
}) => /* @__PURE__ */ (0,
|
|
29736
|
-
!isOwn && /* @__PURE__ */ (0,
|
|
29935
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: cn("flex gap-2 mb-3", isOwn && "flex-row-reverse"), children: [
|
|
29936
|
+
!isOwn && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center flex-shrink-0", children: message.senderPhoto ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29737
29937
|
"img",
|
|
29738
29938
|
{
|
|
29739
29939
|
src: message.senderPhoto,
|
|
29740
29940
|
alt: message.senderName,
|
|
29741
29941
|
className: "w-8 h-8 rounded-full object-cover"
|
|
29742
29942
|
}
|
|
29743
|
-
) : /* @__PURE__ */ (0,
|
|
29744
|
-
/* @__PURE__ */ (0,
|
|
29745
|
-
!isOwn && /* @__PURE__ */ (0,
|
|
29746
|
-
/* @__PURE__ */ (0,
|
|
29943
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", weight: "bold", className: "text-gray-600", children: message.senderName.charAt(0).toUpperCase() }) }),
|
|
29944
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: cn("max-w-[70%]", isOwn && "items-end"), children: [
|
|
29945
|
+
!isOwn && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500 mb-1", children: message.senderName }),
|
|
29946
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29747
29947
|
"div",
|
|
29748
29948
|
{
|
|
29749
29949
|
className: cn(
|
|
29750
29950
|
"px-4 py-2 rounded-2xl",
|
|
29751
29951
|
isOwn ? "bg-primary-500 text-white rounded-br-md" : "bg-background-100 text-text-900 rounded-bl-md"
|
|
29752
29952
|
),
|
|
29753
|
-
children: /* @__PURE__ */ (0,
|
|
29953
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", children: message.content })
|
|
29754
29954
|
}
|
|
29755
29955
|
),
|
|
29756
|
-
/* @__PURE__ */ (0,
|
|
29956
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29757
29957
|
Text_default,
|
|
29758
29958
|
{
|
|
29759
29959
|
size: "xs",
|
|
@@ -29766,28 +29966,28 @@ var MessageBubble = ({
|
|
|
29766
29966
|
)
|
|
29767
29967
|
] })
|
|
29768
29968
|
] });
|
|
29769
|
-
var ParticipantItem = ({ participant }) => /* @__PURE__ */ (0,
|
|
29770
|
-
/* @__PURE__ */ (0,
|
|
29771
|
-
/* @__PURE__ */ (0,
|
|
29969
|
+
var ParticipantItem = ({ participant }) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-center gap-2 py-2", children: [
|
|
29970
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "relative", children: [
|
|
29971
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center", children: participant.photo ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29772
29972
|
"img",
|
|
29773
29973
|
{
|
|
29774
29974
|
src: participant.photo,
|
|
29775
29975
|
alt: participant.name,
|
|
29776
29976
|
className: "w-8 h-8 rounded-full object-cover"
|
|
29777
29977
|
}
|
|
29778
|
-
) : /* @__PURE__ */ (0,
|
|
29779
|
-
participant.isOnline && /* @__PURE__ */ (0,
|
|
29978
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", weight: "bold", className: "text-gray-600", children: participant.name.charAt(0).toUpperCase() }) }),
|
|
29979
|
+
participant.isOnline && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white" })
|
|
29780
29980
|
] }),
|
|
29781
|
-
/* @__PURE__ */ (0,
|
|
29782
|
-
/* @__PURE__ */ (0,
|
|
29783
|
-
/* @__PURE__ */ (0,
|
|
29981
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
29982
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-text-900 truncate", children: participant.name }),
|
|
29983
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500", children: participant.role })
|
|
29784
29984
|
] })
|
|
29785
29985
|
] });
|
|
29786
29986
|
var UserSelector = ({
|
|
29787
29987
|
users,
|
|
29788
29988
|
selectedIds,
|
|
29789
29989
|
onToggle
|
|
29790
|
-
}) => /* @__PURE__ */ (0,
|
|
29990
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "space-y-2 max-h-64 overflow-y-auto", children: users.map((user) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
29791
29991
|
Button_default,
|
|
29792
29992
|
{
|
|
29793
29993
|
variant: "link",
|
|
@@ -29797,26 +29997,26 @@ var UserSelector = ({
|
|
|
29797
29997
|
selectedIds.has(user.userInstitutionId) ? "bg-primary-50 border border-primary-500" : "bg-background-50 hover:bg-background-100 border border-transparent"
|
|
29798
29998
|
),
|
|
29799
29999
|
children: [
|
|
29800
|
-
/* @__PURE__ */ (0,
|
|
30000
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-10 h-10 rounded-full bg-gray-200 flex items-center justify-center", children: user.photo ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29801
30001
|
"img",
|
|
29802
30002
|
{
|
|
29803
30003
|
src: user.photo,
|
|
29804
30004
|
alt: user.name,
|
|
29805
30005
|
className: "w-10 h-10 rounded-full object-cover"
|
|
29806
30006
|
}
|
|
29807
|
-
) : /* @__PURE__ */ (0,
|
|
29808
|
-
/* @__PURE__ */ (0,
|
|
29809
|
-
/* @__PURE__ */ (0,
|
|
29810
|
-
/* @__PURE__ */ (0,
|
|
30007
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-gray-600", children: user.name.charAt(0).toUpperCase() }) }),
|
|
30008
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 text-left", children: [
|
|
30009
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children: user.name }),
|
|
30010
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500", children: user.profileName })
|
|
29811
30011
|
] }),
|
|
29812
|
-
/* @__PURE__ */ (0,
|
|
30012
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29813
30013
|
"div",
|
|
29814
30014
|
{
|
|
29815
30015
|
className: cn(
|
|
29816
30016
|
"w-5 h-5 rounded-full border-2 flex items-center justify-center",
|
|
29817
30017
|
selectedIds.has(user.userInstitutionId) ? "bg-primary-500 border-primary-500" : "border-gray-300"
|
|
29818
30018
|
),
|
|
29819
|
-
children: selectedIds.has(user.userInstitutionId) && /* @__PURE__ */ (0,
|
|
30019
|
+
children: selectedIds.has(user.userInstitutionId) && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-2 h-2 bg-white rounded-full" })
|
|
29820
30020
|
}
|
|
29821
30021
|
)
|
|
29822
30022
|
]
|
|
@@ -29826,9 +30026,9 @@ var UserSelector = ({
|
|
|
29826
30026
|
function Chat(props) {
|
|
29827
30027
|
const { userId, token } = props;
|
|
29828
30028
|
if (!userId || !token) {
|
|
29829
|
-
return /* @__PURE__ */ (0,
|
|
30029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-text-500", children: "Carregando..." }) });
|
|
29830
30030
|
}
|
|
29831
|
-
return /* @__PURE__ */ (0,
|
|
30031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(ChatContent, { ...props });
|
|
29832
30032
|
}
|
|
29833
30033
|
function ChatContent({
|
|
29834
30034
|
apiClient,
|
|
@@ -29843,16 +30043,16 @@ function ChatContent({
|
|
|
29843
30043
|
onRoomChange,
|
|
29844
30044
|
onBackToList
|
|
29845
30045
|
}) {
|
|
29846
|
-
const [view, setView] = (0,
|
|
29847
|
-
const [selectedRoom, setSelectedRoom] = (0,
|
|
30046
|
+
const [view, setView] = (0, import_react100.useState)("list");
|
|
30047
|
+
const [selectedRoom, setSelectedRoom] = (0, import_react100.useState)(
|
|
29848
30048
|
null
|
|
29849
30049
|
);
|
|
29850
|
-
const [selectedUserIds, setSelectedUserIds] = (0,
|
|
30050
|
+
const [selectedUserIds, setSelectedUserIds] = (0, import_react100.useState)(
|
|
29851
30051
|
/* @__PURE__ */ new Set()
|
|
29852
30052
|
);
|
|
29853
|
-
const [messageInput, setMessageInput] = (0,
|
|
29854
|
-
const [showCreateModal, setShowCreateModal] = (0,
|
|
29855
|
-
const hasHandledInitialRoomRef = (0,
|
|
30053
|
+
const [messageInput, setMessageInput] = (0, import_react100.useState)("");
|
|
30054
|
+
const [showCreateModal, setShowCreateModal] = (0, import_react100.useState)(false);
|
|
30055
|
+
const hasHandledInitialRoomRef = (0, import_react100.useRef)(false);
|
|
29856
30056
|
const {
|
|
29857
30057
|
rooms,
|
|
29858
30058
|
availableUsers,
|
|
@@ -29880,10 +30080,10 @@ function ChatContent({
|
|
|
29880
30080
|
const getRoleLabel = () => {
|
|
29881
30081
|
return userRole === "TEACHER" /* TEACHER */ ? "Professor" : "Aluno";
|
|
29882
30082
|
};
|
|
29883
|
-
(0,
|
|
30083
|
+
(0, import_react100.useEffect)(() => {
|
|
29884
30084
|
fetchRooms();
|
|
29885
30085
|
}, [fetchRooms]);
|
|
29886
|
-
(0,
|
|
30086
|
+
(0, import_react100.useEffect)(() => {
|
|
29887
30087
|
if (hasHandledInitialRoomRef.current) {
|
|
29888
30088
|
return;
|
|
29889
30089
|
}
|
|
@@ -29905,7 +30105,7 @@ function ChatContent({
|
|
|
29905
30105
|
onBackToList?.();
|
|
29906
30106
|
}
|
|
29907
30107
|
}, [initialRoomId, rooms, roomsLoading, onBackToList]);
|
|
29908
|
-
const handleSelectRoom = (0,
|
|
30108
|
+
const handleSelectRoom = (0, import_react100.useCallback)(
|
|
29909
30109
|
(room) => {
|
|
29910
30110
|
setSelectedRoom(room);
|
|
29911
30111
|
setView("room");
|
|
@@ -29913,12 +30113,12 @@ function ChatContent({
|
|
|
29913
30113
|
},
|
|
29914
30114
|
[onRoomChange]
|
|
29915
30115
|
);
|
|
29916
|
-
const handleOpenCreateModal = (0,
|
|
30116
|
+
const handleOpenCreateModal = (0, import_react100.useCallback)(async () => {
|
|
29917
30117
|
await fetchAvailableUsers();
|
|
29918
30118
|
setSelectedUserIds(/* @__PURE__ */ new Set());
|
|
29919
30119
|
setShowCreateModal(true);
|
|
29920
30120
|
}, [fetchAvailableUsers]);
|
|
29921
|
-
const handleToggleUser = (0,
|
|
30121
|
+
const handleToggleUser = (0, import_react100.useCallback)((id) => {
|
|
29922
30122
|
setSelectedUserIds((prev) => {
|
|
29923
30123
|
const next = new Set(prev);
|
|
29924
30124
|
if (next.has(id)) {
|
|
@@ -29929,7 +30129,7 @@ function ChatContent({
|
|
|
29929
30129
|
return next;
|
|
29930
30130
|
});
|
|
29931
30131
|
}, []);
|
|
29932
|
-
const handleCreateRoom = (0,
|
|
30132
|
+
const handleCreateRoom = (0, import_react100.useCallback)(async () => {
|
|
29933
30133
|
if (selectedUserIds.size === 0) return;
|
|
29934
30134
|
const room = await createRoom(Array.from(selectedUserIds));
|
|
29935
30135
|
if (room) {
|
|
@@ -29938,30 +30138,30 @@ function ChatContent({
|
|
|
29938
30138
|
onRoomChange?.(room.id);
|
|
29939
30139
|
}
|
|
29940
30140
|
}, [selectedUserIds, createRoom, onRoomChange]);
|
|
29941
|
-
const handleSendMessage = (0,
|
|
30141
|
+
const handleSendMessage = (0, import_react100.useCallback)(() => {
|
|
29942
30142
|
if (!messageInput.trim()) return;
|
|
29943
30143
|
sendMessage(messageInput);
|
|
29944
30144
|
setMessageInput("");
|
|
29945
30145
|
}, [messageInput, sendMessage]);
|
|
29946
|
-
const handleBackToList = (0,
|
|
30146
|
+
const handleBackToList = (0, import_react100.useCallback)(() => {
|
|
29947
30147
|
setSelectedRoom(null);
|
|
29948
30148
|
setView("list");
|
|
29949
30149
|
onBackToList?.();
|
|
29950
30150
|
}, [onBackToList]);
|
|
29951
30151
|
const renderMessagesContent = () => {
|
|
29952
30152
|
if (chatError) {
|
|
29953
|
-
return /* @__PURE__ */ (0,
|
|
29954
|
-
/* @__PURE__ */ (0,
|
|
29955
|
-
/* @__PURE__ */ (0,
|
|
30153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "text-center", children: [
|
|
30154
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-red-500 mb-2", children: "Erro de conexao com o chat" }),
|
|
30155
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500", children: "Tentando reconectar..." })
|
|
29956
30156
|
] }) });
|
|
29957
30157
|
}
|
|
29958
30158
|
const userMessages = messages?.filter(
|
|
29959
30159
|
(message) => message.messageType !== CHAT_MESSAGE_TYPES.SYSTEM
|
|
29960
30160
|
);
|
|
29961
30161
|
if (!userMessages?.length) {
|
|
29962
|
-
return /* @__PURE__ */ (0,
|
|
30162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-text-500", children: "Nenhuma mensagem ainda. Comece a conversa!" }) });
|
|
29963
30163
|
}
|
|
29964
|
-
return userMessages.map((message) => /* @__PURE__ */ (0,
|
|
30164
|
+
return userMessages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29965
30165
|
MessageBubble,
|
|
29966
30166
|
{
|
|
29967
30167
|
message,
|
|
@@ -29970,57 +30170,57 @@ function ChatContent({
|
|
|
29970
30170
|
message.id
|
|
29971
30171
|
));
|
|
29972
30172
|
};
|
|
29973
|
-
const renderRoomList = () => /* @__PURE__ */ (0,
|
|
29974
|
-
/* @__PURE__ */ (0,
|
|
29975
|
-
/* @__PURE__ */ (0,
|
|
29976
|
-
/* @__PURE__ */ (0,
|
|
30173
|
+
const renderRoomList = () => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex flex-col h-full", children: [
|
|
30174
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "p-4 border-b border-background-200 flex items-center justify-between", children: [
|
|
30175
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
30176
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center flex-shrink-0", children: userPhoto ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29977
30177
|
"img",
|
|
29978
30178
|
{
|
|
29979
30179
|
src: userPhoto,
|
|
29980
30180
|
alt: userName,
|
|
29981
30181
|
className: "w-10 h-10 rounded-full object-cover"
|
|
29982
30182
|
}
|
|
29983
|
-
) : /* @__PURE__ */ (0,
|
|
29984
|
-
/* @__PURE__ */ (0,
|
|
29985
|
-
/* @__PURE__ */ (0,
|
|
29986
|
-
/* @__PURE__ */ (0,
|
|
30183
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-primary-600", children: userName.charAt(0).toUpperCase() }) }),
|
|
30184
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { children: [
|
|
30185
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-900", children: "Conversas" }),
|
|
30186
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Text_default, { size: "xs", className: "text-text-500", children: [
|
|
29987
30187
|
userName,
|
|
29988
30188
|
" - ",
|
|
29989
30189
|
getRoleLabel()
|
|
29990
30190
|
] })
|
|
29991
30191
|
] })
|
|
29992
30192
|
] }),
|
|
29993
|
-
/* @__PURE__ */ (0,
|
|
30193
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29994
30194
|
Button_default,
|
|
29995
30195
|
{
|
|
29996
30196
|
variant: "solid",
|
|
29997
30197
|
size: "small",
|
|
29998
30198
|
onClick: handleOpenCreateModal,
|
|
29999
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
30199
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react101.PlusIcon, { size: 16 }),
|
|
30000
30200
|
children: "Nova conversa"
|
|
30001
30201
|
}
|
|
30002
30202
|
)
|
|
30003
30203
|
] }),
|
|
30004
|
-
/* @__PURE__ */ (0,
|
|
30005
|
-
roomsError && /* @__PURE__ */ (0,
|
|
30006
|
-
/* @__PURE__ */ (0,
|
|
30007
|
-
/* @__PURE__ */ (0,
|
|
30204
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 overflow-y-auto p-2", children: [
|
|
30205
|
+
roomsError && /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "p-4 text-center", children: [
|
|
30206
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-red-500 mb-2", children: "Erro ao carregar conversas" }),
|
|
30207
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Button_default, { variant: "outline", size: "small", onClick: fetchRooms, children: "Tentar novamente" })
|
|
30008
30208
|
] }),
|
|
30009
|
-
!roomsError && roomsLoading && /* @__PURE__ */ (0,
|
|
30010
|
-
/* @__PURE__ */ (0,
|
|
30011
|
-
/* @__PURE__ */ (0,
|
|
30012
|
-
/* @__PURE__ */ (0,
|
|
30013
|
-
/* @__PURE__ */ (0,
|
|
30209
|
+
!roomsError && roomsLoading && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "space-y-3 p-2", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
30210
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SkeletonRounded, { className: "w-10 h-10" }),
|
|
30211
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1", children: [
|
|
30212
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SkeletonText, { className: "w-3/4 h-4 mb-2" }),
|
|
30213
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SkeletonText, { className: "w-1/2 h-3" })
|
|
30014
30214
|
] })
|
|
30015
30215
|
] }, i)) }),
|
|
30016
|
-
!roomsError && !roomsLoading && !rooms?.length && /* @__PURE__ */ (0,
|
|
30216
|
+
!roomsError && !roomsLoading && !rooms?.length && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30017
30217
|
EmptyState_default,
|
|
30018
30218
|
{
|
|
30019
30219
|
title: "Nenhuma conversa",
|
|
30020
30220
|
description: "Comece uma nova conversa clicando no botao acima"
|
|
30021
30221
|
}
|
|
30022
30222
|
),
|
|
30023
|
-
!roomsError && !roomsLoading && !!rooms?.length && /* @__PURE__ */ (0,
|
|
30223
|
+
!roomsError && !roomsLoading && !!rooms?.length && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "space-y-1", children: rooms.map((room) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30024
30224
|
RoomItem,
|
|
30025
30225
|
{
|
|
30026
30226
|
room,
|
|
@@ -30033,18 +30233,18 @@ function ChatContent({
|
|
|
30033
30233
|
] });
|
|
30034
30234
|
const renderChatRoom = () => {
|
|
30035
30235
|
if (!selectedRoom) return null;
|
|
30036
|
-
return /* @__PURE__ */ (0,
|
|
30037
|
-
/* @__PURE__ */ (0,
|
|
30038
|
-
/* @__PURE__ */ (0,
|
|
30039
|
-
/* @__PURE__ */ (0,
|
|
30040
|
-
/* @__PURE__ */ (0,
|
|
30041
|
-
/* @__PURE__ */ (0,
|
|
30042
|
-
/* @__PURE__ */ (0,
|
|
30236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex h-full", children: [
|
|
30237
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 flex flex-col", children: [
|
|
30238
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "p-4 border-b border-background-200 flex items-center gap-3", children: [
|
|
30239
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Button_default, { variant: "link", size: "small", onClick: handleBackToList, children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react101.XIcon, { size: 20 }) }),
|
|
30240
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1", children: [
|
|
30241
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "md", weight: "semibold", className: "text-text-900", children: selectedRoom.name }),
|
|
30242
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500", children: isConnected ? "Conectado" : "Conectando..." })
|
|
30043
30243
|
] })
|
|
30044
30244
|
] }),
|
|
30045
|
-
/* @__PURE__ */ (0,
|
|
30046
|
-
/* @__PURE__ */ (0,
|
|
30047
|
-
/* @__PURE__ */ (0,
|
|
30245
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "flex-1 overflow-y-auto p-4", children: renderMessagesContent() }),
|
|
30246
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "p-4 border-t border-background-200", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex gap-2", children: [
|
|
30247
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30048
30248
|
Input_default,
|
|
30049
30249
|
{
|
|
30050
30250
|
placeholder: "Digite sua mensagem...",
|
|
@@ -30059,24 +30259,24 @@ function ChatContent({
|
|
|
30059
30259
|
className: "flex-1"
|
|
30060
30260
|
}
|
|
30061
30261
|
),
|
|
30062
|
-
/* @__PURE__ */ (0,
|
|
30262
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30063
30263
|
Button_default,
|
|
30064
30264
|
{
|
|
30065
30265
|
variant: "solid",
|
|
30066
30266
|
onClick: handleSendMessage,
|
|
30067
30267
|
disabled: !messageInput.trim() || !isConnected,
|
|
30068
|
-
children: /* @__PURE__ */ (0,
|
|
30268
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react101.PaperPlaneTiltIcon, { size: 20 })
|
|
30069
30269
|
}
|
|
30070
30270
|
)
|
|
30071
30271
|
] }) })
|
|
30072
30272
|
] }),
|
|
30073
|
-
/* @__PURE__ */ (0,
|
|
30074
|
-
/* @__PURE__ */ (0,
|
|
30273
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "w-64 border-l border-background-200 p-4 hidden lg:block", children: [
|
|
30274
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Text_default, { size: "sm", weight: "semibold", className: "text-text-900 mb-3", children: [
|
|
30075
30275
|
"Participantes (",
|
|
30076
30276
|
participants?.length ?? 0,
|
|
30077
30277
|
")"
|
|
30078
30278
|
] }),
|
|
30079
|
-
/* @__PURE__ */ (0,
|
|
30279
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "space-y-1", children: participants?.map((participant) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30080
30280
|
ParticipantItem,
|
|
30081
30281
|
{
|
|
30082
30282
|
participant
|
|
@@ -30086,7 +30286,7 @@ function ChatContent({
|
|
|
30086
30286
|
] })
|
|
30087
30287
|
] });
|
|
30088
30288
|
};
|
|
30089
|
-
return /* @__PURE__ */ (0,
|
|
30289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
30090
30290
|
"div",
|
|
30091
30291
|
{
|
|
30092
30292
|
className: cn(
|
|
@@ -30096,20 +30296,20 @@ function ChatContent({
|
|
|
30096
30296
|
children: [
|
|
30097
30297
|
view === "list" && renderRoomList(),
|
|
30098
30298
|
view === "room" && renderChatRoom(),
|
|
30099
|
-
/* @__PURE__ */ (0,
|
|
30299
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30100
30300
|
Modal_default,
|
|
30101
30301
|
{
|
|
30102
30302
|
isOpen: showCreateModal,
|
|
30103
30303
|
onClose: () => setShowCreateModal(false),
|
|
30104
30304
|
title: "Nova conversa",
|
|
30105
|
-
children: /* @__PURE__ */ (0,
|
|
30106
|
-
/* @__PURE__ */ (0,
|
|
30107
|
-
roomsLoading && /* @__PURE__ */ (0,
|
|
30108
|
-
/* @__PURE__ */ (0,
|
|
30109
|
-
/* @__PURE__ */ (0,
|
|
30305
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "p-4", children: [
|
|
30306
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-text-600 mb-4", children: "Selecione os participantes para iniciar uma conversa" }),
|
|
30307
|
+
roomsLoading && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "space-y-3", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
30308
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SkeletonRounded, { className: "w-10 h-10" }),
|
|
30309
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SkeletonText, { className: "flex-1 h-4" })
|
|
30110
30310
|
] }, i)) }),
|
|
30111
|
-
!roomsLoading && !availableUsers?.length && /* @__PURE__ */ (0,
|
|
30112
|
-
!roomsLoading && !!availableUsers?.length && /* @__PURE__ */ (0,
|
|
30311
|
+
!roomsLoading && !availableUsers?.length && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-text-500 text-center py-4", children: "Nenhum usuario disponivel para chat" }),
|
|
30312
|
+
!roomsLoading && !!availableUsers?.length && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30113
30313
|
UserSelector,
|
|
30114
30314
|
{
|
|
30115
30315
|
users: availableUsers,
|
|
@@ -30117,9 +30317,9 @@ function ChatContent({
|
|
|
30117
30317
|
onToggle: handleToggleUser
|
|
30118
30318
|
}
|
|
30119
30319
|
),
|
|
30120
|
-
/* @__PURE__ */ (0,
|
|
30121
|
-
/* @__PURE__ */ (0,
|
|
30122
|
-
/* @__PURE__ */ (0,
|
|
30320
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex justify-end gap-2 mt-6", children: [
|
|
30321
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Button_default, { variant: "outline", onClick: () => setShowCreateModal(false), children: "Cancelar" }),
|
|
30322
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30123
30323
|
Button_default,
|
|
30124
30324
|
{
|
|
30125
30325
|
variant: "solid",
|
|
@@ -30138,9 +30338,9 @@ function ChatContent({
|
|
|
30138
30338
|
}
|
|
30139
30339
|
|
|
30140
30340
|
// src/components/Chat/ChatLoading.tsx
|
|
30141
|
-
var
|
|
30341
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
30142
30342
|
function ChatLoading() {
|
|
30143
|
-
return /* @__PURE__ */ (0,
|
|
30343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Text_default, { size: "sm", className: "text-text-500", children: "Carregando..." }) });
|
|
30144
30344
|
}
|
|
30145
30345
|
|
|
30146
30346
|
// src/utils/chatUtils.ts
|
|
@@ -30189,7 +30389,7 @@ var CalendarActivityStatus = /* @__PURE__ */ ((CalendarActivityStatus2) => {
|
|
|
30189
30389
|
})(CalendarActivityStatus || {});
|
|
30190
30390
|
|
|
30191
30391
|
// src/hooks/useSendActivity.ts
|
|
30192
|
-
var
|
|
30392
|
+
var import_react102 = require("react");
|
|
30193
30393
|
var import_dayjs8 = __toESM(require("dayjs"));
|
|
30194
30394
|
function transformToCategoryConfig(data) {
|
|
30195
30395
|
return [
|
|
@@ -30244,21 +30444,21 @@ function useSendActivity(config) {
|
|
|
30244
30444
|
onSuccess,
|
|
30245
30445
|
onError
|
|
30246
30446
|
} = config;
|
|
30247
|
-
const [isOpen, setIsOpen] = (0,
|
|
30248
|
-
const [selectedModel, setSelectedModel] = (0,
|
|
30447
|
+
const [isOpen, setIsOpen] = (0, import_react102.useState)(false);
|
|
30448
|
+
const [selectedModel, setSelectedModel] = (0, import_react102.useState)(
|
|
30249
30449
|
null
|
|
30250
30450
|
);
|
|
30251
|
-
const [categories, setCategories] = (0,
|
|
30252
|
-
const [isLoading, setIsLoading] = (0,
|
|
30253
|
-
const [isCategoriesLoading, setIsCategoriesLoading] = (0,
|
|
30254
|
-
const categoriesLoadedRef = (0,
|
|
30255
|
-
const initialData = (0,
|
|
30451
|
+
const [categories, setCategories] = (0, import_react102.useState)([]);
|
|
30452
|
+
const [isLoading, setIsLoading] = (0, import_react102.useState)(false);
|
|
30453
|
+
const [isCategoriesLoading, setIsCategoriesLoading] = (0, import_react102.useState)(false);
|
|
30454
|
+
const categoriesLoadedRef = (0, import_react102.useRef)(false);
|
|
30455
|
+
const initialData = (0, import_react102.useMemo)(() => {
|
|
30256
30456
|
if (!selectedModel) return void 0;
|
|
30257
30457
|
return {
|
|
30258
30458
|
title: selectedModel.title
|
|
30259
30459
|
};
|
|
30260
30460
|
}, [selectedModel]);
|
|
30261
|
-
const loadCategories = (0,
|
|
30461
|
+
const loadCategories = (0, import_react102.useCallback)(async () => {
|
|
30262
30462
|
if (categoriesLoadedRef.current) return;
|
|
30263
30463
|
setIsCategoriesLoading(true);
|
|
30264
30464
|
try {
|
|
@@ -30273,7 +30473,7 @@ function useSendActivity(config) {
|
|
|
30273
30473
|
setIsCategoriesLoading(false);
|
|
30274
30474
|
}
|
|
30275
30475
|
}, [fetchCategories, onError]);
|
|
30276
|
-
const openModal = (0,
|
|
30476
|
+
const openModal = (0, import_react102.useCallback)(
|
|
30277
30477
|
(model) => {
|
|
30278
30478
|
setSelectedModel(model);
|
|
30279
30479
|
setIsOpen(true);
|
|
@@ -30281,17 +30481,17 @@ function useSendActivity(config) {
|
|
|
30281
30481
|
},
|
|
30282
30482
|
[loadCategories]
|
|
30283
30483
|
);
|
|
30284
|
-
const closeModal = (0,
|
|
30484
|
+
const closeModal = (0, import_react102.useCallback)(() => {
|
|
30285
30485
|
setIsOpen(false);
|
|
30286
30486
|
setSelectedModel(null);
|
|
30287
30487
|
}, []);
|
|
30288
|
-
const onCategoriesChange = (0,
|
|
30488
|
+
const onCategoriesChange = (0, import_react102.useCallback)(
|
|
30289
30489
|
(updatedCategories) => {
|
|
30290
30490
|
setCategories(updatedCategories);
|
|
30291
30491
|
},
|
|
30292
30492
|
[]
|
|
30293
30493
|
);
|
|
30294
|
-
const handleSubmit = (0,
|
|
30494
|
+
const handleSubmit = (0, import_react102.useCallback)(
|
|
30295
30495
|
async (data) => {
|
|
30296
30496
|
if (!selectedModel) return;
|
|
30297
30497
|
setIsLoading(true);
|
|
@@ -30400,6 +30600,7 @@ function useSendActivity(config) {
|
|
|
30400
30600
|
CorrectActivityModal,
|
|
30401
30601
|
CreateActivity,
|
|
30402
30602
|
DEFAULT_ACTIVITIES_PAGINATION,
|
|
30603
|
+
DEFAULT_GOAL_DRAFTS_PAGINATION,
|
|
30403
30604
|
DEFAULT_GOAL_MODELS_PAGINATION,
|
|
30404
30605
|
DEFAULT_MODELS_PAGINATION,
|
|
30405
30606
|
DIFFICULTY_LEVEL_ENUM,
|
|
@@ -30423,6 +30624,7 @@ function useSendActivity(config) {
|
|
|
30423
30624
|
GoalBadgeActionType,
|
|
30424
30625
|
GoalDisplayStatus,
|
|
30425
30626
|
GoalDraftType,
|
|
30627
|
+
GoalDraftsTab,
|
|
30426
30628
|
GoalPageTab,
|
|
30427
30629
|
IconButton,
|
|
30428
30630
|
IconRender,
|
|
@@ -30544,6 +30746,7 @@ function useSendActivity(config) {
|
|
|
30544
30746
|
createActivitiesHistoryHook,
|
|
30545
30747
|
createActivityFiltersDataHook,
|
|
30546
30748
|
createActivityModelsHook,
|
|
30749
|
+
createGoalDraftsHook,
|
|
30547
30750
|
createGoalModelsHook,
|
|
30548
30751
|
createNotificationStore,
|
|
30549
30752
|
createNotificationsHook,
|
|
@@ -30556,6 +30759,7 @@ function useSendActivity(config) {
|
|
|
30556
30759
|
createUseActivityModels,
|
|
30557
30760
|
createUseChat,
|
|
30558
30761
|
createUseChatRooms,
|
|
30762
|
+
createUseGoalDrafts,
|
|
30559
30763
|
createUseGoalModels,
|
|
30560
30764
|
createUseNotificationStore,
|
|
30561
30765
|
createUseNotifications,
|
|
@@ -30602,6 +30806,7 @@ function useSendActivity(config) {
|
|
|
30602
30806
|
goalModelsApiResponseSchema,
|
|
30603
30807
|
goalsHistoryApiResponseSchema,
|
|
30604
30808
|
handleActivityFetchError,
|
|
30809
|
+
handleGoalDraftFetchError,
|
|
30605
30810
|
handleGoalFetchError,
|
|
30606
30811
|
handleGoalModelFetchError,
|
|
30607
30812
|
handleLessonDetailsFetchError,
|