analytica-frontend-lib 1.2.84 → 1.2.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RecommendedLessonsHistory/index.js +337 -165
- package/dist/RecommendedLessonsHistory/index.js.map +1 -1
- package/dist/RecommendedLessonsHistory/index.mjs +286 -114
- package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
- package/dist/hooks/useGoalDrafts/index.d.ts +57 -0
- package/dist/hooks/useGoalDrafts/index.d.ts.map +1 -0
- package/dist/hooks/useGoalDrafts/index.js +189 -0
- package/dist/hooks/useGoalDrafts/index.js.map +1 -0
- package/dist/hooks/useGoalDrafts/index.mjs +151 -0
- package/dist/hooks/useGoalDrafts/index.mjs.map +1 -0
- package/dist/hooks/useGoalDrafts.d.ts +57 -0
- package/dist/hooks/useGoalDrafts.d.ts.map +1 -0
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts +4 -0
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.js +24 -0
- package/dist/hooks/useRecommendedLessonsPage/index.js.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.mjs +24 -0
- package/dist/hooks/useRecommendedLessonsPage/index.mjs.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage.d.ts +4 -0
- package/dist/hooks/useRecommendedLessonsPage.d.ts.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +690 -430
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +567 -316
- package/dist/index.mjs.map +1 -1
- package/dist/types/lessonAvailability.d.ts +33 -0
- package/dist/types/lessonAvailability.d.ts.map +1 -0
- package/dist/utils/lessonAvailabilityUtils.d.ts +45 -0
- package/dist/utils/lessonAvailabilityUtils.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.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,12 +109,14 @@ __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,
|
|
114
116
|
IconRoundedButton: () => IconRoundedButton_default,
|
|
115
117
|
ImageUpload: () => ImageUpload,
|
|
116
118
|
Input: () => Input_default,
|
|
119
|
+
LESSON_AVAILABILITY: () => LESSON_AVAILABILITY,
|
|
117
120
|
LatexRenderer: () => LatexRenderer_default,
|
|
118
121
|
LessonPreview: () => LessonPreview,
|
|
119
122
|
LoadingModal: () => loadingModal_default,
|
|
@@ -224,11 +227,13 @@ __export(src_exports, {
|
|
|
224
227
|
activitiesHistoryApiResponseSchema: () => activitiesHistoryApiResponseSchema,
|
|
225
228
|
activityModelsApiResponseSchema: () => activityModelsApiResponseSchema,
|
|
226
229
|
buildUserFilterData: () => buildUserFilterData,
|
|
230
|
+
checkLessonAvailability: () => checkLessonAvailability,
|
|
227
231
|
cn: () => cn,
|
|
228
232
|
convertActivityFiltersToQuestionsFilter: () => convertActivityFiltersToQuestionsFilter,
|
|
229
233
|
createActivitiesHistoryHook: () => createActivitiesHistoryHook,
|
|
230
234
|
createActivityFiltersDataHook: () => createActivityFiltersDataHook,
|
|
231
235
|
createActivityModelsHook: () => createActivityModelsHook,
|
|
236
|
+
createGoalDraftsHook: () => createGoalDraftsHook,
|
|
232
237
|
createGoalModelsHook: () => createGoalModelsHook,
|
|
233
238
|
createNotificationStore: () => createNotificationStore,
|
|
234
239
|
createNotificationsHook: () => createNotificationsHook,
|
|
@@ -241,6 +246,7 @@ __export(src_exports, {
|
|
|
241
246
|
createUseActivityModels: () => createUseActivityModels,
|
|
242
247
|
createUseChat: () => createUseChat,
|
|
243
248
|
createUseChatRooms: () => createUseChatRooms,
|
|
249
|
+
createUseGoalDrafts: () => createUseGoalDrafts,
|
|
244
250
|
createUseGoalModels: () => createUseGoalModels,
|
|
245
251
|
createUseNotificationStore: () => createUseNotificationStore,
|
|
246
252
|
createUseNotifications: () => createUseNotifications,
|
|
@@ -287,6 +293,7 @@ __export(src_exports, {
|
|
|
287
293
|
goalModelsApiResponseSchema: () => goalModelsApiResponseSchema,
|
|
288
294
|
goalsHistoryApiResponseSchema: () => goalsHistoryApiResponseSchema,
|
|
289
295
|
handleActivityFetchError: () => handleActivityFetchError,
|
|
296
|
+
handleGoalDraftFetchError: () => handleGoalDraftFetchError,
|
|
290
297
|
handleGoalFetchError: () => handleGoalFetchError,
|
|
291
298
|
handleGoalModelFetchError: () => handleGoalModelFetchError,
|
|
292
299
|
handleLessonDetailsFetchError: () => handleLessonDetailsFetchError,
|
|
@@ -295,6 +302,8 @@ __export(src_exports, {
|
|
|
295
302
|
isChatUserInfoValid: () => isChatUserInfoValid,
|
|
296
303
|
isDeadlinePassed: () => isDeadlinePassed,
|
|
297
304
|
isFormValid: () => isFormValid,
|
|
305
|
+
isLessonExpired: () => isLessonExpired,
|
|
306
|
+
isLessonNotYetAvailable: () => isLessonNotYetAvailable,
|
|
298
307
|
isStepValid: () => isStepValid,
|
|
299
308
|
mapActivityStatusToDisplay: () => mapActivityStatusToDisplay,
|
|
300
309
|
mapApiStatusToInternal: () => mapApiStatusToInternal,
|
|
@@ -23475,6 +23484,53 @@ var LessonPreview = ({
|
|
|
23475
23484
|
] });
|
|
23476
23485
|
};
|
|
23477
23486
|
|
|
23487
|
+
// src/types/lessonAvailability.ts
|
|
23488
|
+
var LESSON_AVAILABILITY = {
|
|
23489
|
+
/** Lesson is available for access */
|
|
23490
|
+
DISPONIVEL: "DISPONIVEL",
|
|
23491
|
+
/** Lesson has not started yet (current date < startDate) */
|
|
23492
|
+
NAO_INICIADA: "NAO_INICIADA",
|
|
23493
|
+
/** Lesson has expired (current date > finalDate) */
|
|
23494
|
+
EXPIRADA: "EXPIRADA"
|
|
23495
|
+
};
|
|
23496
|
+
|
|
23497
|
+
// src/utils/lessonAvailabilityUtils.ts
|
|
23498
|
+
var isDateInPast = (dateString) => {
|
|
23499
|
+
const date = new Date(dateString);
|
|
23500
|
+
const now = /* @__PURE__ */ new Date();
|
|
23501
|
+
return now > date;
|
|
23502
|
+
};
|
|
23503
|
+
var isDateInFuture = (dateString) => {
|
|
23504
|
+
const date = new Date(dateString);
|
|
23505
|
+
const now = /* @__PURE__ */ new Date();
|
|
23506
|
+
return now < date;
|
|
23507
|
+
};
|
|
23508
|
+
var checkLessonAvailability = (startDate, finalDate) => {
|
|
23509
|
+
const start = startDate ? new Date(startDate) : null;
|
|
23510
|
+
const end = finalDate ? new Date(finalDate) : null;
|
|
23511
|
+
let status = LESSON_AVAILABILITY.DISPONIVEL;
|
|
23512
|
+
if (startDate && isDateInFuture(startDate)) {
|
|
23513
|
+
status = LESSON_AVAILABILITY.NAO_INICIADA;
|
|
23514
|
+
} else if (finalDate && isDateInPast(finalDate)) {
|
|
23515
|
+
status = LESSON_AVAILABILITY.EXPIRADA;
|
|
23516
|
+
}
|
|
23517
|
+
return {
|
|
23518
|
+
status,
|
|
23519
|
+
startDate: start,
|
|
23520
|
+
endDate: end,
|
|
23521
|
+
formattedStartDate: startDate ? formatDateToBrazilian(startDate) : null,
|
|
23522
|
+
formattedEndDate: finalDate ? formatDateToBrazilian(finalDate) : null
|
|
23523
|
+
};
|
|
23524
|
+
};
|
|
23525
|
+
var isLessonNotYetAvailable = (startDate) => {
|
|
23526
|
+
if (!startDate) return false;
|
|
23527
|
+
return isDateInFuture(startDate);
|
|
23528
|
+
};
|
|
23529
|
+
var isLessonExpired = (finalDate) => {
|
|
23530
|
+
if (!finalDate) return false;
|
|
23531
|
+
return isDateInPast(finalDate);
|
|
23532
|
+
};
|
|
23533
|
+
|
|
23478
23534
|
// src/components/ActivityDetails/ActivityDetails.tsx
|
|
23479
23535
|
var import_react71 = require("react");
|
|
23480
23536
|
var import_phosphor_react48 = require("phosphor-react");
|
|
@@ -26221,7 +26277,7 @@ var SendLessonModal = ({
|
|
|
26221
26277
|
var SendLessonModal_default = SendLessonModal;
|
|
26222
26278
|
|
|
26223
26279
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
26224
|
-
var
|
|
26280
|
+
var import_react83 = require("react");
|
|
26225
26281
|
var import_phosphor_react52 = require("phosphor-react");
|
|
26226
26282
|
|
|
26227
26283
|
// src/types/recommendedLessons.ts
|
|
@@ -26827,8 +26883,161 @@ var GoalModelsTab = ({
|
|
|
26827
26883
|
}
|
|
26828
26884
|
);
|
|
26829
26885
|
|
|
26830
|
-
// src/components/RecommendedLessonsHistory/
|
|
26886
|
+
// src/components/RecommendedLessonsHistory/config/draftsFiltersConfig.ts
|
|
26887
|
+
var getSubjectOptions2 = (data) => {
|
|
26888
|
+
if (!data?.subjects) return [];
|
|
26889
|
+
return data.subjects.map((subject) => ({
|
|
26890
|
+
id: subject.id,
|
|
26891
|
+
name: subject.name
|
|
26892
|
+
}));
|
|
26893
|
+
};
|
|
26894
|
+
var createGoalDraftsFiltersConfig = (userData) => [
|
|
26895
|
+
{
|
|
26896
|
+
key: "content",
|
|
26897
|
+
label: "CONTE\xDADO",
|
|
26898
|
+
categories: [
|
|
26899
|
+
{
|
|
26900
|
+
key: "subject",
|
|
26901
|
+
label: "Mat\xE9ria",
|
|
26902
|
+
selectedIds: [],
|
|
26903
|
+
itens: getSubjectOptions2(userData)
|
|
26904
|
+
}
|
|
26905
|
+
]
|
|
26906
|
+
}
|
|
26907
|
+
];
|
|
26908
|
+
|
|
26909
|
+
// src/hooks/useGoalDrafts.ts
|
|
26910
|
+
var import_react82 = require("react");
|
|
26911
|
+
var DEFAULT_GOAL_DRAFTS_PAGINATION = {
|
|
26912
|
+
total: 0,
|
|
26913
|
+
page: 1,
|
|
26914
|
+
limit: 10,
|
|
26915
|
+
totalPages: 0
|
|
26916
|
+
};
|
|
26917
|
+
var handleGoalDraftFetchError = createFetchErrorHandler(
|
|
26918
|
+
"Erro ao validar dados de rascunhos de aulas",
|
|
26919
|
+
"Erro ao carregar rascunhos de aulas"
|
|
26920
|
+
);
|
|
26921
|
+
var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
26922
|
+
return () => {
|
|
26923
|
+
const [state, setState] = (0, import_react82.useState)({
|
|
26924
|
+
models: [],
|
|
26925
|
+
loading: false,
|
|
26926
|
+
error: null,
|
|
26927
|
+
pagination: DEFAULT_GOAL_DRAFTS_PAGINATION
|
|
26928
|
+
});
|
|
26929
|
+
const fetchModels = (0, import_react82.useCallback)(
|
|
26930
|
+
async (filters, subjectsMap) => {
|
|
26931
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
26932
|
+
try {
|
|
26933
|
+
const responseData = await fetchGoalDrafts(filters);
|
|
26934
|
+
const validatedData = goalModelsApiResponseSchema.parse(responseData);
|
|
26935
|
+
const tableItems = validatedData.data.drafts.map(
|
|
26936
|
+
(draft) => transformGoalModelToTableItem(draft, subjectsMap)
|
|
26937
|
+
);
|
|
26938
|
+
const limit = filters?.limit || 10;
|
|
26939
|
+
const page = filters?.page || 1;
|
|
26940
|
+
const total = validatedData.data.total;
|
|
26941
|
+
const totalPages = Math.ceil(total / limit);
|
|
26942
|
+
setState({
|
|
26943
|
+
models: tableItems,
|
|
26944
|
+
loading: false,
|
|
26945
|
+
error: null,
|
|
26946
|
+
pagination: {
|
|
26947
|
+
total,
|
|
26948
|
+
page,
|
|
26949
|
+
limit,
|
|
26950
|
+
totalPages
|
|
26951
|
+
}
|
|
26952
|
+
});
|
|
26953
|
+
} catch (error) {
|
|
26954
|
+
const errorMessage = handleGoalDraftFetchError(error);
|
|
26955
|
+
setState((prev) => ({
|
|
26956
|
+
...prev,
|
|
26957
|
+
loading: false,
|
|
26958
|
+
error: errorMessage
|
|
26959
|
+
}));
|
|
26960
|
+
}
|
|
26961
|
+
},
|
|
26962
|
+
[fetchGoalDrafts]
|
|
26963
|
+
);
|
|
26964
|
+
const deleteModel = (0, import_react82.useCallback)(
|
|
26965
|
+
async (id) => {
|
|
26966
|
+
try {
|
|
26967
|
+
await deleteGoalDraft(id);
|
|
26968
|
+
return true;
|
|
26969
|
+
} catch (error) {
|
|
26970
|
+
console.error("Erro ao deletar rascunho:", error);
|
|
26971
|
+
return false;
|
|
26972
|
+
}
|
|
26973
|
+
},
|
|
26974
|
+
[deleteGoalDraft]
|
|
26975
|
+
);
|
|
26976
|
+
return {
|
|
26977
|
+
...state,
|
|
26978
|
+
fetchModels,
|
|
26979
|
+
deleteModel
|
|
26980
|
+
};
|
|
26981
|
+
};
|
|
26982
|
+
};
|
|
26983
|
+
var createGoalDraftsHook = createUseGoalDrafts;
|
|
26984
|
+
|
|
26985
|
+
// src/components/RecommendedLessonsHistory/tabs/DraftsTab.tsx
|
|
26831
26986
|
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
26987
|
+
var GOAL_DRAFTS_CONFIG = {
|
|
26988
|
+
entityName: "rascunho",
|
|
26989
|
+
entityNamePlural: "rascunhos",
|
|
26990
|
+
testId: "goal-drafts-tab",
|
|
26991
|
+
emptyStateTitle: "Voc\xEA n\xE3o tem aulas recomendadas em rascunho",
|
|
26992
|
+
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!",
|
|
26993
|
+
searchPlaceholder: "Buscar rascunho"
|
|
26994
|
+
};
|
|
26995
|
+
var GOAL_DRAFTS_COLUMNS_CONFIG = {
|
|
26996
|
+
sendButtonLabel: "Enviar aula",
|
|
26997
|
+
sendButtonAriaLabel: "Enviar rascunho",
|
|
26998
|
+
deleteButtonAriaLabel: "Deletar rascunho",
|
|
26999
|
+
editButtonAriaLabel: "Editar rascunho"
|
|
27000
|
+
};
|
|
27001
|
+
var GoalDraftsTab = ({
|
|
27002
|
+
fetchGoalDrafts,
|
|
27003
|
+
deleteGoalDraft,
|
|
27004
|
+
onCreateDraft,
|
|
27005
|
+
onSendDraft,
|
|
27006
|
+
onEditDraft,
|
|
27007
|
+
emptyStateImage,
|
|
27008
|
+
noSearchImage,
|
|
27009
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
27010
|
+
userFilterData,
|
|
27011
|
+
subjectsMap
|
|
27012
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
27013
|
+
ModelsTabBase,
|
|
27014
|
+
{
|
|
27015
|
+
fetchModels: fetchGoalDrafts,
|
|
27016
|
+
deleteModel: deleteGoalDraft,
|
|
27017
|
+
onCreateModel: onCreateDraft,
|
|
27018
|
+
onSend: onSendDraft,
|
|
27019
|
+
onEditModel: onEditDraft,
|
|
27020
|
+
emptyStateImage,
|
|
27021
|
+
noSearchImage,
|
|
27022
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
27023
|
+
userFilterData,
|
|
27024
|
+
subjectsMap,
|
|
27025
|
+
config: GOAL_DRAFTS_CONFIG,
|
|
27026
|
+
createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
|
|
27027
|
+
mapSubject,
|
|
27028
|
+
send,
|
|
27029
|
+
edit,
|
|
27030
|
+
del,
|
|
27031
|
+
GOAL_DRAFTS_COLUMNS_CONFIG
|
|
27032
|
+
),
|
|
27033
|
+
createFiltersConfig: createGoalDraftsFiltersConfig,
|
|
27034
|
+
buildFiltersFromParams: buildGoalModelsFiltersFromParams,
|
|
27035
|
+
createUseModels: createUseGoalDrafts
|
|
27036
|
+
}
|
|
27037
|
+
);
|
|
27038
|
+
|
|
27039
|
+
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
27040
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
26832
27041
|
var GoalPageTab = /* @__PURE__ */ ((GoalPageTab2) => {
|
|
26833
27042
|
GoalPageTab2["HISTORY"] = "history";
|
|
26834
27043
|
GoalPageTab2["DRAFTS"] = "drafts";
|
|
@@ -26874,7 +27083,7 @@ var getSchoolOptions = (data) => {
|
|
|
26874
27083
|
name: school.name
|
|
26875
27084
|
}));
|
|
26876
27085
|
};
|
|
26877
|
-
var
|
|
27086
|
+
var getSubjectOptions3 = (data) => {
|
|
26878
27087
|
if (!data?.subjects) return [];
|
|
26879
27088
|
return data.subjects.map((subject) => ({
|
|
26880
27089
|
id: subject.id,
|
|
@@ -26940,7 +27149,7 @@ var createGoalFiltersConfig = (userData) => [
|
|
|
26940
27149
|
key: "subject",
|
|
26941
27150
|
label: "Mat\xE9ria",
|
|
26942
27151
|
selectedIds: [],
|
|
26943
|
-
itens:
|
|
27152
|
+
itens: getSubjectOptions3(userData)
|
|
26944
27153
|
},
|
|
26945
27154
|
{
|
|
26946
27155
|
key: "theme",
|
|
@@ -26993,7 +27202,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
26993
27202
|
className: "max-w-[200px] truncate",
|
|
26994
27203
|
render: (value) => {
|
|
26995
27204
|
const title = typeof value === "string" ? value : "";
|
|
26996
|
-
return /* @__PURE__ */ (0,
|
|
27205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "sm", title, children: title });
|
|
26997
27206
|
}
|
|
26998
27207
|
},
|
|
26999
27208
|
{
|
|
@@ -27003,7 +27212,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27003
27212
|
className: "max-w-[150px] truncate",
|
|
27004
27213
|
render: (value) => {
|
|
27005
27214
|
const school = typeof value === "string" ? value : "";
|
|
27006
|
-
return /* @__PURE__ */ (0,
|
|
27215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "sm", title: school, children: school });
|
|
27007
27216
|
}
|
|
27008
27217
|
},
|
|
27009
27218
|
{
|
|
@@ -27020,11 +27229,11 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27020
27229
|
const subjectName = typeof value === "string" ? value : "";
|
|
27021
27230
|
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
27022
27231
|
if (!subjectEnum) {
|
|
27023
|
-
return /* @__PURE__ */ (0,
|
|
27232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
27024
27233
|
}
|
|
27025
27234
|
const subjectInfo = getSubjectInfo(subjectEnum);
|
|
27026
|
-
return /* @__PURE__ */ (0,
|
|
27027
|
-
/* @__PURE__ */ (0,
|
|
27235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center gap-2", title: subjectName, children: [
|
|
27236
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27028
27237
|
"span",
|
|
27029
27238
|
{
|
|
27030
27239
|
className: cn(
|
|
@@ -27034,7 +27243,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27034
27243
|
children: subjectInfo.icon
|
|
27035
27244
|
}
|
|
27036
27245
|
),
|
|
27037
|
-
/* @__PURE__ */ (0,
|
|
27246
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "sm", className: "truncate", children: subjectName })
|
|
27038
27247
|
] });
|
|
27039
27248
|
}
|
|
27040
27249
|
},
|
|
@@ -27050,9 +27259,9 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27050
27259
|
render: (value) => {
|
|
27051
27260
|
const status = typeof value === "string" ? value : "";
|
|
27052
27261
|
if (!status) {
|
|
27053
|
-
return /* @__PURE__ */ (0,
|
|
27262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text_default, { size: "sm", color: "text-text-500", children: "-" });
|
|
27054
27263
|
}
|
|
27055
|
-
return /* @__PURE__ */ (0,
|
|
27264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27056
27265
|
Badge_default,
|
|
27057
27266
|
{
|
|
27058
27267
|
variant: "solid",
|
|
@@ -27067,7 +27276,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27067
27276
|
key: "completionPercentage",
|
|
27068
27277
|
label: "Conclus\xE3o",
|
|
27069
27278
|
sortable: true,
|
|
27070
|
-
render: (value) => /* @__PURE__ */ (0,
|
|
27279
|
+
render: (value) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27071
27280
|
ProgressBar_default,
|
|
27072
27281
|
{
|
|
27073
27282
|
value: Number(value),
|
|
@@ -27093,20 +27302,20 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27093
27302
|
e.stopPropagation();
|
|
27094
27303
|
onEditGoal?.(row.id);
|
|
27095
27304
|
};
|
|
27096
|
-
return /* @__PURE__ */ (0,
|
|
27097
|
-
/* @__PURE__ */ (0,
|
|
27305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex justify-center gap-2", children: [
|
|
27306
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27098
27307
|
IconButton_default,
|
|
27099
27308
|
{
|
|
27100
|
-
icon: /* @__PURE__ */ (0,
|
|
27309
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_phosphor_react52.Trash, { size: 20 }),
|
|
27101
27310
|
size: "sm",
|
|
27102
27311
|
title: "Excluir",
|
|
27103
27312
|
onClick: handleDelete
|
|
27104
27313
|
}
|
|
27105
27314
|
),
|
|
27106
|
-
/* @__PURE__ */ (0,
|
|
27315
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27107
27316
|
IconButton_default,
|
|
27108
27317
|
{
|
|
27109
|
-
icon: /* @__PURE__ */ (0,
|
|
27318
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_phosphor_react52.PencilSimple, { size: 20 }),
|
|
27110
27319
|
size: "sm",
|
|
27111
27320
|
title: "Editar",
|
|
27112
27321
|
onClick: handleEdit
|
|
@@ -27120,7 +27329,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
|
|
|
27120
27329
|
label: "",
|
|
27121
27330
|
sortable: false,
|
|
27122
27331
|
className: "w-12",
|
|
27123
|
-
render: () => /* @__PURE__ */ (0,
|
|
27332
|
+
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
27333
|
}
|
|
27125
27334
|
];
|
|
27126
27335
|
var RecommendedLessonsHistory = ({
|
|
@@ -27142,18 +27351,22 @@ var RecommendedLessonsHistory = ({
|
|
|
27142
27351
|
onSendLesson,
|
|
27143
27352
|
onEditModel,
|
|
27144
27353
|
subjectsMap,
|
|
27354
|
+
fetchGoalDrafts,
|
|
27355
|
+
deleteGoalDraft,
|
|
27356
|
+
onSendDraft,
|
|
27357
|
+
onEditDraft,
|
|
27145
27358
|
defaultTab,
|
|
27146
27359
|
onTabChange
|
|
27147
27360
|
}) => {
|
|
27148
|
-
const [activeTab, setActiveTab] = (0,
|
|
27361
|
+
const [activeTab, setActiveTab] = (0, import_react83.useState)(
|
|
27149
27362
|
defaultTab ?? "history" /* HISTORY */
|
|
27150
27363
|
);
|
|
27151
|
-
(0,
|
|
27364
|
+
(0, import_react83.useEffect)(() => {
|
|
27152
27365
|
if (defaultTab !== void 0) {
|
|
27153
27366
|
setActiveTab(defaultTab);
|
|
27154
27367
|
}
|
|
27155
27368
|
}, [defaultTab]);
|
|
27156
|
-
const handleTabChange = (0,
|
|
27369
|
+
const handleTabChange = (0, import_react83.useCallback)(
|
|
27157
27370
|
(value) => {
|
|
27158
27371
|
const newTab = value;
|
|
27159
27372
|
setActiveTab(newTab);
|
|
@@ -27161,9 +27374,9 @@ var RecommendedLessonsHistory = ({
|
|
|
27161
27374
|
},
|
|
27162
27375
|
[onTabChange]
|
|
27163
27376
|
);
|
|
27164
|
-
const fetchGoalsHistoryRef = (0,
|
|
27377
|
+
const fetchGoalsHistoryRef = (0, import_react83.useRef)(fetchGoalsHistory);
|
|
27165
27378
|
fetchGoalsHistoryRef.current = fetchGoalsHistory;
|
|
27166
|
-
const useGoalsHistory = (0,
|
|
27379
|
+
const useGoalsHistory = (0, import_react83.useMemo)(
|
|
27167
27380
|
() => createUseRecommendedLessonsHistory(
|
|
27168
27381
|
(filters) => fetchGoalsHistoryRef.current(filters)
|
|
27169
27382
|
),
|
|
@@ -27176,31 +27389,31 @@ var RecommendedLessonsHistory = ({
|
|
|
27176
27389
|
pagination,
|
|
27177
27390
|
fetchGoals
|
|
27178
27391
|
} = useGoalsHistory();
|
|
27179
|
-
const initialFilterConfigs = (0,
|
|
27392
|
+
const initialFilterConfigs = (0, import_react83.useMemo)(
|
|
27180
27393
|
() => createGoalFiltersConfig(userFilterData),
|
|
27181
27394
|
[userFilterData]
|
|
27182
27395
|
);
|
|
27183
|
-
const tableColumns = (0,
|
|
27396
|
+
const tableColumns = (0, import_react83.useMemo)(
|
|
27184
27397
|
() => createTableColumns2(mapSubjectNameToEnum2, onDeleteGoal, onEditGoal),
|
|
27185
27398
|
[mapSubjectNameToEnum2, onDeleteGoal, onEditGoal]
|
|
27186
27399
|
);
|
|
27187
|
-
const handleParamsChange = (0,
|
|
27400
|
+
const handleParamsChange = (0, import_react83.useCallback)(
|
|
27188
27401
|
(params) => {
|
|
27189
27402
|
const filters = buildFiltersFromParams(params);
|
|
27190
27403
|
fetchGoals(filters);
|
|
27191
27404
|
},
|
|
27192
27405
|
[fetchGoals]
|
|
27193
27406
|
);
|
|
27194
|
-
return /* @__PURE__ */ (0,
|
|
27407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
27195
27408
|
"div",
|
|
27196
27409
|
{
|
|
27197
27410
|
"data-testid": "recommended-lessons-history",
|
|
27198
27411
|
className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
|
|
27199
27412
|
children: [
|
|
27200
|
-
/* @__PURE__ */ (0,
|
|
27201
|
-
/* @__PURE__ */ (0,
|
|
27202
|
-
/* @__PURE__ */ (0,
|
|
27203
|
-
/* @__PURE__ */ (0,
|
|
27413
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
|
|
27414
|
+
/* @__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: [
|
|
27415
|
+
/* @__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: [
|
|
27416
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27204
27417
|
Text_default,
|
|
27205
27418
|
{
|
|
27206
27419
|
as: "h1",
|
|
@@ -27209,7 +27422,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27209
27422
|
children: title
|
|
27210
27423
|
}
|
|
27211
27424
|
),
|
|
27212
|
-
/* @__PURE__ */ (0,
|
|
27425
|
+
/* @__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
27426
|
Menu,
|
|
27214
27427
|
{
|
|
27215
27428
|
defaultValue: "history" /* HISTORY */,
|
|
@@ -27217,13 +27430,13 @@ var RecommendedLessonsHistory = ({
|
|
|
27217
27430
|
onValueChange: handleTabChange,
|
|
27218
27431
|
variant: "menu2",
|
|
27219
27432
|
className: "bg-transparent shadow-none px-0",
|
|
27220
|
-
children: /* @__PURE__ */ (0,
|
|
27433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
27221
27434
|
MenuContent,
|
|
27222
27435
|
{
|
|
27223
27436
|
variant: "menu2",
|
|
27224
27437
|
className: "w-full lg:w-auto max-w-full min-w-0",
|
|
27225
27438
|
children: [
|
|
27226
|
-
/* @__PURE__ */ (0,
|
|
27439
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27227
27440
|
MenuItem,
|
|
27228
27441
|
{
|
|
27229
27442
|
variant: "menu2",
|
|
@@ -27233,7 +27446,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27233
27446
|
children: "Hist\xF3rico"
|
|
27234
27447
|
}
|
|
27235
27448
|
),
|
|
27236
|
-
/* @__PURE__ */ (0,
|
|
27449
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27237
27450
|
MenuItem,
|
|
27238
27451
|
{
|
|
27239
27452
|
variant: "menu2",
|
|
@@ -27243,7 +27456,7 @@ var RecommendedLessonsHistory = ({
|
|
|
27243
27456
|
children: "Rascunhos"
|
|
27244
27457
|
}
|
|
27245
27458
|
),
|
|
27246
|
-
/* @__PURE__ */ (0,
|
|
27459
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27247
27460
|
MenuItem,
|
|
27248
27461
|
{
|
|
27249
27462
|
variant: "menu2",
|
|
@@ -27259,8 +27472,8 @@ var RecommendedLessonsHistory = ({
|
|
|
27259
27472
|
}
|
|
27260
27473
|
) })
|
|
27261
27474
|
] }),
|
|
27262
|
-
/* @__PURE__ */ (0,
|
|
27263
|
-
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0,
|
|
27475
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
|
|
27476
|
+
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
27477
|
TableProvider,
|
|
27265
27478
|
{
|
|
27266
27479
|
data: goals,
|
|
@@ -27285,14 +27498,14 @@ var RecommendedLessonsHistory = ({
|
|
|
27285
27498
|
image: noSearchImage
|
|
27286
27499
|
},
|
|
27287
27500
|
emptyState: {
|
|
27288
|
-
component: /* @__PURE__ */ (0,
|
|
27501
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27289
27502
|
EmptyState_default,
|
|
27290
27503
|
{
|
|
27291
27504
|
image: emptyStateImage,
|
|
27292
27505
|
title: "Crie uma nova aula",
|
|
27293
27506
|
description: "Selecione um conjunto de aulas organizadas por tema e ajude seus alunos a estudarem de forma estruturada e eficiente!",
|
|
27294
27507
|
buttonText: createButtonText,
|
|
27295
|
-
buttonIcon: /* @__PURE__ */ (0,
|
|
27508
|
+
buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_phosphor_react52.Plus, { size: 18 }),
|
|
27296
27509
|
buttonVariant: "outline",
|
|
27297
27510
|
buttonAction: "primary",
|
|
27298
27511
|
onButtonClick: onCreateLesson
|
|
@@ -27307,22 +27520,22 @@ var RecommendedLessonsHistory = ({
|
|
|
27307
27520
|
table,
|
|
27308
27521
|
pagination: paginationComponent
|
|
27309
27522
|
} = renderProps;
|
|
27310
|
-
return /* @__PURE__ */ (0,
|
|
27311
|
-
/* @__PURE__ */ (0,
|
|
27312
|
-
/* @__PURE__ */ (0,
|
|
27523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "space-y-4", children: [
|
|
27524
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
27525
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27313
27526
|
Button_default,
|
|
27314
27527
|
{
|
|
27315
27528
|
variant: "solid",
|
|
27316
27529
|
action: "primary",
|
|
27317
27530
|
size: "medium",
|
|
27318
27531
|
onClick: onCreateLesson,
|
|
27319
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
27532
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_phosphor_react52.Plus, { size: 18, weight: "bold" }),
|
|
27320
27533
|
children: createButtonText
|
|
27321
27534
|
}
|
|
27322
27535
|
),
|
|
27323
27536
|
controls
|
|
27324
27537
|
] }),
|
|
27325
|
-
/* @__PURE__ */ (0,
|
|
27538
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
|
|
27326
27539
|
table,
|
|
27327
27540
|
paginationComponent
|
|
27328
27541
|
] })
|
|
@@ -27330,8 +27543,22 @@ var RecommendedLessonsHistory = ({
|
|
|
27330
27543
|
}
|
|
27331
27544
|
}
|
|
27332
27545
|
) }) }),
|
|
27333
|
-
activeTab === "drafts" /* DRAFTS */ &&
|
|
27334
|
-
|
|
27546
|
+
activeTab === "drafts" /* DRAFTS */ && fetchGoalDrafts && deleteGoalDraft && onCreateLesson && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27547
|
+
GoalDraftsTab,
|
|
27548
|
+
{
|
|
27549
|
+
fetchGoalDrafts,
|
|
27550
|
+
deleteGoalDraft,
|
|
27551
|
+
onCreateDraft: onCreateLesson,
|
|
27552
|
+
onSendDraft,
|
|
27553
|
+
onEditDraft,
|
|
27554
|
+
emptyStateImage,
|
|
27555
|
+
noSearchImage,
|
|
27556
|
+
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
27557
|
+
userFilterData,
|
|
27558
|
+
subjectsMap
|
|
27559
|
+
}
|
|
27560
|
+
),
|
|
27561
|
+
activeTab === "models" /* MODELS */ && fetchGoalModels && deleteGoalModel && onCreateModel && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
27335
27562
|
GoalModelsTab,
|
|
27336
27563
|
{
|
|
27337
27564
|
fetchGoalModels,
|
|
@@ -27354,19 +27581,19 @@ var RecommendedLessonsHistory = ({
|
|
|
27354
27581
|
};
|
|
27355
27582
|
|
|
27356
27583
|
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
27357
|
-
var
|
|
27584
|
+
var import_react91 = require("react");
|
|
27358
27585
|
|
|
27359
27586
|
// src/components/RecommendedLessonDetails/components/Breadcrumb.tsx
|
|
27360
|
-
var
|
|
27361
|
-
var
|
|
27362
|
-
var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ (0,
|
|
27587
|
+
var import_react84 = require("@phosphor-icons/react");
|
|
27588
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
27589
|
+
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
27590
|
Text_default,
|
|
27364
27591
|
{
|
|
27365
27592
|
as: "span",
|
|
27366
27593
|
className: "flex items-center gap-2",
|
|
27367
27594
|
children: [
|
|
27368
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
27369
|
-
item.path ? /* @__PURE__ */ (0,
|
|
27595
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_react84.CaretRightIcon, { size: 14, className: "text-text-500" }),
|
|
27596
|
+
item.path ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
27370
27597
|
"button",
|
|
27371
27598
|
{
|
|
27372
27599
|
type: "button",
|
|
@@ -27374,14 +27601,14 @@ var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ (0, import_jsx_runt
|
|
|
27374
27601
|
className: "text-text-600 hover:text-primary-700 transition-colors",
|
|
27375
27602
|
children: item.label
|
|
27376
27603
|
}
|
|
27377
|
-
) : /* @__PURE__ */ (0,
|
|
27604
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Text_default, { as: "span", className: "text-text-950 font-medium", children: item.label })
|
|
27378
27605
|
]
|
|
27379
27606
|
},
|
|
27380
27607
|
item.path ?? item.label
|
|
27381
27608
|
)) });
|
|
27382
27609
|
|
|
27383
27610
|
// src/components/RecommendedLessonDetails/components/LessonHeader.tsx
|
|
27384
|
-
var
|
|
27611
|
+
var import_react85 = require("@phosphor-icons/react");
|
|
27385
27612
|
|
|
27386
27613
|
// src/components/RecommendedLessonDetails/utils/lessonDetailsUtils.ts
|
|
27387
27614
|
var formatDate = (dateString) => {
|
|
@@ -27403,7 +27630,7 @@ var transformStudentForDisplay = (student, deadline) => ({
|
|
|
27403
27630
|
});
|
|
27404
27631
|
|
|
27405
27632
|
// src/components/RecommendedLessonDetails/components/LessonHeader.tsx
|
|
27406
|
-
var
|
|
27633
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
27407
27634
|
var LessonHeader = ({
|
|
27408
27635
|
data,
|
|
27409
27636
|
onViewLesson,
|
|
@@ -27414,9 +27641,9 @@ var LessonHeader = ({
|
|
|
27414
27641
|
const subjectName = goal.lessonsGoals[0]?.supLessonsProgress?.lesson?.subject?.name || "";
|
|
27415
27642
|
const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
|
|
27416
27643
|
const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
|
|
27417
|
-
return /* @__PURE__ */ (0,
|
|
27418
|
-
/* @__PURE__ */ (0,
|
|
27419
|
-
/* @__PURE__ */ (0,
|
|
27644
|
+
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: [
|
|
27645
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
27646
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
27420
27647
|
Text_default,
|
|
27421
27648
|
{
|
|
27422
27649
|
as: "h1",
|
|
@@ -27426,24 +27653,24 @@ var LessonHeader = ({
|
|
|
27426
27653
|
children: goal.title
|
|
27427
27654
|
}
|
|
27428
27655
|
),
|
|
27429
|
-
/* @__PURE__ */ (0,
|
|
27430
|
-
/* @__PURE__ */ (0,
|
|
27656
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "flex flex-wrap items-center gap-2 text-sm text-text-600", children: [
|
|
27657
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
27431
27658
|
"In\xEDcio em ",
|
|
27432
27659
|
formatDate(goal.startDate)
|
|
27433
27660
|
] }),
|
|
27434
|
-
/* @__PURE__ */ (0,
|
|
27435
|
-
/* @__PURE__ */ (0,
|
|
27661
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27662
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
|
|
27436
27663
|
"Prazo final ",
|
|
27437
27664
|
formatDate(goal.finalDate)
|
|
27438
27665
|
] }),
|
|
27439
|
-
breakdown?.schoolName && /* @__PURE__ */ (0,
|
|
27440
|
-
/* @__PURE__ */ (0,
|
|
27441
|
-
/* @__PURE__ */ (0,
|
|
27666
|
+
breakdown?.schoolName && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
27667
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27668
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.schoolName })
|
|
27442
27669
|
] }),
|
|
27443
|
-
subjectName && /* @__PURE__ */ (0,
|
|
27444
|
-
/* @__PURE__ */ (0,
|
|
27445
|
-
/* @__PURE__ */ (0,
|
|
27446
|
-
subjectInfo && /* @__PURE__ */ (0,
|
|
27670
|
+
subjectName && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
27671
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27672
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text_default, { as: "span", size: "sm", className: "flex items-center gap-1", children: [
|
|
27673
|
+
subjectInfo && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
27447
27674
|
Text_default,
|
|
27448
27675
|
{
|
|
27449
27676
|
as: "span",
|
|
@@ -27457,19 +27684,19 @@ var LessonHeader = ({
|
|
|
27457
27684
|
subjectName
|
|
27458
27685
|
] })
|
|
27459
27686
|
] }),
|
|
27460
|
-
breakdown?.className && /* @__PURE__ */ (0,
|
|
27461
|
-
/* @__PURE__ */ (0,
|
|
27462
|
-
/* @__PURE__ */ (0,
|
|
27687
|
+
breakdown?.className && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
27688
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
|
|
27689
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.className })
|
|
27463
27690
|
] })
|
|
27464
27691
|
] })
|
|
27465
27692
|
] }),
|
|
27466
|
-
onViewLesson && /* @__PURE__ */ (0,
|
|
27693
|
+
onViewLesson && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
27467
27694
|
Button_default,
|
|
27468
27695
|
{
|
|
27469
27696
|
variant: "solid",
|
|
27470
27697
|
action: "primary",
|
|
27471
27698
|
size: "small",
|
|
27472
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
27699
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_react85.BookBookmarkIcon, { size: 16 }),
|
|
27473
27700
|
onClick: onViewLesson,
|
|
27474
27701
|
children: viewLessonLabel
|
|
27475
27702
|
}
|
|
@@ -27478,34 +27705,34 @@ var LessonHeader = ({
|
|
|
27478
27705
|
};
|
|
27479
27706
|
|
|
27480
27707
|
// 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,
|
|
27708
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
27709
|
+
var LoadingSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
27710
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonText, { width: 256 }),
|
|
27711
|
+
/* @__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: [
|
|
27712
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonText, { width: "75%", height: 28 }),
|
|
27713
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonText, { width: "50%" })
|
|
27487
27714
|
] }) }),
|
|
27488
|
-
/* @__PURE__ */ (0,
|
|
27489
|
-
/* @__PURE__ */ (0,
|
|
27490
|
-
/* @__PURE__ */ (0,
|
|
27491
|
-
/* @__PURE__ */ (0,
|
|
27492
|
-
/* @__PURE__ */ (0,
|
|
27493
|
-
/* @__PURE__ */ (0,
|
|
27715
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
27716
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonText, { width: 192, height: 20 }),
|
|
27717
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
|
|
27718
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonRounded, { height: 140 }),
|
|
27719
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonRounded, { height: 140 }),
|
|
27720
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(SkeletonRounded, { height: 140 })
|
|
27494
27721
|
] })
|
|
27495
27722
|
] }),
|
|
27496
|
-
/* @__PURE__ */ (0,
|
|
27723
|
+
/* @__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
27724
|
] });
|
|
27498
27725
|
|
|
27499
27726
|
// src/components/RecommendedLessonDetails/components/ResultsSection.tsx
|
|
27500
|
-
var
|
|
27501
|
-
var
|
|
27727
|
+
var import_react86 = require("@phosphor-icons/react");
|
|
27728
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
27502
27729
|
var ResultsSection = ({ data, labels }) => {
|
|
27503
27730
|
const { details } = data;
|
|
27504
27731
|
const { aggregated, contentPerformance } = details;
|
|
27505
|
-
return /* @__PURE__ */ (0,
|
|
27506
|
-
/* @__PURE__ */ (0,
|
|
27507
|
-
/* @__PURE__ */ (0,
|
|
27508
|
-
/* @__PURE__ */ (0,
|
|
27732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
27733
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Text_default, { as: "h2", size: "md", weight: "semibold", className: "text-text-950", children: labels.resultsTitle }),
|
|
27734
|
+
/* @__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: [
|
|
27735
|
+
/* @__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
27736
|
ProgressCircle_default,
|
|
27510
27737
|
{
|
|
27511
27738
|
value: aggregated.completionPercentage,
|
|
@@ -27515,16 +27742,16 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27515
27742
|
showPercentage: true
|
|
27516
27743
|
}
|
|
27517
27744
|
) }),
|
|
27518
|
-
/* @__PURE__ */ (0,
|
|
27519
|
-
/* @__PURE__ */ (0,
|
|
27745
|
+
/* @__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: [
|
|
27746
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27520
27747
|
Text_default,
|
|
27521
27748
|
{
|
|
27522
27749
|
as: "span",
|
|
27523
27750
|
className: "size-8 rounded-full flex items-center justify-center bg-warning-300 mb-2",
|
|
27524
|
-
children: /* @__PURE__ */ (0,
|
|
27751
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_react86.TrophyIcon, { size: 18, weight: "fill", className: "text-white" })
|
|
27525
27752
|
}
|
|
27526
27753
|
),
|
|
27527
|
-
/* @__PURE__ */ (0,
|
|
27754
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27528
27755
|
Text_default,
|
|
27529
27756
|
{
|
|
27530
27757
|
size: "2xs",
|
|
@@ -27533,7 +27760,7 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27533
27760
|
children: labels.bestResultLabel
|
|
27534
27761
|
}
|
|
27535
27762
|
),
|
|
27536
|
-
/* @__PURE__ */ (0,
|
|
27763
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27537
27764
|
Text_default,
|
|
27538
27765
|
{
|
|
27539
27766
|
size: "xl",
|
|
@@ -27543,16 +27770,16 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27543
27770
|
}
|
|
27544
27771
|
)
|
|
27545
27772
|
] }),
|
|
27546
|
-
/* @__PURE__ */ (0,
|
|
27547
|
-
/* @__PURE__ */ (0,
|
|
27773
|
+
/* @__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: [
|
|
27774
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27548
27775
|
Text_default,
|
|
27549
27776
|
{
|
|
27550
27777
|
as: "span",
|
|
27551
27778
|
className: "size-8 rounded-full flex items-center justify-center bg-error-300 mb-2",
|
|
27552
|
-
children: /* @__PURE__ */ (0,
|
|
27779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_react86.WarningIcon, { size: 18, weight: "fill", className: "text-error-700" })
|
|
27553
27780
|
}
|
|
27554
27781
|
),
|
|
27555
|
-
/* @__PURE__ */ (0,
|
|
27782
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27556
27783
|
Text_default,
|
|
27557
27784
|
{
|
|
27558
27785
|
size: "2xs",
|
|
@@ -27561,7 +27788,7 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27561
27788
|
children: labels.hardestTopicLabel
|
|
27562
27789
|
}
|
|
27563
27790
|
),
|
|
27564
|
-
/* @__PURE__ */ (0,
|
|
27791
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
27565
27792
|
Text_default,
|
|
27566
27793
|
{
|
|
27567
27794
|
size: "xl",
|
|
@@ -27576,9 +27803,9 @@ var ResultsSection = ({ data, labels }) => {
|
|
|
27576
27803
|
};
|
|
27577
27804
|
|
|
27578
27805
|
// src/components/RecommendedLessonDetails/components/StudentsTable.tsx
|
|
27579
|
-
var
|
|
27580
|
-
var
|
|
27581
|
-
var
|
|
27806
|
+
var import_react87 = require("react");
|
|
27807
|
+
var import_react88 = require("@phosphor-icons/react");
|
|
27808
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
27582
27809
|
var StudentsTable = ({
|
|
27583
27810
|
students,
|
|
27584
27811
|
onViewPerformance,
|
|
@@ -27586,12 +27813,12 @@ var StudentsTable = ({
|
|
|
27586
27813
|
emptyMessage = "Nenhum aluno encontrado"
|
|
27587
27814
|
}) => {
|
|
27588
27815
|
const { sortedData, sortColumn, sortDirection, handleSort } = useTableSort(students);
|
|
27589
|
-
const canViewPerformance = (0,
|
|
27816
|
+
const canViewPerformance = (0, import_react87.useCallback)((student) => {
|
|
27590
27817
|
return student.status === "CONCLU\xCDDO" /* CONCLUIDO */ || student.status === "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
|
|
27591
27818
|
}, []);
|
|
27592
|
-
return /* @__PURE__ */ (0,
|
|
27593
|
-
/* @__PURE__ */ (0,
|
|
27594
|
-
/* @__PURE__ */ (0,
|
|
27819
|
+
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: [
|
|
27820
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(TableRow, { children: [
|
|
27821
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27595
27822
|
TableHead,
|
|
27596
27823
|
{
|
|
27597
27824
|
sortable: true,
|
|
@@ -27600,7 +27827,7 @@ var StudentsTable = ({
|
|
|
27600
27827
|
children: labels.studentColumn
|
|
27601
27828
|
}
|
|
27602
27829
|
),
|
|
27603
|
-
/* @__PURE__ */ (0,
|
|
27830
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27604
27831
|
TableHead,
|
|
27605
27832
|
{
|
|
27606
27833
|
sortable: true,
|
|
@@ -27609,7 +27836,7 @@ var StudentsTable = ({
|
|
|
27609
27836
|
children: labels.statusColumn
|
|
27610
27837
|
}
|
|
27611
27838
|
),
|
|
27612
|
-
/* @__PURE__ */ (0,
|
|
27839
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27613
27840
|
TableHead,
|
|
27614
27841
|
{
|
|
27615
27842
|
sortable: true,
|
|
@@ -27618,22 +27845,22 @@ var StudentsTable = ({
|
|
|
27618
27845
|
children: labels.completionColumn
|
|
27619
27846
|
}
|
|
27620
27847
|
),
|
|
27621
|
-
/* @__PURE__ */ (0,
|
|
27622
|
-
/* @__PURE__ */ (0,
|
|
27848
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableHead, { children: labels.durationColumn }),
|
|
27849
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableHead, { className: "w-[140px]" })
|
|
27623
27850
|
] }) }),
|
|
27624
|
-
/* @__PURE__ */ (0,
|
|
27625
|
-
/* @__PURE__ */ (0,
|
|
27626
|
-
/* @__PURE__ */ (0,
|
|
27851
|
+
/* @__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: [
|
|
27852
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
27853
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27627
27854
|
Text_default,
|
|
27628
27855
|
{
|
|
27629
27856
|
as: "span",
|
|
27630
27857
|
className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
|
|
27631
|
-
children: /* @__PURE__ */ (0,
|
|
27858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_react88.UserIcon, { size: 16, className: "text-text-500" })
|
|
27632
27859
|
}
|
|
27633
27860
|
),
|
|
27634
|
-
/* @__PURE__ */ (0,
|
|
27861
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Text_default, { size: "sm", className: "text-text-950", children: student.name })
|
|
27635
27862
|
] }) }),
|
|
27636
|
-
/* @__PURE__ */ (0,
|
|
27863
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27637
27864
|
Badge_default,
|
|
27638
27865
|
{
|
|
27639
27866
|
variant: "solid",
|
|
@@ -27642,12 +27869,12 @@ var StudentsTable = ({
|
|
|
27642
27869
|
children: student.status
|
|
27643
27870
|
}
|
|
27644
27871
|
) }),
|
|
27645
|
-
/* @__PURE__ */ (0,
|
|
27646
|
-
/* @__PURE__ */ (0,
|
|
27872
|
+
/* @__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: [
|
|
27873
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(Text_default, { size: "sm", className: "text-primary-700 font-medium", children: [
|
|
27647
27874
|
student.completionPercentage,
|
|
27648
27875
|
"%"
|
|
27649
27876
|
] }),
|
|
27650
|
-
/* @__PURE__ */ (0,
|
|
27877
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27651
27878
|
ProgressBar_default,
|
|
27652
27879
|
{
|
|
27653
27880
|
value: student.completionPercentage,
|
|
@@ -27657,8 +27884,8 @@ var StudentsTable = ({
|
|
|
27657
27884
|
}
|
|
27658
27885
|
)
|
|
27659
27886
|
] }) }),
|
|
27660
|
-
/* @__PURE__ */ (0,
|
|
27661
|
-
/* @__PURE__ */ (0,
|
|
27887
|
+
/* @__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 ?? "-" }) }),
|
|
27888
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TableCell, { children: canViewPerformance(student) ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
27662
27889
|
Button_default,
|
|
27663
27890
|
{
|
|
27664
27891
|
variant: "outline",
|
|
@@ -27666,14 +27893,14 @@ var StudentsTable = ({
|
|
|
27666
27893
|
onClick: () => onViewPerformance?.(student.id),
|
|
27667
27894
|
children: labels.viewPerformance
|
|
27668
27895
|
}
|
|
27669
|
-
) : /* @__PURE__ */ (0,
|
|
27896
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Button_default, { variant: "outline", size: "extra-small", disabled: true, children: labels.viewPerformance }) })
|
|
27670
27897
|
] }, student.id)) })
|
|
27671
27898
|
] }) });
|
|
27672
27899
|
};
|
|
27673
27900
|
|
|
27674
27901
|
// src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
|
|
27675
|
-
var
|
|
27676
|
-
var
|
|
27902
|
+
var import_react89 = require("react");
|
|
27903
|
+
var import_react90 = require("@phosphor-icons/react");
|
|
27677
27904
|
|
|
27678
27905
|
// src/components/RecommendedLessonDetails/types.ts
|
|
27679
27906
|
var DEFAULT_LABELS = {
|
|
@@ -27698,7 +27925,7 @@ var DEFAULT_PERFORMANCE_LABELS = {
|
|
|
27698
27925
|
};
|
|
27699
27926
|
|
|
27700
27927
|
// src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
|
|
27701
|
-
var
|
|
27928
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
27702
27929
|
var PerformanceCard = ({
|
|
27703
27930
|
icon,
|
|
27704
27931
|
label,
|
|
@@ -27723,13 +27950,13 @@ var PerformanceCard = ({
|
|
|
27723
27950
|
success: "text-success-600",
|
|
27724
27951
|
error: "text-error-600"
|
|
27725
27952
|
}[variant];
|
|
27726
|
-
return /* @__PURE__ */ (0,
|
|
27727
|
-
/* @__PURE__ */ (0,
|
|
27953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col rounded-xl border border-border-50 bg-background overflow-hidden", children: [
|
|
27954
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
27728
27955
|
"div",
|
|
27729
27956
|
{
|
|
27730
27957
|
className: `flex flex-col items-center justify-center p-4 gap-1 ${headerBgColor}`,
|
|
27731
27958
|
children: [
|
|
27732
|
-
/* @__PURE__ */ (0,
|
|
27959
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27733
27960
|
Text_default,
|
|
27734
27961
|
{
|
|
27735
27962
|
as: "span",
|
|
@@ -27737,7 +27964,7 @@ var PerformanceCard = ({
|
|
|
27737
27964
|
children: icon
|
|
27738
27965
|
}
|
|
27739
27966
|
),
|
|
27740
|
-
/* @__PURE__ */ (0,
|
|
27967
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27741
27968
|
Text_default,
|
|
27742
27969
|
{
|
|
27743
27970
|
size: "2xs",
|
|
@@ -27746,12 +27973,12 @@ var PerformanceCard = ({
|
|
|
27746
27973
|
children: label
|
|
27747
27974
|
}
|
|
27748
27975
|
),
|
|
27749
|
-
/* @__PURE__ */ (0,
|
|
27976
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "xl", weight: "bold", className: `${valueColor} text-center`, children: value })
|
|
27750
27977
|
]
|
|
27751
27978
|
}
|
|
27752
27979
|
),
|
|
27753
|
-
/* @__PURE__ */ (0,
|
|
27754
|
-
/* @__PURE__ */ (0,
|
|
27980
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col items-center gap-2 px-4 py-3", children: [
|
|
27981
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27755
27982
|
Text_default,
|
|
27756
27983
|
{
|
|
27757
27984
|
size: "2xs",
|
|
@@ -27760,7 +27987,7 @@ var PerformanceCard = ({
|
|
|
27760
27987
|
children: secondaryLabel
|
|
27761
27988
|
}
|
|
27762
27989
|
),
|
|
27763
|
-
/* @__PURE__ */ (0,
|
|
27990
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Badge_default, { size: "large", action: "info", children: secondaryValue || "-" })
|
|
27764
27991
|
] })
|
|
27765
27992
|
] });
|
|
27766
27993
|
};
|
|
@@ -27787,40 +28014,40 @@ var getSelectedValue = (question) => {
|
|
|
27787
28014
|
var QuestionAccordionItem = ({
|
|
27788
28015
|
question,
|
|
27789
28016
|
index
|
|
27790
|
-
}) => /* @__PURE__ */ (0,
|
|
28017
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27791
28018
|
CardAccordation,
|
|
27792
28019
|
{
|
|
27793
28020
|
value: question.id,
|
|
27794
28021
|
className: "bg-background rounded-xl border border-border-50",
|
|
27795
28022
|
triggerClassName: "py-5 px-5",
|
|
27796
28023
|
contentClassName: "px-5 pb-5",
|
|
27797
|
-
trigger: /* @__PURE__ */ (0,
|
|
27798
|
-
/* @__PURE__ */ (0,
|
|
28024
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex items-center justify-between flex-1", children: [
|
|
28025
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: [
|
|
27799
28026
|
"Quest\xE3o ",
|
|
27800
28027
|
index + 1
|
|
27801
28028
|
] }),
|
|
27802
|
-
/* @__PURE__ */ (0,
|
|
28029
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27803
28030
|
Badge_default,
|
|
27804
28031
|
{
|
|
27805
28032
|
size: "small",
|
|
27806
28033
|
action: question.isCorrect ? "success" : "error",
|
|
27807
28034
|
variant: "solid",
|
|
27808
|
-
iconLeft: question.isCorrect ? /* @__PURE__ */ (0,
|
|
28035
|
+
iconLeft: question.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_react90.CheckCircleIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_react90.XCircleIcon, {}),
|
|
27809
28036
|
children: question.isCorrect ? "Correta" : "Incorreta"
|
|
27810
28037
|
}
|
|
27811
28038
|
)
|
|
27812
28039
|
] }),
|
|
27813
|
-
children: /* @__PURE__ */ (0,
|
|
27814
|
-
/* @__PURE__ */ (0,
|
|
27815
|
-
/* @__PURE__ */ (0,
|
|
28040
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
28041
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "sm", className: "text-text-700", children: question.statement }),
|
|
28042
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27816
28043
|
CardAccordation,
|
|
27817
28044
|
{
|
|
27818
28045
|
value: `${question.id}-alternatives`,
|
|
27819
28046
|
className: "bg-background rounded-lg border border-border-50",
|
|
27820
28047
|
triggerClassName: "py-5 px-5",
|
|
27821
28048
|
contentClassName: "px-5 py-5",
|
|
27822
|
-
trigger: /* @__PURE__ */ (0,
|
|
27823
|
-
children: /* @__PURE__ */ (0,
|
|
28049
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "sm", weight: "medium", className: "text-text-800", children: "Alternativas" }),
|
|
28050
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27824
28051
|
AlternativesList,
|
|
27825
28052
|
{
|
|
27826
28053
|
mode: "readonly",
|
|
@@ -27834,16 +28061,16 @@ var QuestionAccordionItem = ({
|
|
|
27834
28061
|
] })
|
|
27835
28062
|
}
|
|
27836
28063
|
);
|
|
27837
|
-
var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0,
|
|
28064
|
+
var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27838
28065
|
CardAccordation,
|
|
27839
28066
|
{
|
|
27840
28067
|
value: lesson.id,
|
|
27841
28068
|
className: "bg-background rounded-xl border border-border-50",
|
|
27842
28069
|
triggerClassName: "py-5 px-5",
|
|
27843
28070
|
contentClassName: "px-5 pb-5",
|
|
27844
|
-
trigger: /* @__PURE__ */ (0,
|
|
27845
|
-
/* @__PURE__ */ (0,
|
|
27846
|
-
/* @__PURE__ */ (0,
|
|
28071
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-1 flex-1", children: [
|
|
28072
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: lesson.title }),
|
|
28073
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27847
28074
|
ProgressBar_default,
|
|
27848
28075
|
{
|
|
27849
28076
|
value: lesson.progress,
|
|
@@ -27854,7 +28081,7 @@ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0, import_jsx_runtime
|
|
|
27854
28081
|
}
|
|
27855
28082
|
)
|
|
27856
28083
|
] }),
|
|
27857
|
-
children: /* @__PURE__ */ (0,
|
|
28084
|
+
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
28085
|
QuestionAccordionItem,
|
|
27859
28086
|
{
|
|
27860
28087
|
question,
|
|
@@ -27864,45 +28091,45 @@ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0, import_jsx_runtime
|
|
|
27864
28091
|
)) })
|
|
27865
28092
|
}
|
|
27866
28093
|
);
|
|
27867
|
-
var LoadingSkeleton2 = () => /* @__PURE__ */ (0,
|
|
27868
|
-
/* @__PURE__ */ (0,
|
|
27869
|
-
/* @__PURE__ */ (0,
|
|
27870
|
-
/* @__PURE__ */ (0,
|
|
27871
|
-
/* @__PURE__ */ (0,
|
|
28094
|
+
var LoadingSkeleton2 = () => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-4 animate-pulse", children: [
|
|
28095
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "h-6 bg-background-200 rounded w-48" }),
|
|
28096
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
28097
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "h-44 bg-background-200 rounded-xl" }),
|
|
28098
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "h-44 bg-background-200 rounded-xl" })
|
|
27872
28099
|
] })
|
|
27873
28100
|
] });
|
|
27874
|
-
var ErrorContent = ({ message }) => /* @__PURE__ */ (0,
|
|
27875
|
-
/* @__PURE__ */ (0,
|
|
28101
|
+
var ErrorContent = ({ message }) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col items-center justify-center py-8 gap-3", children: [
|
|
28102
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27876
28103
|
Text_default,
|
|
27877
28104
|
{
|
|
27878
28105
|
as: "span",
|
|
27879
28106
|
className: "size-12 rounded-full bg-error-100 flex items-center justify-center",
|
|
27880
|
-
children: /* @__PURE__ */ (0,
|
|
28107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_react90.WarningCircleIcon, { size: 24, className: "text-error-700" })
|
|
27881
28108
|
}
|
|
27882
28109
|
),
|
|
27883
|
-
/* @__PURE__ */ (0,
|
|
28110
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "md", className: "text-error-700 text-center", children: message })
|
|
27884
28111
|
] });
|
|
27885
28112
|
var PerformanceContent = ({
|
|
27886
28113
|
data,
|
|
27887
28114
|
labels
|
|
27888
|
-
}) => /* @__PURE__ */ (0,
|
|
27889
|
-
/* @__PURE__ */ (0,
|
|
27890
|
-
/* @__PURE__ */ (0,
|
|
28115
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-5", children: [
|
|
28116
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
28117
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27891
28118
|
Text_default,
|
|
27892
28119
|
{
|
|
27893
28120
|
as: "span",
|
|
27894
28121
|
className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
|
|
27895
|
-
children: /* @__PURE__ */ (0,
|
|
28122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_react90.UserIcon, { size: 16, className: "text-text-500" })
|
|
27896
28123
|
}
|
|
27897
28124
|
),
|
|
27898
|
-
/* @__PURE__ */ (0,
|
|
28125
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "md", weight: "medium", className: "text-text-950", children: data.studentName })
|
|
27899
28126
|
] }),
|
|
27900
|
-
/* @__PURE__ */ (0,
|
|
27901
|
-
/* @__PURE__ */ (0,
|
|
28127
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
28128
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27902
28129
|
PerformanceCard,
|
|
27903
28130
|
{
|
|
27904
|
-
icon: /* @__PURE__ */ (0,
|
|
27905
|
-
|
|
28131
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
28132
|
+
import_react90.LightbulbFilamentIcon,
|
|
27906
28133
|
{
|
|
27907
28134
|
size: 18,
|
|
27908
28135
|
weight: "fill",
|
|
@@ -27916,11 +28143,11 @@ var PerformanceContent = ({
|
|
|
27916
28143
|
variant: "success"
|
|
27917
28144
|
}
|
|
27918
28145
|
),
|
|
27919
|
-
/* @__PURE__ */ (0,
|
|
28146
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27920
28147
|
PerformanceCard,
|
|
27921
28148
|
{
|
|
27922
|
-
icon: /* @__PURE__ */ (0,
|
|
27923
|
-
|
|
28149
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
28150
|
+
import_react90.WarningCircleIcon,
|
|
27924
28151
|
{
|
|
27925
28152
|
size: 18,
|
|
27926
28153
|
weight: "fill",
|
|
@@ -27935,20 +28162,20 @@ var PerformanceContent = ({
|
|
|
27935
28162
|
}
|
|
27936
28163
|
)
|
|
27937
28164
|
] }),
|
|
27938
|
-
data.lessons.length > 0 && /* @__PURE__ */ (0,
|
|
27939
|
-
/* @__PURE__ */ (0,
|
|
27940
|
-
/* @__PURE__ */ (0,
|
|
28165
|
+
data.lessons.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
28166
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text_default, { size: "md", weight: "semibold", className: "text-text-950", children: labels.lessonsTitle }),
|
|
28167
|
+
/* @__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
28168
|
] })
|
|
27942
28169
|
] });
|
|
27943
28170
|
var renderModalContent = (loading, error, data, labels) => {
|
|
27944
28171
|
if (loading) {
|
|
27945
|
-
return /* @__PURE__ */ (0,
|
|
28172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(LoadingSkeleton2, {});
|
|
27946
28173
|
}
|
|
27947
28174
|
if (error) {
|
|
27948
|
-
return /* @__PURE__ */ (0,
|
|
28175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(ErrorContent, { message: error });
|
|
27949
28176
|
}
|
|
27950
28177
|
if (data) {
|
|
27951
|
-
return /* @__PURE__ */ (0,
|
|
28178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(PerformanceContent, { data, labels });
|
|
27952
28179
|
}
|
|
27953
28180
|
return null;
|
|
27954
28181
|
};
|
|
@@ -27960,14 +28187,14 @@ var StudentPerformanceModal = ({
|
|
|
27960
28187
|
error = null,
|
|
27961
28188
|
labels: customLabels
|
|
27962
28189
|
}) => {
|
|
27963
|
-
const labels = (0,
|
|
28190
|
+
const labels = (0, import_react89.useMemo)(
|
|
27964
28191
|
() => ({ ...DEFAULT_PERFORMANCE_LABELS, ...customLabels }),
|
|
27965
28192
|
[customLabels]
|
|
27966
28193
|
);
|
|
27967
28194
|
if (!data && !loading && !error) {
|
|
27968
28195
|
return null;
|
|
27969
28196
|
}
|
|
27970
|
-
return /* @__PURE__ */ (0,
|
|
28197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
27971
28198
|
Modal_default,
|
|
27972
28199
|
{
|
|
27973
28200
|
isOpen,
|
|
@@ -27981,7 +28208,7 @@ var StudentPerformanceModal = ({
|
|
|
27981
28208
|
};
|
|
27982
28209
|
|
|
27983
28210
|
// src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
|
|
27984
|
-
var
|
|
28211
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
27985
28212
|
var RecommendedLessonDetails = ({
|
|
27986
28213
|
goalId,
|
|
27987
28214
|
data,
|
|
@@ -27995,15 +28222,15 @@ var RecommendedLessonDetails = ({
|
|
|
27995
28222
|
labels: customLabels,
|
|
27996
28223
|
className
|
|
27997
28224
|
}) => {
|
|
27998
|
-
const labels = (0,
|
|
28225
|
+
const labels = (0, import_react91.useMemo)(
|
|
27999
28226
|
() => ({ ...DEFAULT_LABELS, ...customLabels }),
|
|
28000
28227
|
[customLabels]
|
|
28001
28228
|
);
|
|
28002
|
-
const [performanceModalOpen, setPerformanceModalOpen] = (0,
|
|
28003
|
-
const [performanceData, setPerformanceData] = (0,
|
|
28004
|
-
const [performanceLoading, setPerformanceLoading] = (0,
|
|
28005
|
-
const [performanceError, setPerformanceError] = (0,
|
|
28006
|
-
const handleViewStudentPerformance = (0,
|
|
28229
|
+
const [performanceModalOpen, setPerformanceModalOpen] = (0, import_react91.useState)(false);
|
|
28230
|
+
const [performanceData, setPerformanceData] = (0, import_react91.useState)(null);
|
|
28231
|
+
const [performanceLoading, setPerformanceLoading] = (0, import_react91.useState)(false);
|
|
28232
|
+
const [performanceError, setPerformanceError] = (0, import_react91.useState)(null);
|
|
28233
|
+
const handleViewStudentPerformance = (0, import_react91.useCallback)(
|
|
28007
28234
|
async (studentId) => {
|
|
28008
28235
|
if (!fetchStudentPerformance || !goalId) return;
|
|
28009
28236
|
setPerformanceModalOpen(true);
|
|
@@ -28024,12 +28251,12 @@ var RecommendedLessonDetails = ({
|
|
|
28024
28251
|
},
|
|
28025
28252
|
[fetchStudentPerformance, goalId]
|
|
28026
28253
|
);
|
|
28027
|
-
const handleClosePerformanceModal = (0,
|
|
28254
|
+
const handleClosePerformanceModal = (0, import_react91.useCallback)(() => {
|
|
28028
28255
|
setPerformanceModalOpen(false);
|
|
28029
28256
|
setPerformanceData(null);
|
|
28030
28257
|
setPerformanceError(null);
|
|
28031
28258
|
}, []);
|
|
28032
|
-
const defaultBreadcrumbs = (0,
|
|
28259
|
+
const defaultBreadcrumbs = (0, import_react91.useMemo)(
|
|
28033
28260
|
() => [
|
|
28034
28261
|
{ label: "Aulas recomendadas", path: "/aulas-recomendadas" },
|
|
28035
28262
|
{ label: data?.goal.title || "Detalhes" }
|
|
@@ -28037,7 +28264,7 @@ var RecommendedLessonDetails = ({
|
|
|
28037
28264
|
[data?.goal.title]
|
|
28038
28265
|
);
|
|
28039
28266
|
const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
|
|
28040
|
-
const displayStudents = (0,
|
|
28267
|
+
const displayStudents = (0, import_react91.useMemo)(() => {
|
|
28041
28268
|
if (!data?.details.students) return [];
|
|
28042
28269
|
const deadline = data?.goal.finalDate;
|
|
28043
28270
|
return data.details.students.map(
|
|
@@ -28045,17 +28272,17 @@ var RecommendedLessonDetails = ({
|
|
|
28045
28272
|
);
|
|
28046
28273
|
}, [data?.details.students, data?.goal.finalDate]);
|
|
28047
28274
|
if (loading) {
|
|
28048
|
-
return /* @__PURE__ */ (0,
|
|
28275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28049
28276
|
"div",
|
|
28050
28277
|
{
|
|
28051
28278
|
className: cn("flex flex-col gap-6", className),
|
|
28052
28279
|
"data-testid": "lesson-details-loading",
|
|
28053
|
-
children: /* @__PURE__ */ (0,
|
|
28280
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LoadingSkeleton, {})
|
|
28054
28281
|
}
|
|
28055
28282
|
);
|
|
28056
28283
|
}
|
|
28057
28284
|
if (error) {
|
|
28058
|
-
return /* @__PURE__ */ (0,
|
|
28285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28059
28286
|
"div",
|
|
28060
28287
|
{
|
|
28061
28288
|
className: cn(
|
|
@@ -28063,22 +28290,22 @@ var RecommendedLessonDetails = ({
|
|
|
28063
28290
|
className
|
|
28064
28291
|
),
|
|
28065
28292
|
"data-testid": "lesson-details-error",
|
|
28066
|
-
children: /* @__PURE__ */ (0,
|
|
28293
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Text_default, { size: "md", className: "text-error-700", children: error })
|
|
28067
28294
|
}
|
|
28068
28295
|
);
|
|
28069
28296
|
}
|
|
28070
28297
|
if (!data) {
|
|
28071
28298
|
return null;
|
|
28072
28299
|
}
|
|
28073
|
-
return /* @__PURE__ */ (0,
|
|
28074
|
-
/* @__PURE__ */ (0,
|
|
28300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
|
|
28301
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
28075
28302
|
"div",
|
|
28076
28303
|
{
|
|
28077
28304
|
className: cn("flex flex-col gap-6", className),
|
|
28078
28305
|
"data-testid": "recommended-lesson-details",
|
|
28079
28306
|
children: [
|
|
28080
|
-
/* @__PURE__ */ (0,
|
|
28081
|
-
/* @__PURE__ */ (0,
|
|
28307
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
|
|
28308
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28082
28309
|
LessonHeader,
|
|
28083
28310
|
{
|
|
28084
28311
|
data,
|
|
@@ -28087,8 +28314,8 @@ var RecommendedLessonDetails = ({
|
|
|
28087
28314
|
viewLessonLabel: labels.viewLesson
|
|
28088
28315
|
}
|
|
28089
28316
|
),
|
|
28090
|
-
/* @__PURE__ */ (0,
|
|
28091
|
-
/* @__PURE__ */ (0,
|
|
28317
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ResultsSection, { data, labels }),
|
|
28318
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28092
28319
|
StudentsTable,
|
|
28093
28320
|
{
|
|
28094
28321
|
students: displayStudents,
|
|
@@ -28099,7 +28326,7 @@ var RecommendedLessonDetails = ({
|
|
|
28099
28326
|
]
|
|
28100
28327
|
}
|
|
28101
28328
|
),
|
|
28102
|
-
fetchStudentPerformance && /* @__PURE__ */ (0,
|
|
28329
|
+
fetchStudentPerformance && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
28103
28330
|
StudentPerformanceModal,
|
|
28104
28331
|
{
|
|
28105
28332
|
isOpen: performanceModalOpen,
|
|
@@ -28114,7 +28341,7 @@ var RecommendedLessonDetails = ({
|
|
|
28114
28341
|
var RecommendedLessonDetails_default = RecommendedLessonDetails;
|
|
28115
28342
|
|
|
28116
28343
|
// src/hooks/useRecommendedLessonsPage.ts
|
|
28117
|
-
var
|
|
28344
|
+
var import_react92 = require("react");
|
|
28118
28345
|
var buildQueryParams2 = (filters) => {
|
|
28119
28346
|
if (!filters) return {};
|
|
28120
28347
|
const params = {};
|
|
@@ -28148,7 +28375,7 @@ var getClassOptions2 = (userData) => {
|
|
|
28148
28375
|
});
|
|
28149
28376
|
return Array.from(classMap.entries()).map(([id, name]) => ({ id, name }));
|
|
28150
28377
|
};
|
|
28151
|
-
var
|
|
28378
|
+
var getSubjectOptions4 = (userData) => {
|
|
28152
28379
|
if (!userData?.subTeacherTopicClasses) return [];
|
|
28153
28380
|
const subjectMap = /* @__PURE__ */ new Map();
|
|
28154
28381
|
userData.subTeacherTopicClasses.forEach((stc) => {
|
|
@@ -28171,26 +28398,26 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28171
28398
|
mapSubjectNameToEnum: mapSubjectNameToEnum2
|
|
28172
28399
|
} = config;
|
|
28173
28400
|
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,
|
|
28401
|
+
const goalsMapRef = (0, import_react92.useRef)(/* @__PURE__ */ new Map());
|
|
28402
|
+
const [sendModalOpen, setSendModalOpen] = (0, import_react92.useState)(false);
|
|
28403
|
+
const [selectedModel, setSelectedModel] = (0, import_react92.useState)(null);
|
|
28404
|
+
const [sendModalLoading, setSendModalLoading] = (0, import_react92.useState)(false);
|
|
28405
|
+
const [sendModalCategories, setSendModalCategories] = (0, import_react92.useState)([]);
|
|
28406
|
+
const userFilterData = (0, import_react92.useMemo)(
|
|
28180
28407
|
() => ({
|
|
28181
28408
|
schools: getSchoolOptions2(userData),
|
|
28182
28409
|
classes: getClassOptions2(userData),
|
|
28183
|
-
subjects:
|
|
28410
|
+
subjects: getSubjectOptions4(userData)
|
|
28184
28411
|
}),
|
|
28185
28412
|
[userData]
|
|
28186
28413
|
);
|
|
28187
|
-
const subjectsMap = (0,
|
|
28414
|
+
const subjectsMap = (0, import_react92.useMemo)(() => {
|
|
28188
28415
|
const map = /* @__PURE__ */ new Map();
|
|
28189
|
-
const subjects =
|
|
28416
|
+
const subjects = getSubjectOptions4(userData);
|
|
28190
28417
|
subjects.forEach((s) => map.set(s.id, s.name));
|
|
28191
28418
|
return map;
|
|
28192
28419
|
}, [userData]);
|
|
28193
|
-
const fetchGoalsHistory = (0,
|
|
28420
|
+
const fetchGoalsHistory = (0, import_react92.useCallback)(
|
|
28194
28421
|
async (filters) => {
|
|
28195
28422
|
const params = buildQueryParams2(filters);
|
|
28196
28423
|
const response = await api.get(
|
|
@@ -28205,7 +28432,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28205
28432
|
},
|
|
28206
28433
|
[api, endpoints.goalsHistory]
|
|
28207
28434
|
);
|
|
28208
|
-
const fetchGoalModels = (0,
|
|
28435
|
+
const fetchGoalModels = (0, import_react92.useCallback)(
|
|
28209
28436
|
async (filters) => {
|
|
28210
28437
|
const params = buildQueryParams2({
|
|
28211
28438
|
...filters,
|
|
@@ -28219,31 +28446,51 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28219
28446
|
},
|
|
28220
28447
|
[api, endpoints.goalDrafts]
|
|
28221
28448
|
);
|
|
28222
|
-
const deleteGoalModel = (0,
|
|
28449
|
+
const deleteGoalModel = (0, import_react92.useCallback)(
|
|
28223
28450
|
async (id) => {
|
|
28224
28451
|
await api.delete(`${endpoints.goalDrafts}/${id}`);
|
|
28225
28452
|
},
|
|
28226
28453
|
[api, endpoints.goalDrafts]
|
|
28227
28454
|
);
|
|
28228
|
-
const
|
|
28455
|
+
const fetchGoalDrafts = (0, import_react92.useCallback)(
|
|
28456
|
+
async (filters) => {
|
|
28457
|
+
const params = buildQueryParams2({
|
|
28458
|
+
...filters,
|
|
28459
|
+
type: "RASCUNHO" /* RASCUNHO */
|
|
28460
|
+
});
|
|
28461
|
+
const response = await api.get(
|
|
28462
|
+
endpoints.goalDrafts,
|
|
28463
|
+
{ params }
|
|
28464
|
+
);
|
|
28465
|
+
return response.data;
|
|
28466
|
+
},
|
|
28467
|
+
[api, endpoints.goalDrafts]
|
|
28468
|
+
);
|
|
28469
|
+
const deleteGoalDraft = (0, import_react92.useCallback)(
|
|
28470
|
+
async (id) => {
|
|
28471
|
+
await api.delete(`${endpoints.goalDrafts}/${id}`);
|
|
28472
|
+
},
|
|
28473
|
+
[api, endpoints.goalDrafts]
|
|
28474
|
+
);
|
|
28475
|
+
const handleCreateLesson = (0, import_react92.useCallback)(() => {
|
|
28229
28476
|
navigate(paths.createLesson);
|
|
28230
28477
|
}, []);
|
|
28231
|
-
const handleCreateModel = (0,
|
|
28478
|
+
const handleCreateModel = (0, import_react92.useCallback)(() => {
|
|
28232
28479
|
navigate(paths.createModel);
|
|
28233
28480
|
}, []);
|
|
28234
|
-
const handleRowClick = (0,
|
|
28481
|
+
const handleRowClick = (0, import_react92.useCallback)((row) => {
|
|
28235
28482
|
const originalData = goalsMapRef.current.get(row.id);
|
|
28236
28483
|
navigate(`${paths.lessonDetails}/${row.id}`, {
|
|
28237
28484
|
state: { goalData: originalData }
|
|
28238
28485
|
});
|
|
28239
28486
|
}, []);
|
|
28240
|
-
const handleEditGoal = (0,
|
|
28487
|
+
const handleEditGoal = (0, import_react92.useCallback)((id) => {
|
|
28241
28488
|
navigate(`${paths.editLesson}/${id}/editar`);
|
|
28242
28489
|
}, []);
|
|
28243
|
-
const handleEditModel = (0,
|
|
28490
|
+
const handleEditModel = (0, import_react92.useCallback)((model) => {
|
|
28244
28491
|
navigate(`${paths.editModel}${model.id}`);
|
|
28245
28492
|
}, []);
|
|
28246
|
-
const handleSendLesson = (0,
|
|
28493
|
+
const handleSendLesson = (0, import_react92.useCallback)(
|
|
28247
28494
|
(model) => {
|
|
28248
28495
|
setSelectedModel(model);
|
|
28249
28496
|
const classes = getClassOptions2(userData);
|
|
@@ -28266,7 +28513,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28266
28513
|
},
|
|
28267
28514
|
[userData]
|
|
28268
28515
|
);
|
|
28269
|
-
const handleSendLessonSubmit = (0,
|
|
28516
|
+
const handleSendLessonSubmit = (0, import_react92.useCallback)(
|
|
28270
28517
|
async (formData) => {
|
|
28271
28518
|
if (!selectedModel) return;
|
|
28272
28519
|
setSendModalLoading(true);
|
|
@@ -28285,11 +28532,11 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28285
28532
|
},
|
|
28286
28533
|
[api, endpoints.submitGoal, selectedModel]
|
|
28287
28534
|
);
|
|
28288
|
-
const handleSendModalClose = (0,
|
|
28535
|
+
const handleSendModalClose = (0, import_react92.useCallback)(() => {
|
|
28289
28536
|
setSendModalOpen(false);
|
|
28290
28537
|
setSelectedModel(null);
|
|
28291
28538
|
}, []);
|
|
28292
|
-
const handleCategoriesChange = (0,
|
|
28539
|
+
const handleCategoriesChange = (0, import_react92.useCallback)(
|
|
28293
28540
|
(categories) => {
|
|
28294
28541
|
setSendModalCategories(categories);
|
|
28295
28542
|
},
|
|
@@ -28306,6 +28553,10 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28306
28553
|
onEditGoal: handleEditGoal,
|
|
28307
28554
|
onEditModel: handleEditModel,
|
|
28308
28555
|
onSendLesson: handleSendLesson,
|
|
28556
|
+
fetchGoalDrafts,
|
|
28557
|
+
deleteGoalDraft,
|
|
28558
|
+
onSendDraft: handleSendLesson,
|
|
28559
|
+
onEditDraft: handleEditModel,
|
|
28309
28560
|
emptyStateImage,
|
|
28310
28561
|
noSearchImage,
|
|
28311
28562
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
@@ -28331,7 +28582,7 @@ var createUseRecommendedLessonsPage = (config) => {
|
|
|
28331
28582
|
var createRecommendedLessonsPageHook = createUseRecommendedLessonsPage;
|
|
28332
28583
|
|
|
28333
28584
|
// src/hooks/useRecommendedLessonDetails.ts
|
|
28334
|
-
var
|
|
28585
|
+
var import_react93 = require("react");
|
|
28335
28586
|
var import_zod8 = require("zod");
|
|
28336
28587
|
var goalLessonSubjectSchema = import_zod8.z.object({
|
|
28337
28588
|
id: import_zod8.z.string(),
|
|
@@ -28434,12 +28685,12 @@ var handleLessonDetailsFetchError = (error) => {
|
|
|
28434
28685
|
};
|
|
28435
28686
|
var createUseRecommendedLessonDetails = (apiClient) => {
|
|
28436
28687
|
return (lessonId) => {
|
|
28437
|
-
const [state, setState] = (0,
|
|
28688
|
+
const [state, setState] = (0, import_react93.useState)({
|
|
28438
28689
|
data: null,
|
|
28439
28690
|
loading: true,
|
|
28440
28691
|
error: null
|
|
28441
28692
|
});
|
|
28442
|
-
const fetchLessonDetails = (0,
|
|
28693
|
+
const fetchLessonDetails = (0, import_react93.useCallback)(async () => {
|
|
28443
28694
|
if (!lessonId) {
|
|
28444
28695
|
setState({
|
|
28445
28696
|
data: null,
|
|
@@ -28485,7 +28736,7 @@ var createUseRecommendedLessonDetails = (apiClient) => {
|
|
|
28485
28736
|
});
|
|
28486
28737
|
}
|
|
28487
28738
|
}, [lessonId]);
|
|
28488
|
-
(0,
|
|
28739
|
+
(0, import_react93.useEffect)(() => {
|
|
28489
28740
|
fetchLessonDetails();
|
|
28490
28741
|
}, [fetchLessonDetails]);
|
|
28491
28742
|
return {
|
|
@@ -28497,20 +28748,20 @@ var createUseRecommendedLessonDetails = (apiClient) => {
|
|
|
28497
28748
|
var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
|
|
28498
28749
|
|
|
28499
28750
|
// src/components/ActivitiesHistory/ActivitiesHistory.tsx
|
|
28500
|
-
var
|
|
28751
|
+
var import_react97 = require("react");
|
|
28501
28752
|
|
|
28502
28753
|
// src/components/ActivitiesHistory/tabs/HistoryTab.tsx
|
|
28503
|
-
var
|
|
28754
|
+
var import_react95 = require("react");
|
|
28504
28755
|
var import_phosphor_react54 = require("phosphor-react");
|
|
28505
28756
|
|
|
28506
28757
|
// src/components/ActivitiesHistory/config/historyTableColumns.tsx
|
|
28507
28758
|
var import_phosphor_react53 = require("phosphor-react");
|
|
28508
28759
|
|
|
28509
28760
|
// src/components/ActivitiesHistory/utils/renderTruncatedText.tsx
|
|
28510
|
-
var
|
|
28761
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
28511
28762
|
var renderTruncatedText = (value) => {
|
|
28512
28763
|
const text = typeof value === "string" ? value : "";
|
|
28513
|
-
return /* @__PURE__ */ (0,
|
|
28764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Text_default, { size: "sm", title: text, children: text });
|
|
28514
28765
|
};
|
|
28515
28766
|
|
|
28516
28767
|
// src/components/ActivitiesHistory/utils/filterBuilders.ts
|
|
@@ -28556,7 +28807,7 @@ var getSchoolOptions3 = (data) => {
|
|
|
28556
28807
|
name: school.name
|
|
28557
28808
|
}));
|
|
28558
28809
|
};
|
|
28559
|
-
var
|
|
28810
|
+
var getSubjectOptions5 = (data) => {
|
|
28560
28811
|
if (!data?.subjects) return [];
|
|
28561
28812
|
return data.subjects.map((subject) => ({
|
|
28562
28813
|
id: subject.id,
|
|
@@ -28565,7 +28816,7 @@ var getSubjectOptions4 = (data) => {
|
|
|
28565
28816
|
};
|
|
28566
28817
|
|
|
28567
28818
|
// src/components/ActivitiesHistory/config/historyTableColumns.tsx
|
|
28568
|
-
var
|
|
28819
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
28569
28820
|
var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
28570
28821
|
{
|
|
28571
28822
|
key: "startDate",
|
|
@@ -28618,9 +28869,9 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
|
28618
28869
|
render: (value) => {
|
|
28619
28870
|
const status = typeof value === "string" ? value : "";
|
|
28620
28871
|
if (!status) {
|
|
28621
|
-
return /* @__PURE__ */ (0,
|
|
28872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Text_default, { size: "sm", color: "text-text-500", children: "-" });
|
|
28622
28873
|
}
|
|
28623
|
-
return /* @__PURE__ */ (0,
|
|
28874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
28624
28875
|
Badge_default,
|
|
28625
28876
|
{
|
|
28626
28877
|
variant: "solid",
|
|
@@ -28635,7 +28886,7 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
|
28635
28886
|
key: "completionPercentage",
|
|
28636
28887
|
label: "Conclus\xE3o",
|
|
28637
28888
|
sortable: true,
|
|
28638
|
-
render: (value) => /* @__PURE__ */ (0,
|
|
28889
|
+
render: (value) => /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
28639
28890
|
ProgressBar_default,
|
|
28640
28891
|
{
|
|
28641
28892
|
value: Number(value),
|
|
@@ -28652,7 +28903,7 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
|
|
|
28652
28903
|
label: "",
|
|
28653
28904
|
sortable: false,
|
|
28654
28905
|
className: "w-12",
|
|
28655
|
-
render: () => /* @__PURE__ */ (0,
|
|
28906
|
+
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
28907
|
}
|
|
28657
28908
|
];
|
|
28658
28909
|
|
|
@@ -28690,14 +28941,14 @@ var createHistoryFiltersConfig = (userData) => [
|
|
|
28690
28941
|
key: "subject",
|
|
28691
28942
|
label: "Mat\xE9ria",
|
|
28692
28943
|
selectedIds: [],
|
|
28693
|
-
itens:
|
|
28944
|
+
itens: getSubjectOptions5(userData)
|
|
28694
28945
|
}
|
|
28695
28946
|
]
|
|
28696
28947
|
}
|
|
28697
28948
|
];
|
|
28698
28949
|
|
|
28699
28950
|
// src/hooks/useActivitiesHistory.ts
|
|
28700
|
-
var
|
|
28951
|
+
var import_react94 = require("react");
|
|
28701
28952
|
var import_zod9 = require("zod");
|
|
28702
28953
|
var import_dayjs6 = __toESM(require("dayjs"));
|
|
28703
28954
|
var activityHistoryResponseSchema = import_zod9.z.object({
|
|
@@ -28756,13 +29007,13 @@ var handleActivityFetchError = createFetchErrorHandler(
|
|
|
28756
29007
|
);
|
|
28757
29008
|
var createUseActivitiesHistory = (fetchActivitiesHistory) => {
|
|
28758
29009
|
return () => {
|
|
28759
|
-
const [state, setState] = (0,
|
|
29010
|
+
const [state, setState] = (0, import_react94.useState)({
|
|
28760
29011
|
activities: [],
|
|
28761
29012
|
loading: false,
|
|
28762
29013
|
error: null,
|
|
28763
29014
|
pagination: DEFAULT_ACTIVITIES_PAGINATION
|
|
28764
29015
|
});
|
|
28765
|
-
const fetchActivities = (0,
|
|
29016
|
+
const fetchActivities = (0, import_react94.useCallback)(
|
|
28766
29017
|
async (filters) => {
|
|
28767
29018
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
28768
29019
|
try {
|
|
@@ -28797,7 +29048,7 @@ var createUseActivitiesHistory = (fetchActivitiesHistory) => {
|
|
|
28797
29048
|
var createActivitiesHistoryHook = createUseActivitiesHistory;
|
|
28798
29049
|
|
|
28799
29050
|
// src/components/ActivitiesHistory/tabs/HistoryTab.tsx
|
|
28800
|
-
var
|
|
29051
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
28801
29052
|
var HistoryTab = ({
|
|
28802
29053
|
fetchActivitiesHistory,
|
|
28803
29054
|
onCreateActivity,
|
|
@@ -28807,9 +29058,9 @@ var HistoryTab = ({
|
|
|
28807
29058
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
28808
29059
|
userFilterData
|
|
28809
29060
|
}) => {
|
|
28810
|
-
const fetchActivitiesHistoryRef = (0,
|
|
29061
|
+
const fetchActivitiesHistoryRef = (0, import_react95.useRef)(fetchActivitiesHistory);
|
|
28811
29062
|
fetchActivitiesHistoryRef.current = fetchActivitiesHistory;
|
|
28812
|
-
const useActivitiesHistory = (0,
|
|
29063
|
+
const useActivitiesHistory = (0, import_react95.useMemo)(
|
|
28813
29064
|
() => createUseActivitiesHistory(
|
|
28814
29065
|
(filters) => fetchActivitiesHistoryRef.current(filters)
|
|
28815
29066
|
),
|
|
@@ -28822,15 +29073,15 @@ var HistoryTab = ({
|
|
|
28822
29073
|
pagination,
|
|
28823
29074
|
fetchActivities
|
|
28824
29075
|
} = useActivitiesHistory();
|
|
28825
|
-
const historyFilterConfigs = (0,
|
|
29076
|
+
const historyFilterConfigs = (0, import_react95.useMemo)(
|
|
28826
29077
|
() => createHistoryFiltersConfig(userFilterData),
|
|
28827
29078
|
[userFilterData]
|
|
28828
29079
|
);
|
|
28829
|
-
const historyTableColumns = (0,
|
|
29080
|
+
const historyTableColumns = (0, import_react95.useMemo)(
|
|
28830
29081
|
() => createHistoryTableColumns(mapSubjectNameToEnum2),
|
|
28831
29082
|
[mapSubjectNameToEnum2]
|
|
28832
29083
|
);
|
|
28833
|
-
const handleParamsChange = (0,
|
|
29084
|
+
const handleParamsChange = (0, import_react95.useCallback)(
|
|
28834
29085
|
(params) => {
|
|
28835
29086
|
const filters = buildHistoryFiltersFromParams(params);
|
|
28836
29087
|
fetchActivities(filters);
|
|
@@ -28838,9 +29089,9 @@ var HistoryTab = ({
|
|
|
28838
29089
|
[fetchActivities]
|
|
28839
29090
|
);
|
|
28840
29091
|
if (error) {
|
|
28841
|
-
return /* @__PURE__ */ (0,
|
|
29092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(ErrorDisplay, { error });
|
|
28842
29093
|
}
|
|
28843
|
-
return /* @__PURE__ */ (0,
|
|
29094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
28844
29095
|
TableProvider,
|
|
28845
29096
|
{
|
|
28846
29097
|
data: activities,
|
|
@@ -28865,14 +29116,14 @@ var HistoryTab = ({
|
|
|
28865
29116
|
image: noSearchImage
|
|
28866
29117
|
},
|
|
28867
29118
|
emptyState: {
|
|
28868
|
-
component: /* @__PURE__ */ (0,
|
|
29119
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
28869
29120
|
EmptyState_default,
|
|
28870
29121
|
{
|
|
28871
29122
|
image: emptyStateImage,
|
|
28872
29123
|
title: "Incentive sua turma ao aprendizado",
|
|
28873
29124
|
description: "Crie uma nova atividade e ajude seus alunos a colocarem o conte\xFAdo em pr\xE1tica!",
|
|
28874
29125
|
buttonText: "Criar atividade",
|
|
28875
|
-
buttonIcon: /* @__PURE__ */ (0,
|
|
29126
|
+
buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_phosphor_react54.Plus, { size: 18 }),
|
|
28876
29127
|
buttonVariant: "outline",
|
|
28877
29128
|
buttonAction: "primary",
|
|
28878
29129
|
onButtonClick: onCreateActivity
|
|
@@ -28887,22 +29138,22 @@ var HistoryTab = ({
|
|
|
28887
29138
|
table,
|
|
28888
29139
|
pagination: paginationComponent
|
|
28889
29140
|
} = renderProps;
|
|
28890
|
-
return /* @__PURE__ */ (0,
|
|
28891
|
-
/* @__PURE__ */ (0,
|
|
28892
|
-
/* @__PURE__ */ (0,
|
|
29141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "space-y-4", children: [
|
|
29142
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
29143
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
28893
29144
|
Button_default,
|
|
28894
29145
|
{
|
|
28895
29146
|
variant: "solid",
|
|
28896
29147
|
action: "primary",
|
|
28897
29148
|
size: "medium",
|
|
28898
29149
|
onClick: onCreateActivity,
|
|
28899
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
29150
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_phosphor_react54.Plus, { size: 18, weight: "bold" }),
|
|
28900
29151
|
children: "Criar atividade"
|
|
28901
29152
|
}
|
|
28902
29153
|
),
|
|
28903
29154
|
controls
|
|
28904
29155
|
] }),
|
|
28905
|
-
/* @__PURE__ */ (0,
|
|
29156
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
|
|
28906
29157
|
table,
|
|
28907
29158
|
paginationComponent
|
|
28908
29159
|
] })
|
|
@@ -28922,14 +29173,14 @@ var createModelsFiltersConfig = (userData) => [
|
|
|
28922
29173
|
key: "subject",
|
|
28923
29174
|
label: "Mat\xE9ria",
|
|
28924
29175
|
selectedIds: [],
|
|
28925
|
-
itens:
|
|
29176
|
+
itens: getSubjectOptions5(userData)
|
|
28926
29177
|
}
|
|
28927
29178
|
]
|
|
28928
29179
|
}
|
|
28929
29180
|
];
|
|
28930
29181
|
|
|
28931
29182
|
// src/hooks/useActivityModels.ts
|
|
28932
|
-
var
|
|
29183
|
+
var import_react96 = require("react");
|
|
28933
29184
|
var import_zod10 = require("zod");
|
|
28934
29185
|
var import_dayjs7 = __toESM(require("dayjs"));
|
|
28935
29186
|
var activityDraftFiltersSchema = import_zod10.z.object({
|
|
@@ -28990,13 +29241,13 @@ var handleModelFetchError = createFetchErrorHandler(
|
|
|
28990
29241
|
);
|
|
28991
29242
|
var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
28992
29243
|
return () => {
|
|
28993
|
-
const [state, setState] = (0,
|
|
29244
|
+
const [state, setState] = (0, import_react96.useState)({
|
|
28994
29245
|
models: [],
|
|
28995
29246
|
loading: false,
|
|
28996
29247
|
error: null,
|
|
28997
29248
|
pagination: DEFAULT_MODELS_PAGINATION
|
|
28998
29249
|
});
|
|
28999
|
-
const fetchModels = (0,
|
|
29250
|
+
const fetchModels = (0, import_react96.useCallback)(
|
|
29000
29251
|
async (filters, subjectsMap) => {
|
|
29001
29252
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
29002
29253
|
try {
|
|
@@ -29031,7 +29282,7 @@ var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
|
29031
29282
|
},
|
|
29032
29283
|
[fetchActivityModels]
|
|
29033
29284
|
);
|
|
29034
|
-
const deleteModel = (0,
|
|
29285
|
+
const deleteModel = (0, import_react96.useCallback)(
|
|
29035
29286
|
async (id) => {
|
|
29036
29287
|
try {
|
|
29037
29288
|
await deleteActivityModel(id);
|
|
@@ -29053,7 +29304,7 @@ var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
|
|
|
29053
29304
|
var createActivityModelsHook = createUseActivityModels;
|
|
29054
29305
|
|
|
29055
29306
|
// src/components/ActivitiesHistory/tabs/ModelsTab.tsx
|
|
29056
|
-
var
|
|
29307
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
29057
29308
|
var ACTIVITY_MODELS_CONFIG = {
|
|
29058
29309
|
entityName: "atividade",
|
|
29059
29310
|
entityNamePlural: "atividades",
|
|
@@ -29079,7 +29330,7 @@ var ModelsTab = ({
|
|
|
29079
29330
|
mapSubjectNameToEnum: mapSubjectNameToEnum2,
|
|
29080
29331
|
userFilterData,
|
|
29081
29332
|
subjectsMap
|
|
29082
|
-
}) => /* @__PURE__ */ (0,
|
|
29333
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
29083
29334
|
ModelsTabBase,
|
|
29084
29335
|
{
|
|
29085
29336
|
fetchModels: fetchActivityModels,
|
|
@@ -29107,13 +29358,13 @@ var ModelsTab = ({
|
|
|
29107
29358
|
);
|
|
29108
29359
|
|
|
29109
29360
|
// src/components/ActivitiesHistory/tabs/DraftsTab.tsx
|
|
29110
|
-
var
|
|
29361
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
29111
29362
|
var DraftsTab = () => {
|
|
29112
|
-
return /* @__PURE__ */ (0,
|
|
29363
|
+
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
29364
|
};
|
|
29114
29365
|
|
|
29115
29366
|
// src/components/ActivitiesHistory/ActivitiesHistory.tsx
|
|
29116
|
-
var
|
|
29367
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
29117
29368
|
var PAGE_TITLES = {
|
|
29118
29369
|
["history" /* HISTORY */]: "Hist\xF3rico de atividades",
|
|
29119
29370
|
["drafts" /* DRAFTS */]: "Rascunhos",
|
|
@@ -29134,17 +29385,17 @@ var ActivitiesHistory = ({
|
|
|
29134
29385
|
userFilterData,
|
|
29135
29386
|
subjectsMap
|
|
29136
29387
|
}) => {
|
|
29137
|
-
const [activeTab, setActiveTab] = (0,
|
|
29138
|
-
return /* @__PURE__ */ (0,
|
|
29388
|
+
const [activeTab, setActiveTab] = (0, import_react97.useState)("history" /* HISTORY */);
|
|
29389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
29139
29390
|
"div",
|
|
29140
29391
|
{
|
|
29141
29392
|
"data-testid": "activities-history",
|
|
29142
29393
|
className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
|
|
29143
29394
|
children: [
|
|
29144
|
-
/* @__PURE__ */ (0,
|
|
29145
|
-
/* @__PURE__ */ (0,
|
|
29146
|
-
/* @__PURE__ */ (0,
|
|
29147
|
-
/* @__PURE__ */ (0,
|
|
29395
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
|
|
29396
|
+
/* @__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: [
|
|
29397
|
+
/* @__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: [
|
|
29398
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29148
29399
|
Text_default,
|
|
29149
29400
|
{
|
|
29150
29401
|
as: "h1",
|
|
@@ -29153,7 +29404,7 @@ var ActivitiesHistory = ({
|
|
|
29153
29404
|
children: PAGE_TITLES[activeTab]
|
|
29154
29405
|
}
|
|
29155
29406
|
),
|
|
29156
|
-
/* @__PURE__ */ (0,
|
|
29407
|
+
/* @__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
29408
|
Menu,
|
|
29158
29409
|
{
|
|
29159
29410
|
defaultValue: "history" /* HISTORY */,
|
|
@@ -29161,13 +29412,13 @@ var ActivitiesHistory = ({
|
|
|
29161
29412
|
onValueChange: (value) => setActiveTab(value),
|
|
29162
29413
|
variant: "menu2",
|
|
29163
29414
|
className: "bg-transparent shadow-none px-0",
|
|
29164
|
-
children: /* @__PURE__ */ (0,
|
|
29415
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
29165
29416
|
MenuContent,
|
|
29166
29417
|
{
|
|
29167
29418
|
variant: "menu2",
|
|
29168
29419
|
className: "w-full lg:w-auto max-w-full min-w-0",
|
|
29169
29420
|
children: [
|
|
29170
|
-
/* @__PURE__ */ (0,
|
|
29421
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29171
29422
|
MenuItem,
|
|
29172
29423
|
{
|
|
29173
29424
|
variant: "menu2",
|
|
@@ -29177,7 +29428,7 @@ var ActivitiesHistory = ({
|
|
|
29177
29428
|
children: "Hist\xF3rico"
|
|
29178
29429
|
}
|
|
29179
29430
|
),
|
|
29180
|
-
/* @__PURE__ */ (0,
|
|
29431
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29181
29432
|
MenuItem,
|
|
29182
29433
|
{
|
|
29183
29434
|
variant: "menu2",
|
|
@@ -29187,7 +29438,7 @@ var ActivitiesHistory = ({
|
|
|
29187
29438
|
children: "Rascunhos"
|
|
29188
29439
|
}
|
|
29189
29440
|
),
|
|
29190
|
-
/* @__PURE__ */ (0,
|
|
29441
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29191
29442
|
MenuItem,
|
|
29192
29443
|
{
|
|
29193
29444
|
variant: "menu2",
|
|
@@ -29203,8 +29454,8 @@ var ActivitiesHistory = ({
|
|
|
29203
29454
|
}
|
|
29204
29455
|
) })
|
|
29205
29456
|
] }),
|
|
29206
|
-
/* @__PURE__ */ (0,
|
|
29207
|
-
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0,
|
|
29457
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
|
|
29458
|
+
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29208
29459
|
HistoryTab,
|
|
29209
29460
|
{
|
|
29210
29461
|
fetchActivitiesHistory,
|
|
@@ -29216,8 +29467,8 @@ var ActivitiesHistory = ({
|
|
|
29216
29467
|
userFilterData
|
|
29217
29468
|
}
|
|
29218
29469
|
),
|
|
29219
|
-
activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */ (0,
|
|
29220
|
-
activeTab === "models" /* MODELS */ && /* @__PURE__ */ (0,
|
|
29470
|
+
activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(DraftsTab, {}),
|
|
29471
|
+
activeTab === "models" /* MODELS */ && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
29221
29472
|
ModelsTab,
|
|
29222
29473
|
{
|
|
29223
29474
|
fetchActivityModels,
|
|
@@ -29373,7 +29624,7 @@ var buildUserFilterData = (userData) => ({
|
|
|
29373
29624
|
});
|
|
29374
29625
|
|
|
29375
29626
|
// src/hooks/useChat.ts
|
|
29376
|
-
var
|
|
29627
|
+
var import_react98 = require("react");
|
|
29377
29628
|
var WS_STATES = {
|
|
29378
29629
|
CONNECTING: 0,
|
|
29379
29630
|
OPEN: 1,
|
|
@@ -29392,25 +29643,25 @@ function useChat({
|
|
|
29392
29643
|
reconnectInterval = 3e3,
|
|
29393
29644
|
maxReconnectAttempts = 5
|
|
29394
29645
|
}) {
|
|
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,
|
|
29646
|
+
const [isConnected, setIsConnected] = (0, import_react98.useState)(false);
|
|
29647
|
+
const [messages, setMessages] = (0, import_react98.useState)([]);
|
|
29648
|
+
const [participants, setParticipants] = (0, import_react98.useState)([]);
|
|
29649
|
+
const [error, setError] = (0, import_react98.useState)(null);
|
|
29650
|
+
const wsRef = (0, import_react98.useRef)(null);
|
|
29651
|
+
const reconnectAttemptsRef = (0, import_react98.useRef)(0);
|
|
29652
|
+
const reconnectTimeoutRef = (0, import_react98.useRef)(
|
|
29402
29653
|
null
|
|
29403
29654
|
);
|
|
29404
|
-
const isManualDisconnectRef = (0,
|
|
29405
|
-
const isConnectingRef = (0,
|
|
29406
|
-
const connectRef = (0,
|
|
29655
|
+
const isManualDisconnectRef = (0, import_react98.useRef)(false);
|
|
29656
|
+
const isConnectingRef = (0, import_react98.useRef)(false);
|
|
29657
|
+
const connectRef = (0, import_react98.useRef)(() => {
|
|
29407
29658
|
});
|
|
29408
|
-
const sendWsMessage = (0,
|
|
29659
|
+
const sendWsMessage = (0, import_react98.useCallback)((message) => {
|
|
29409
29660
|
if (wsRef.current?.readyState === WS_STATES.OPEN) {
|
|
29410
29661
|
wsRef.current.send(JSON.stringify(message));
|
|
29411
29662
|
}
|
|
29412
29663
|
}, []);
|
|
29413
|
-
const sendMessage = (0,
|
|
29664
|
+
const sendMessage = (0, import_react98.useCallback)(
|
|
29414
29665
|
(content) => {
|
|
29415
29666
|
const trimmedContent = content.trim();
|
|
29416
29667
|
if (!trimmedContent) return;
|
|
@@ -29421,12 +29672,12 @@ function useChat({
|
|
|
29421
29672
|
},
|
|
29422
29673
|
[sendWsMessage]
|
|
29423
29674
|
);
|
|
29424
|
-
const leave = (0,
|
|
29675
|
+
const leave = (0, import_react98.useCallback)(() => {
|
|
29425
29676
|
isManualDisconnectRef.current = true;
|
|
29426
29677
|
sendWsMessage({ type: "leave" });
|
|
29427
29678
|
wsRef.current?.close(1e3, "User left");
|
|
29428
29679
|
}, [sendWsMessage]);
|
|
29429
|
-
const handleMessage = (0,
|
|
29680
|
+
const handleMessage = (0, import_react98.useCallback)(
|
|
29430
29681
|
(event) => {
|
|
29431
29682
|
try {
|
|
29432
29683
|
const data = JSON.parse(event.data);
|
|
@@ -29494,7 +29745,7 @@ function useChat({
|
|
|
29494
29745
|
},
|
|
29495
29746
|
[onError]
|
|
29496
29747
|
);
|
|
29497
|
-
const connect = (0,
|
|
29748
|
+
const connect = (0, import_react98.useCallback)(() => {
|
|
29498
29749
|
if (isConnectingRef.current) {
|
|
29499
29750
|
return;
|
|
29500
29751
|
}
|
|
@@ -29548,12 +29799,12 @@ function useChat({
|
|
|
29548
29799
|
maxReconnectAttempts
|
|
29549
29800
|
]);
|
|
29550
29801
|
connectRef.current = connect;
|
|
29551
|
-
const reconnect = (0,
|
|
29802
|
+
const reconnect = (0, import_react98.useCallback)(() => {
|
|
29552
29803
|
isManualDisconnectRef.current = false;
|
|
29553
29804
|
reconnectAttemptsRef.current = 0;
|
|
29554
29805
|
connectRef.current();
|
|
29555
29806
|
}, []);
|
|
29556
|
-
(0,
|
|
29807
|
+
(0, import_react98.useEffect)(() => {
|
|
29557
29808
|
if (!roomId) {
|
|
29558
29809
|
return;
|
|
29559
29810
|
}
|
|
@@ -29597,15 +29848,15 @@ function createUseChat(baseWsUrl) {
|
|
|
29597
29848
|
}
|
|
29598
29849
|
|
|
29599
29850
|
// src/hooks/useChatRooms.ts
|
|
29600
|
-
var
|
|
29851
|
+
var import_react99 = require("react");
|
|
29601
29852
|
function useChatRooms({
|
|
29602
29853
|
apiClient
|
|
29603
29854
|
}) {
|
|
29604
|
-
const [rooms, setRooms] = (0,
|
|
29605
|
-
const [availableUsers, setAvailableUsers] = (0,
|
|
29606
|
-
const [loading, setLoading] = (0,
|
|
29607
|
-
const [error, setError] = (0,
|
|
29608
|
-
const fetchRooms = (0,
|
|
29855
|
+
const [rooms, setRooms] = (0, import_react99.useState)([]);
|
|
29856
|
+
const [availableUsers, setAvailableUsers] = (0, import_react99.useState)([]);
|
|
29857
|
+
const [loading, setLoading] = (0, import_react99.useState)(false);
|
|
29858
|
+
const [error, setError] = (0, import_react99.useState)(null);
|
|
29859
|
+
const fetchRooms = (0, import_react99.useCallback)(async () => {
|
|
29609
29860
|
setLoading(true);
|
|
29610
29861
|
setError(null);
|
|
29611
29862
|
try {
|
|
@@ -29621,7 +29872,7 @@ function useChatRooms({
|
|
|
29621
29872
|
setLoading(false);
|
|
29622
29873
|
}
|
|
29623
29874
|
}, [apiClient]);
|
|
29624
|
-
const fetchAvailableUsers = (0,
|
|
29875
|
+
const fetchAvailableUsers = (0, import_react99.useCallback)(async () => {
|
|
29625
29876
|
setLoading(true);
|
|
29626
29877
|
setError(null);
|
|
29627
29878
|
try {
|
|
@@ -29637,7 +29888,7 @@ function useChatRooms({
|
|
|
29637
29888
|
setLoading(false);
|
|
29638
29889
|
}
|
|
29639
29890
|
}, [apiClient]);
|
|
29640
|
-
const createRoom = (0,
|
|
29891
|
+
const createRoom = (0, import_react99.useCallback)(
|
|
29641
29892
|
async (participantIds) => {
|
|
29642
29893
|
setLoading(true);
|
|
29643
29894
|
setError(null);
|
|
@@ -29661,7 +29912,7 @@ function useChatRooms({
|
|
|
29661
29912
|
},
|
|
29662
29913
|
[apiClient, fetchRooms]
|
|
29663
29914
|
);
|
|
29664
|
-
const clearError = (0,
|
|
29915
|
+
const clearError = (0, import_react99.useCallback)(() => {
|
|
29665
29916
|
setError(null);
|
|
29666
29917
|
}, []);
|
|
29667
29918
|
return {
|
|
@@ -29695,14 +29946,14 @@ var CHAT_MESSAGE_TYPES = {
|
|
|
29695
29946
|
};
|
|
29696
29947
|
|
|
29697
29948
|
// src/components/Chat/Chat.tsx
|
|
29698
|
-
var
|
|
29699
|
-
var
|
|
29700
|
-
var
|
|
29949
|
+
var import_react100 = require("react");
|
|
29950
|
+
var import_react101 = require("@phosphor-icons/react");
|
|
29951
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
29701
29952
|
var RoomItem = ({
|
|
29702
29953
|
room,
|
|
29703
29954
|
onClick,
|
|
29704
29955
|
isActive
|
|
29705
|
-
}) => /* @__PURE__ */ (0,
|
|
29956
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29706
29957
|
Button_default,
|
|
29707
29958
|
{
|
|
29708
29959
|
variant: "link",
|
|
@@ -29712,16 +29963,16 @@ var RoomItem = ({
|
|
|
29712
29963
|
"hover:bg-background-100",
|
|
29713
29964
|
isActive && "bg-primary-50 border-l-4 border-primary-500"
|
|
29714
29965
|
),
|
|
29715
|
-
children: /* @__PURE__ */ (0,
|
|
29716
|
-
/* @__PURE__ */ (0,
|
|
29717
|
-
/* @__PURE__ */ (0,
|
|
29718
|
-
/* @__PURE__ */ (0,
|
|
29719
|
-
room.lastMessage && /* @__PURE__ */ (0,
|
|
29966
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-start gap-3 w-full", children: [
|
|
29967
|
+
/* @__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" }) }),
|
|
29968
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
29969
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", weight: "semibold", className: "text-text-900 truncate", children: room.name }),
|
|
29970
|
+
room.lastMessage && /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Text_default, { size: "xs", className: "text-text-500 truncate mt-1", children: [
|
|
29720
29971
|
room.lastMessage.senderName,
|
|
29721
29972
|
": ",
|
|
29722
29973
|
room.lastMessage.content
|
|
29723
29974
|
] }),
|
|
29724
|
-
/* @__PURE__ */ (0,
|
|
29975
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Text_default, { size: "xs", className: "text-text-400 mt-1", children: [
|
|
29725
29976
|
room.participantCount,
|
|
29726
29977
|
" participantes"
|
|
29727
29978
|
] })
|
|
@@ -29732,28 +29983,28 @@ var RoomItem = ({
|
|
|
29732
29983
|
var MessageBubble = ({
|
|
29733
29984
|
message,
|
|
29734
29985
|
isOwn
|
|
29735
|
-
}) => /* @__PURE__ */ (0,
|
|
29736
|
-
!isOwn && /* @__PURE__ */ (0,
|
|
29986
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: cn("flex gap-2 mb-3", isOwn && "flex-row-reverse"), children: [
|
|
29987
|
+
!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
29988
|
"img",
|
|
29738
29989
|
{
|
|
29739
29990
|
src: message.senderPhoto,
|
|
29740
29991
|
alt: message.senderName,
|
|
29741
29992
|
className: "w-8 h-8 rounded-full object-cover"
|
|
29742
29993
|
}
|
|
29743
|
-
) : /* @__PURE__ */ (0,
|
|
29744
|
-
/* @__PURE__ */ (0,
|
|
29745
|
-
!isOwn && /* @__PURE__ */ (0,
|
|
29746
|
-
/* @__PURE__ */ (0,
|
|
29994
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", weight: "bold", className: "text-gray-600", children: message.senderName.charAt(0).toUpperCase() }) }),
|
|
29995
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: cn("max-w-[70%]", isOwn && "items-end"), children: [
|
|
29996
|
+
!isOwn && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500 mb-1", children: message.senderName }),
|
|
29997
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29747
29998
|
"div",
|
|
29748
29999
|
{
|
|
29749
30000
|
className: cn(
|
|
29750
30001
|
"px-4 py-2 rounded-2xl",
|
|
29751
30002
|
isOwn ? "bg-primary-500 text-white rounded-br-md" : "bg-background-100 text-text-900 rounded-bl-md"
|
|
29752
30003
|
),
|
|
29753
|
-
children: /* @__PURE__ */ (0,
|
|
30004
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", children: message.content })
|
|
29754
30005
|
}
|
|
29755
30006
|
),
|
|
29756
|
-
/* @__PURE__ */ (0,
|
|
30007
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29757
30008
|
Text_default,
|
|
29758
30009
|
{
|
|
29759
30010
|
size: "xs",
|
|
@@ -29766,28 +30017,28 @@ var MessageBubble = ({
|
|
|
29766
30017
|
)
|
|
29767
30018
|
] })
|
|
29768
30019
|
] });
|
|
29769
|
-
var ParticipantItem = ({ participant }) => /* @__PURE__ */ (0,
|
|
29770
|
-
/* @__PURE__ */ (0,
|
|
29771
|
-
/* @__PURE__ */ (0,
|
|
30020
|
+
var ParticipantItem = ({ participant }) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-center gap-2 py-2", children: [
|
|
30021
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "relative", children: [
|
|
30022
|
+
/* @__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
30023
|
"img",
|
|
29773
30024
|
{
|
|
29774
30025
|
src: participant.photo,
|
|
29775
30026
|
alt: participant.name,
|
|
29776
30027
|
className: "w-8 h-8 rounded-full object-cover"
|
|
29777
30028
|
}
|
|
29778
|
-
) : /* @__PURE__ */ (0,
|
|
29779
|
-
participant.isOnline && /* @__PURE__ */ (0,
|
|
30029
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", weight: "bold", className: "text-gray-600", children: participant.name.charAt(0).toUpperCase() }) }),
|
|
30030
|
+
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
30031
|
] }),
|
|
29781
|
-
/* @__PURE__ */ (0,
|
|
29782
|
-
/* @__PURE__ */ (0,
|
|
29783
|
-
/* @__PURE__ */ (0,
|
|
30032
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
30033
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-text-900 truncate", children: participant.name }),
|
|
30034
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500", children: participant.role })
|
|
29784
30035
|
] })
|
|
29785
30036
|
] });
|
|
29786
30037
|
var UserSelector = ({
|
|
29787
30038
|
users,
|
|
29788
30039
|
selectedIds,
|
|
29789
30040
|
onToggle
|
|
29790
|
-
}) => /* @__PURE__ */ (0,
|
|
30041
|
+
}) => /* @__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
30042
|
Button_default,
|
|
29792
30043
|
{
|
|
29793
30044
|
variant: "link",
|
|
@@ -29797,26 +30048,26 @@ var UserSelector = ({
|
|
|
29797
30048
|
selectedIds.has(user.userInstitutionId) ? "bg-primary-50 border border-primary-500" : "bg-background-50 hover:bg-background-100 border border-transparent"
|
|
29798
30049
|
),
|
|
29799
30050
|
children: [
|
|
29800
|
-
/* @__PURE__ */ (0,
|
|
30051
|
+
/* @__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
30052
|
"img",
|
|
29802
30053
|
{
|
|
29803
30054
|
src: user.photo,
|
|
29804
30055
|
alt: user.name,
|
|
29805
30056
|
className: "w-10 h-10 rounded-full object-cover"
|
|
29806
30057
|
}
|
|
29807
|
-
) : /* @__PURE__ */ (0,
|
|
29808
|
-
/* @__PURE__ */ (0,
|
|
29809
|
-
/* @__PURE__ */ (0,
|
|
29810
|
-
/* @__PURE__ */ (0,
|
|
30058
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-gray-600", children: user.name.charAt(0).toUpperCase() }) }),
|
|
30059
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 text-left", children: [
|
|
30060
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children: user.name }),
|
|
30061
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500", children: user.profileName })
|
|
29811
30062
|
] }),
|
|
29812
|
-
/* @__PURE__ */ (0,
|
|
30063
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29813
30064
|
"div",
|
|
29814
30065
|
{
|
|
29815
30066
|
className: cn(
|
|
29816
30067
|
"w-5 h-5 rounded-full border-2 flex items-center justify-center",
|
|
29817
30068
|
selectedIds.has(user.userInstitutionId) ? "bg-primary-500 border-primary-500" : "border-gray-300"
|
|
29818
30069
|
),
|
|
29819
|
-
children: selectedIds.has(user.userInstitutionId) && /* @__PURE__ */ (0,
|
|
30070
|
+
children: selectedIds.has(user.userInstitutionId) && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-2 h-2 bg-white rounded-full" })
|
|
29820
30071
|
}
|
|
29821
30072
|
)
|
|
29822
30073
|
]
|
|
@@ -29826,9 +30077,9 @@ var UserSelector = ({
|
|
|
29826
30077
|
function Chat(props) {
|
|
29827
30078
|
const { userId, token } = props;
|
|
29828
30079
|
if (!userId || !token) {
|
|
29829
|
-
return /* @__PURE__ */ (0,
|
|
30080
|
+
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
30081
|
}
|
|
29831
|
-
return /* @__PURE__ */ (0,
|
|
30082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(ChatContent, { ...props });
|
|
29832
30083
|
}
|
|
29833
30084
|
function ChatContent({
|
|
29834
30085
|
apiClient,
|
|
@@ -29843,16 +30094,16 @@ function ChatContent({
|
|
|
29843
30094
|
onRoomChange,
|
|
29844
30095
|
onBackToList
|
|
29845
30096
|
}) {
|
|
29846
|
-
const [view, setView] = (0,
|
|
29847
|
-
const [selectedRoom, setSelectedRoom] = (0,
|
|
30097
|
+
const [view, setView] = (0, import_react100.useState)("list");
|
|
30098
|
+
const [selectedRoom, setSelectedRoom] = (0, import_react100.useState)(
|
|
29848
30099
|
null
|
|
29849
30100
|
);
|
|
29850
|
-
const [selectedUserIds, setSelectedUserIds] = (0,
|
|
30101
|
+
const [selectedUserIds, setSelectedUserIds] = (0, import_react100.useState)(
|
|
29851
30102
|
/* @__PURE__ */ new Set()
|
|
29852
30103
|
);
|
|
29853
|
-
const [messageInput, setMessageInput] = (0,
|
|
29854
|
-
const [showCreateModal, setShowCreateModal] = (0,
|
|
29855
|
-
const hasHandledInitialRoomRef = (0,
|
|
30104
|
+
const [messageInput, setMessageInput] = (0, import_react100.useState)("");
|
|
30105
|
+
const [showCreateModal, setShowCreateModal] = (0, import_react100.useState)(false);
|
|
30106
|
+
const hasHandledInitialRoomRef = (0, import_react100.useRef)(false);
|
|
29856
30107
|
const {
|
|
29857
30108
|
rooms,
|
|
29858
30109
|
availableUsers,
|
|
@@ -29880,10 +30131,10 @@ function ChatContent({
|
|
|
29880
30131
|
const getRoleLabel = () => {
|
|
29881
30132
|
return userRole === "TEACHER" /* TEACHER */ ? "Professor" : "Aluno";
|
|
29882
30133
|
};
|
|
29883
|
-
(0,
|
|
30134
|
+
(0, import_react100.useEffect)(() => {
|
|
29884
30135
|
fetchRooms();
|
|
29885
30136
|
}, [fetchRooms]);
|
|
29886
|
-
(0,
|
|
30137
|
+
(0, import_react100.useEffect)(() => {
|
|
29887
30138
|
if (hasHandledInitialRoomRef.current) {
|
|
29888
30139
|
return;
|
|
29889
30140
|
}
|
|
@@ -29905,7 +30156,7 @@ function ChatContent({
|
|
|
29905
30156
|
onBackToList?.();
|
|
29906
30157
|
}
|
|
29907
30158
|
}, [initialRoomId, rooms, roomsLoading, onBackToList]);
|
|
29908
|
-
const handleSelectRoom = (0,
|
|
30159
|
+
const handleSelectRoom = (0, import_react100.useCallback)(
|
|
29909
30160
|
(room) => {
|
|
29910
30161
|
setSelectedRoom(room);
|
|
29911
30162
|
setView("room");
|
|
@@ -29913,12 +30164,12 @@ function ChatContent({
|
|
|
29913
30164
|
},
|
|
29914
30165
|
[onRoomChange]
|
|
29915
30166
|
);
|
|
29916
|
-
const handleOpenCreateModal = (0,
|
|
30167
|
+
const handleOpenCreateModal = (0, import_react100.useCallback)(async () => {
|
|
29917
30168
|
await fetchAvailableUsers();
|
|
29918
30169
|
setSelectedUserIds(/* @__PURE__ */ new Set());
|
|
29919
30170
|
setShowCreateModal(true);
|
|
29920
30171
|
}, [fetchAvailableUsers]);
|
|
29921
|
-
const handleToggleUser = (0,
|
|
30172
|
+
const handleToggleUser = (0, import_react100.useCallback)((id) => {
|
|
29922
30173
|
setSelectedUserIds((prev) => {
|
|
29923
30174
|
const next = new Set(prev);
|
|
29924
30175
|
if (next.has(id)) {
|
|
@@ -29929,7 +30180,7 @@ function ChatContent({
|
|
|
29929
30180
|
return next;
|
|
29930
30181
|
});
|
|
29931
30182
|
}, []);
|
|
29932
|
-
const handleCreateRoom = (0,
|
|
30183
|
+
const handleCreateRoom = (0, import_react100.useCallback)(async () => {
|
|
29933
30184
|
if (selectedUserIds.size === 0) return;
|
|
29934
30185
|
const room = await createRoom(Array.from(selectedUserIds));
|
|
29935
30186
|
if (room) {
|
|
@@ -29938,30 +30189,30 @@ function ChatContent({
|
|
|
29938
30189
|
onRoomChange?.(room.id);
|
|
29939
30190
|
}
|
|
29940
30191
|
}, [selectedUserIds, createRoom, onRoomChange]);
|
|
29941
|
-
const handleSendMessage = (0,
|
|
30192
|
+
const handleSendMessage = (0, import_react100.useCallback)(() => {
|
|
29942
30193
|
if (!messageInput.trim()) return;
|
|
29943
30194
|
sendMessage(messageInput);
|
|
29944
30195
|
setMessageInput("");
|
|
29945
30196
|
}, [messageInput, sendMessage]);
|
|
29946
|
-
const handleBackToList = (0,
|
|
30197
|
+
const handleBackToList = (0, import_react100.useCallback)(() => {
|
|
29947
30198
|
setSelectedRoom(null);
|
|
29948
30199
|
setView("list");
|
|
29949
30200
|
onBackToList?.();
|
|
29950
30201
|
}, [onBackToList]);
|
|
29951
30202
|
const renderMessagesContent = () => {
|
|
29952
30203
|
if (chatError) {
|
|
29953
|
-
return /* @__PURE__ */ (0,
|
|
29954
|
-
/* @__PURE__ */ (0,
|
|
29955
|
-
/* @__PURE__ */ (0,
|
|
30204
|
+
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: [
|
|
30205
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-red-500 mb-2", children: "Erro de conexao com o chat" }),
|
|
30206
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500", children: "Tentando reconectar..." })
|
|
29956
30207
|
] }) });
|
|
29957
30208
|
}
|
|
29958
30209
|
const userMessages = messages?.filter(
|
|
29959
30210
|
(message) => message.messageType !== CHAT_MESSAGE_TYPES.SYSTEM
|
|
29960
30211
|
);
|
|
29961
30212
|
if (!userMessages?.length) {
|
|
29962
|
-
return /* @__PURE__ */ (0,
|
|
30213
|
+
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
30214
|
}
|
|
29964
|
-
return userMessages.map((message) => /* @__PURE__ */ (0,
|
|
30215
|
+
return userMessages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29965
30216
|
MessageBubble,
|
|
29966
30217
|
{
|
|
29967
30218
|
message,
|
|
@@ -29970,57 +30221,57 @@ function ChatContent({
|
|
|
29970
30221
|
message.id
|
|
29971
30222
|
));
|
|
29972
30223
|
};
|
|
29973
|
-
const renderRoomList = () => /* @__PURE__ */ (0,
|
|
29974
|
-
/* @__PURE__ */ (0,
|
|
29975
|
-
/* @__PURE__ */ (0,
|
|
29976
|
-
/* @__PURE__ */ (0,
|
|
30224
|
+
const renderRoomList = () => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex flex-col h-full", children: [
|
|
30225
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "p-4 border-b border-background-200 flex items-center justify-between", children: [
|
|
30226
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
30227
|
+
/* @__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
30228
|
"img",
|
|
29978
30229
|
{
|
|
29979
30230
|
src: userPhoto,
|
|
29980
30231
|
alt: userName,
|
|
29981
30232
|
className: "w-10 h-10 rounded-full object-cover"
|
|
29982
30233
|
}
|
|
29983
|
-
) : /* @__PURE__ */ (0,
|
|
29984
|
-
/* @__PURE__ */ (0,
|
|
29985
|
-
/* @__PURE__ */ (0,
|
|
29986
|
-
/* @__PURE__ */ (0,
|
|
30234
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-primary-600", children: userName.charAt(0).toUpperCase() }) }),
|
|
30235
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { children: [
|
|
30236
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-900", children: "Conversas" }),
|
|
30237
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Text_default, { size: "xs", className: "text-text-500", children: [
|
|
29987
30238
|
userName,
|
|
29988
30239
|
" - ",
|
|
29989
30240
|
getRoleLabel()
|
|
29990
30241
|
] })
|
|
29991
30242
|
] })
|
|
29992
30243
|
] }),
|
|
29993
|
-
/* @__PURE__ */ (0,
|
|
30244
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
29994
30245
|
Button_default,
|
|
29995
30246
|
{
|
|
29996
30247
|
variant: "solid",
|
|
29997
30248
|
size: "small",
|
|
29998
30249
|
onClick: handleOpenCreateModal,
|
|
29999
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
30250
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react101.PlusIcon, { size: 16 }),
|
|
30000
30251
|
children: "Nova conversa"
|
|
30001
30252
|
}
|
|
30002
30253
|
)
|
|
30003
30254
|
] }),
|
|
30004
|
-
/* @__PURE__ */ (0,
|
|
30005
|
-
roomsError && /* @__PURE__ */ (0,
|
|
30006
|
-
/* @__PURE__ */ (0,
|
|
30007
|
-
/* @__PURE__ */ (0,
|
|
30255
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 overflow-y-auto p-2", children: [
|
|
30256
|
+
roomsError && /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "p-4 text-center", children: [
|
|
30257
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-red-500 mb-2", children: "Erro ao carregar conversas" }),
|
|
30258
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Button_default, { variant: "outline", size: "small", onClick: fetchRooms, children: "Tentar novamente" })
|
|
30008
30259
|
] }),
|
|
30009
|
-
!roomsError && roomsLoading && /* @__PURE__ */ (0,
|
|
30010
|
-
/* @__PURE__ */ (0,
|
|
30011
|
-
/* @__PURE__ */ (0,
|
|
30012
|
-
/* @__PURE__ */ (0,
|
|
30013
|
-
/* @__PURE__ */ (0,
|
|
30260
|
+
!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: [
|
|
30261
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SkeletonRounded, { className: "w-10 h-10" }),
|
|
30262
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1", children: [
|
|
30263
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SkeletonText, { className: "w-3/4 h-4 mb-2" }),
|
|
30264
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SkeletonText, { className: "w-1/2 h-3" })
|
|
30014
30265
|
] })
|
|
30015
30266
|
] }, i)) }),
|
|
30016
|
-
!roomsError && !roomsLoading && !rooms?.length && /* @__PURE__ */ (0,
|
|
30267
|
+
!roomsError && !roomsLoading && !rooms?.length && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30017
30268
|
EmptyState_default,
|
|
30018
30269
|
{
|
|
30019
30270
|
title: "Nenhuma conversa",
|
|
30020
30271
|
description: "Comece uma nova conversa clicando no botao acima"
|
|
30021
30272
|
}
|
|
30022
30273
|
),
|
|
30023
|
-
!roomsError && !roomsLoading && !!rooms?.length && /* @__PURE__ */ (0,
|
|
30274
|
+
!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
30275
|
RoomItem,
|
|
30025
30276
|
{
|
|
30026
30277
|
room,
|
|
@@ -30033,18 +30284,18 @@ function ChatContent({
|
|
|
30033
30284
|
] });
|
|
30034
30285
|
const renderChatRoom = () => {
|
|
30035
30286
|
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,
|
|
30287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex h-full", children: [
|
|
30288
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 flex flex-col", children: [
|
|
30289
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "p-4 border-b border-background-200 flex items-center gap-3", children: [
|
|
30290
|
+
/* @__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 }) }),
|
|
30291
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1", children: [
|
|
30292
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "md", weight: "semibold", className: "text-text-900", children: selectedRoom.name }),
|
|
30293
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "xs", className: "text-text-500", children: isConnected ? "Conectado" : "Conectando..." })
|
|
30043
30294
|
] })
|
|
30044
30295
|
] }),
|
|
30045
|
-
/* @__PURE__ */ (0,
|
|
30046
|
-
/* @__PURE__ */ (0,
|
|
30047
|
-
/* @__PURE__ */ (0,
|
|
30296
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "flex-1 overflow-y-auto p-4", children: renderMessagesContent() }),
|
|
30297
|
+
/* @__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: [
|
|
30298
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30048
30299
|
Input_default,
|
|
30049
30300
|
{
|
|
30050
30301
|
placeholder: "Digite sua mensagem...",
|
|
@@ -30059,24 +30310,24 @@ function ChatContent({
|
|
|
30059
30310
|
className: "flex-1"
|
|
30060
30311
|
}
|
|
30061
30312
|
),
|
|
30062
|
-
/* @__PURE__ */ (0,
|
|
30313
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30063
30314
|
Button_default,
|
|
30064
30315
|
{
|
|
30065
30316
|
variant: "solid",
|
|
30066
30317
|
onClick: handleSendMessage,
|
|
30067
30318
|
disabled: !messageInput.trim() || !isConnected,
|
|
30068
|
-
children: /* @__PURE__ */ (0,
|
|
30319
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react101.PaperPlaneTiltIcon, { size: 20 })
|
|
30069
30320
|
}
|
|
30070
30321
|
)
|
|
30071
30322
|
] }) })
|
|
30072
30323
|
] }),
|
|
30073
|
-
/* @__PURE__ */ (0,
|
|
30074
|
-
/* @__PURE__ */ (0,
|
|
30324
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "w-64 border-l border-background-200 p-4 hidden lg:block", children: [
|
|
30325
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Text_default, { size: "sm", weight: "semibold", className: "text-text-900 mb-3", children: [
|
|
30075
30326
|
"Participantes (",
|
|
30076
30327
|
participants?.length ?? 0,
|
|
30077
30328
|
")"
|
|
30078
30329
|
] }),
|
|
30079
|
-
/* @__PURE__ */ (0,
|
|
30330
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "space-y-1", children: participants?.map((participant) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30080
30331
|
ParticipantItem,
|
|
30081
30332
|
{
|
|
30082
30333
|
participant
|
|
@@ -30086,7 +30337,7 @@ function ChatContent({
|
|
|
30086
30337
|
] })
|
|
30087
30338
|
] });
|
|
30088
30339
|
};
|
|
30089
|
-
return /* @__PURE__ */ (0,
|
|
30340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
30090
30341
|
"div",
|
|
30091
30342
|
{
|
|
30092
30343
|
className: cn(
|
|
@@ -30096,20 +30347,20 @@ function ChatContent({
|
|
|
30096
30347
|
children: [
|
|
30097
30348
|
view === "list" && renderRoomList(),
|
|
30098
30349
|
view === "room" && renderChatRoom(),
|
|
30099
|
-
/* @__PURE__ */ (0,
|
|
30350
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30100
30351
|
Modal_default,
|
|
30101
30352
|
{
|
|
30102
30353
|
isOpen: showCreateModal,
|
|
30103
30354
|
onClose: () => setShowCreateModal(false),
|
|
30104
30355
|
title: "Nova conversa",
|
|
30105
|
-
children: /* @__PURE__ */ (0,
|
|
30106
|
-
/* @__PURE__ */ (0,
|
|
30107
|
-
roomsLoading && /* @__PURE__ */ (0,
|
|
30108
|
-
/* @__PURE__ */ (0,
|
|
30109
|
-
/* @__PURE__ */ (0,
|
|
30356
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "p-4", children: [
|
|
30357
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Text_default, { size: "sm", className: "text-text-600 mb-4", children: "Selecione os participantes para iniciar uma conversa" }),
|
|
30358
|
+
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: [
|
|
30359
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SkeletonRounded, { className: "w-10 h-10" }),
|
|
30360
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SkeletonText, { className: "flex-1 h-4" })
|
|
30110
30361
|
] }, i)) }),
|
|
30111
|
-
!roomsLoading && !availableUsers?.length && /* @__PURE__ */ (0,
|
|
30112
|
-
!roomsLoading && !!availableUsers?.length && /* @__PURE__ */ (0,
|
|
30362
|
+
!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" }),
|
|
30363
|
+
!roomsLoading && !!availableUsers?.length && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30113
30364
|
UserSelector,
|
|
30114
30365
|
{
|
|
30115
30366
|
users: availableUsers,
|
|
@@ -30117,9 +30368,9 @@ function ChatContent({
|
|
|
30117
30368
|
onToggle: handleToggleUser
|
|
30118
30369
|
}
|
|
30119
30370
|
),
|
|
30120
|
-
/* @__PURE__ */ (0,
|
|
30121
|
-
/* @__PURE__ */ (0,
|
|
30122
|
-
/* @__PURE__ */ (0,
|
|
30371
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex justify-end gap-2 mt-6", children: [
|
|
30372
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Button_default, { variant: "outline", onClick: () => setShowCreateModal(false), children: "Cancelar" }),
|
|
30373
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
30123
30374
|
Button_default,
|
|
30124
30375
|
{
|
|
30125
30376
|
variant: "solid",
|
|
@@ -30138,9 +30389,9 @@ function ChatContent({
|
|
|
30138
30389
|
}
|
|
30139
30390
|
|
|
30140
30391
|
// src/components/Chat/ChatLoading.tsx
|
|
30141
|
-
var
|
|
30392
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
30142
30393
|
function ChatLoading() {
|
|
30143
|
-
return /* @__PURE__ */ (0,
|
|
30394
|
+
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
30395
|
}
|
|
30145
30396
|
|
|
30146
30397
|
// src/utils/chatUtils.ts
|
|
@@ -30189,7 +30440,7 @@ var CalendarActivityStatus = /* @__PURE__ */ ((CalendarActivityStatus2) => {
|
|
|
30189
30440
|
})(CalendarActivityStatus || {});
|
|
30190
30441
|
|
|
30191
30442
|
// src/hooks/useSendActivity.ts
|
|
30192
|
-
var
|
|
30443
|
+
var import_react102 = require("react");
|
|
30193
30444
|
var import_dayjs8 = __toESM(require("dayjs"));
|
|
30194
30445
|
function transformToCategoryConfig(data) {
|
|
30195
30446
|
return [
|
|
@@ -30244,21 +30495,21 @@ function useSendActivity(config) {
|
|
|
30244
30495
|
onSuccess,
|
|
30245
30496
|
onError
|
|
30246
30497
|
} = config;
|
|
30247
|
-
const [isOpen, setIsOpen] = (0,
|
|
30248
|
-
const [selectedModel, setSelectedModel] = (0,
|
|
30498
|
+
const [isOpen, setIsOpen] = (0, import_react102.useState)(false);
|
|
30499
|
+
const [selectedModel, setSelectedModel] = (0, import_react102.useState)(
|
|
30249
30500
|
null
|
|
30250
30501
|
);
|
|
30251
|
-
const [categories, setCategories] = (0,
|
|
30252
|
-
const [isLoading, setIsLoading] = (0,
|
|
30253
|
-
const [isCategoriesLoading, setIsCategoriesLoading] = (0,
|
|
30254
|
-
const categoriesLoadedRef = (0,
|
|
30255
|
-
const initialData = (0,
|
|
30502
|
+
const [categories, setCategories] = (0, import_react102.useState)([]);
|
|
30503
|
+
const [isLoading, setIsLoading] = (0, import_react102.useState)(false);
|
|
30504
|
+
const [isCategoriesLoading, setIsCategoriesLoading] = (0, import_react102.useState)(false);
|
|
30505
|
+
const categoriesLoadedRef = (0, import_react102.useRef)(false);
|
|
30506
|
+
const initialData = (0, import_react102.useMemo)(() => {
|
|
30256
30507
|
if (!selectedModel) return void 0;
|
|
30257
30508
|
return {
|
|
30258
30509
|
title: selectedModel.title
|
|
30259
30510
|
};
|
|
30260
30511
|
}, [selectedModel]);
|
|
30261
|
-
const loadCategories = (0,
|
|
30512
|
+
const loadCategories = (0, import_react102.useCallback)(async () => {
|
|
30262
30513
|
if (categoriesLoadedRef.current) return;
|
|
30263
30514
|
setIsCategoriesLoading(true);
|
|
30264
30515
|
try {
|
|
@@ -30273,7 +30524,7 @@ function useSendActivity(config) {
|
|
|
30273
30524
|
setIsCategoriesLoading(false);
|
|
30274
30525
|
}
|
|
30275
30526
|
}, [fetchCategories, onError]);
|
|
30276
|
-
const openModal = (0,
|
|
30527
|
+
const openModal = (0, import_react102.useCallback)(
|
|
30277
30528
|
(model) => {
|
|
30278
30529
|
setSelectedModel(model);
|
|
30279
30530
|
setIsOpen(true);
|
|
@@ -30281,17 +30532,17 @@ function useSendActivity(config) {
|
|
|
30281
30532
|
},
|
|
30282
30533
|
[loadCategories]
|
|
30283
30534
|
);
|
|
30284
|
-
const closeModal = (0,
|
|
30535
|
+
const closeModal = (0, import_react102.useCallback)(() => {
|
|
30285
30536
|
setIsOpen(false);
|
|
30286
30537
|
setSelectedModel(null);
|
|
30287
30538
|
}, []);
|
|
30288
|
-
const onCategoriesChange = (0,
|
|
30539
|
+
const onCategoriesChange = (0, import_react102.useCallback)(
|
|
30289
30540
|
(updatedCategories) => {
|
|
30290
30541
|
setCategories(updatedCategories);
|
|
30291
30542
|
},
|
|
30292
30543
|
[]
|
|
30293
30544
|
);
|
|
30294
|
-
const handleSubmit = (0,
|
|
30545
|
+
const handleSubmit = (0, import_react102.useCallback)(
|
|
30295
30546
|
async (data) => {
|
|
30296
30547
|
if (!selectedModel) return;
|
|
30297
30548
|
setIsLoading(true);
|
|
@@ -30400,6 +30651,7 @@ function useSendActivity(config) {
|
|
|
30400
30651
|
CorrectActivityModal,
|
|
30401
30652
|
CreateActivity,
|
|
30402
30653
|
DEFAULT_ACTIVITIES_PAGINATION,
|
|
30654
|
+
DEFAULT_GOAL_DRAFTS_PAGINATION,
|
|
30403
30655
|
DEFAULT_GOAL_MODELS_PAGINATION,
|
|
30404
30656
|
DEFAULT_MODELS_PAGINATION,
|
|
30405
30657
|
DIFFICULTY_LEVEL_ENUM,
|
|
@@ -30423,12 +30675,14 @@ function useSendActivity(config) {
|
|
|
30423
30675
|
GoalBadgeActionType,
|
|
30424
30676
|
GoalDisplayStatus,
|
|
30425
30677
|
GoalDraftType,
|
|
30678
|
+
GoalDraftsTab,
|
|
30426
30679
|
GoalPageTab,
|
|
30427
30680
|
IconButton,
|
|
30428
30681
|
IconRender,
|
|
30429
30682
|
IconRoundedButton,
|
|
30430
30683
|
ImageUpload,
|
|
30431
30684
|
Input,
|
|
30685
|
+
LESSON_AVAILABILITY,
|
|
30432
30686
|
LatexRenderer,
|
|
30433
30687
|
LessonPreview,
|
|
30434
30688
|
LoadingModal,
|
|
@@ -30539,11 +30793,13 @@ function useSendActivity(config) {
|
|
|
30539
30793
|
activitiesHistoryApiResponseSchema,
|
|
30540
30794
|
activityModelsApiResponseSchema,
|
|
30541
30795
|
buildUserFilterData,
|
|
30796
|
+
checkLessonAvailability,
|
|
30542
30797
|
cn,
|
|
30543
30798
|
convertActivityFiltersToQuestionsFilter,
|
|
30544
30799
|
createActivitiesHistoryHook,
|
|
30545
30800
|
createActivityFiltersDataHook,
|
|
30546
30801
|
createActivityModelsHook,
|
|
30802
|
+
createGoalDraftsHook,
|
|
30547
30803
|
createGoalModelsHook,
|
|
30548
30804
|
createNotificationStore,
|
|
30549
30805
|
createNotificationsHook,
|
|
@@ -30556,6 +30812,7 @@ function useSendActivity(config) {
|
|
|
30556
30812
|
createUseActivityModels,
|
|
30557
30813
|
createUseChat,
|
|
30558
30814
|
createUseChatRooms,
|
|
30815
|
+
createUseGoalDrafts,
|
|
30559
30816
|
createUseGoalModels,
|
|
30560
30817
|
createUseNotificationStore,
|
|
30561
30818
|
createUseNotifications,
|
|
@@ -30602,6 +30859,7 @@ function useSendActivity(config) {
|
|
|
30602
30859
|
goalModelsApiResponseSchema,
|
|
30603
30860
|
goalsHistoryApiResponseSchema,
|
|
30604
30861
|
handleActivityFetchError,
|
|
30862
|
+
handleGoalDraftFetchError,
|
|
30605
30863
|
handleGoalFetchError,
|
|
30606
30864
|
handleGoalModelFetchError,
|
|
30607
30865
|
handleLessonDetailsFetchError,
|
|
@@ -30610,6 +30868,8 @@ function useSendActivity(config) {
|
|
|
30610
30868
|
isChatUserInfoValid,
|
|
30611
30869
|
isDeadlinePassed,
|
|
30612
30870
|
isFormValid,
|
|
30871
|
+
isLessonExpired,
|
|
30872
|
+
isLessonNotYetAvailable,
|
|
30613
30873
|
isStepValid,
|
|
30614
30874
|
mapActivityStatusToDisplay,
|
|
30615
30875
|
mapApiStatusToInternal,
|