analytica-frontend-lib 1.2.83 → 1.2.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActivitiesHistory/index.js +156 -147
- package/dist/ActivitiesHistory/index.js.map +1 -1
- package/dist/ActivitiesHistory/index.mjs +155 -146
- package/dist/ActivitiesHistory/index.mjs.map +1 -1
- package/dist/ActivityCardQuestionBanks/index.d.ts +6 -4
- package/dist/ActivityCardQuestionBanks/index.d.ts.map +1 -1
- package/dist/ActivityCardQuestionBanks/index.js.map +1 -1
- package/dist/ActivityCardQuestionBanks/index.mjs.map +1 -1
- package/dist/RecommendedLessonsHistory/index.js +460 -286
- package/dist/RecommendedLessonsHistory/index.js.map +1 -1
- package/dist/RecommendedLessonsHistory/index.mjs +409 -235
- package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.js.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.mjs.map +1 -1
- package/dist/hooks/useActivityModels/index.d.ts +1 -1
- package/dist/hooks/useActivityModels/index.d.ts.map +1 -1
- package/dist/hooks/useActivityModels/index.js +13 -2
- package/dist/hooks/useActivityModels/index.js.map +1 -1
- package/dist/hooks/useActivityModels/index.mjs +13 -2
- package/dist/hooks/useActivityModels/index.mjs.map +1 -1
- package/dist/hooks/useActivityModels.d.ts +1 -1
- package/dist/hooks/useActivityModels.d.ts.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 +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2251 -1058
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2264 -1078
- package/dist/index.mjs.map +1 -1
- package/dist/types/activitiesHistory/index.d.ts +11 -1
- package/dist/types/activitiesHistory/index.d.ts.map +1 -1
- package/dist/types/activitiesHistory/index.js.map +1 -1
- package/dist/types/activitiesHistory/index.mjs.map +1 -1
- package/dist/types/activitiesHistory.d.ts +11 -1
- package/dist/types/activitiesHistory.d.ts.map +1 -1
- package/dist/types/questions.d.ts +1 -0
- package/dist/types/questions.d.ts.map +1 -1
- package/package.json +3 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as useState17, useCallback as useCallback7, useMemo as useMemo7, useRef as useRef8, useEffect as useEffect16 } from "react";
|
|
3
3
|
import { Plus as Plus2, CaretRight as CaretRight6, Trash as Trash2, PencilSimple as PencilSimple2 } from "phosphor-react";
|
|
4
4
|
|
|
5
5
|
// src/utils/utils.ts
|
|
@@ -550,7 +550,7 @@ var injectStore = (children, store) => Children.map(children, (child) => {
|
|
|
550
550
|
});
|
|
551
551
|
|
|
552
552
|
// src/components/TableProvider/TableProvider.tsx
|
|
553
|
-
import { useState as
|
|
553
|
+
import { useState as useState16, useEffect as useEffect15, useMemo as useMemo6, useCallback as useCallback6 } from "react";
|
|
554
554
|
|
|
555
555
|
// src/components/Table/Table.tsx
|
|
556
556
|
import {
|
|
@@ -2671,7 +2671,7 @@ Search.displayName = "Search";
|
|
|
2671
2671
|
var Search_default = Search;
|
|
2672
2672
|
|
|
2673
2673
|
// src/components/CheckBoxGroup/CheckBoxGroup.tsx
|
|
2674
|
-
import { useEffect as useEffect14, useMemo as useMemo5, useRef as useRef7, useState as
|
|
2674
|
+
import { useEffect as useEffect14, useMemo as useMemo5, useRef as useRef7, useState as useState15 } from "react";
|
|
2675
2675
|
|
|
2676
2676
|
// src/components/CheckBox/CheckBox.tsx
|
|
2677
2677
|
import {
|
|
@@ -5511,6 +5511,120 @@ var getSubjectInfo = (subject) => {
|
|
|
5511
5511
|
};
|
|
5512
5512
|
};
|
|
5513
5513
|
|
|
5514
|
+
// src/components/shared/ModelsTabBase/createModelsTableColumnsBase.tsx
|
|
5515
|
+
import { Trash, PencilSimple, PaperPlaneTilt } from "phosphor-react";
|
|
5516
|
+
|
|
5517
|
+
// src/utils/renderSubjectCell.tsx
|
|
5518
|
+
import { jsx as jsx33, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5519
|
+
var renderSubjectCell = (subjectName, mapSubjectNameToEnum, showEmptyDash = false) => {
|
|
5520
|
+
if (!subjectName) {
|
|
5521
|
+
return showEmptyDash ? /* @__PURE__ */ jsx33(Text_default, { size: "sm", color: "text-text-400", children: "-" }) : null;
|
|
5522
|
+
}
|
|
5523
|
+
const subjectEnum = mapSubjectNameToEnum?.(subjectName);
|
|
5524
|
+
if (!subjectEnum) {
|
|
5525
|
+
return /* @__PURE__ */ jsx33(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
5526
|
+
}
|
|
5527
|
+
const subjectInfo = getSubjectInfo(subjectEnum);
|
|
5528
|
+
return /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2", title: subjectName, children: [
|
|
5529
|
+
/* @__PURE__ */ jsx33(
|
|
5530
|
+
"span",
|
|
5531
|
+
{
|
|
5532
|
+
className: cn(
|
|
5533
|
+
"w-[21px] h-[21px] flex items-center justify-center rounded-sm text-text-950 shrink-0",
|
|
5534
|
+
subjectInfo.colorClass
|
|
5535
|
+
),
|
|
5536
|
+
children: subjectInfo.icon
|
|
5537
|
+
}
|
|
5538
|
+
),
|
|
5539
|
+
/* @__PURE__ */ jsx33(Text_default, { size: "sm", className: "truncate", children: subjectName })
|
|
5540
|
+
] });
|
|
5541
|
+
};
|
|
5542
|
+
|
|
5543
|
+
// src/components/shared/ModelsTabBase/createModelsTableColumnsBase.tsx
|
|
5544
|
+
import { jsx as jsx34, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5545
|
+
var createModelsTableColumnsBase = (mapSubjectNameToEnum, onSend, onEdit, onDelete, config) => [
|
|
5546
|
+
{
|
|
5547
|
+
key: "title",
|
|
5548
|
+
label: "T\xEDtulo",
|
|
5549
|
+
sortable: true,
|
|
5550
|
+
className: "max-w-[400px]",
|
|
5551
|
+
render: (value) => {
|
|
5552
|
+
const title = typeof value === "string" ? value : "";
|
|
5553
|
+
return /* @__PURE__ */ jsx34(Text_default, { size: "sm", title, className: "truncate block", children: title });
|
|
5554
|
+
}
|
|
5555
|
+
},
|
|
5556
|
+
{
|
|
5557
|
+
key: "savedAt",
|
|
5558
|
+
label: "Salvo em",
|
|
5559
|
+
sortable: true,
|
|
5560
|
+
className: "w-[120px]"
|
|
5561
|
+
},
|
|
5562
|
+
{
|
|
5563
|
+
key: "subject",
|
|
5564
|
+
label: "Mat\xE9ria",
|
|
5565
|
+
sortable: true,
|
|
5566
|
+
className: "max-w-[160px]",
|
|
5567
|
+
render: (value) => {
|
|
5568
|
+
const subjectName = typeof value === "string" ? value : "";
|
|
5569
|
+
return renderSubjectCell(subjectName, mapSubjectNameToEnum, true);
|
|
5570
|
+
}
|
|
5571
|
+
},
|
|
5572
|
+
{
|
|
5573
|
+
key: "actions",
|
|
5574
|
+
label: "",
|
|
5575
|
+
sortable: false,
|
|
5576
|
+
className: "w-[220px]",
|
|
5577
|
+
render: (_value, row) => {
|
|
5578
|
+
const handleSend = (e) => {
|
|
5579
|
+
e.stopPropagation();
|
|
5580
|
+
onSend?.(row);
|
|
5581
|
+
};
|
|
5582
|
+
const handleEdit = (e) => {
|
|
5583
|
+
e.stopPropagation();
|
|
5584
|
+
onEdit?.(row);
|
|
5585
|
+
};
|
|
5586
|
+
const handleDelete = (e) => {
|
|
5587
|
+
e.stopPropagation();
|
|
5588
|
+
onDelete(row);
|
|
5589
|
+
};
|
|
5590
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2 justify-end", children: [
|
|
5591
|
+
onSend && /* @__PURE__ */ jsx34(
|
|
5592
|
+
Button_default,
|
|
5593
|
+
{
|
|
5594
|
+
variant: "outline",
|
|
5595
|
+
action: "primary",
|
|
5596
|
+
size: "small",
|
|
5597
|
+
iconLeft: /* @__PURE__ */ jsx34(PaperPlaneTilt, { size: 16 }),
|
|
5598
|
+
onClick: handleSend,
|
|
5599
|
+
"aria-label": config.sendButtonAriaLabel,
|
|
5600
|
+
children: config.sendButtonLabel
|
|
5601
|
+
}
|
|
5602
|
+
),
|
|
5603
|
+
/* @__PURE__ */ jsx34(
|
|
5604
|
+
IconButton_default,
|
|
5605
|
+
{
|
|
5606
|
+
icon: /* @__PURE__ */ jsx34(Trash, { size: 20 }),
|
|
5607
|
+
size: "md",
|
|
5608
|
+
onClick: handleDelete,
|
|
5609
|
+
"aria-label": config.deleteButtonAriaLabel,
|
|
5610
|
+
className: "text-text-600 hover:text-error-500 hover:bg-transparent"
|
|
5611
|
+
}
|
|
5612
|
+
),
|
|
5613
|
+
onEdit && /* @__PURE__ */ jsx34(
|
|
5614
|
+
IconButton_default,
|
|
5615
|
+
{
|
|
5616
|
+
icon: /* @__PURE__ */ jsx34(PencilSimple, { size: 20 }),
|
|
5617
|
+
size: "md",
|
|
5618
|
+
onClick: handleEdit,
|
|
5619
|
+
"aria-label": config.editButtonAriaLabel,
|
|
5620
|
+
className: "text-text-600 hover:text-primary-700 hover:bg-transparent"
|
|
5621
|
+
}
|
|
5622
|
+
)
|
|
5623
|
+
] });
|
|
5624
|
+
}
|
|
5625
|
+
}
|
|
5626
|
+
];
|
|
5627
|
+
|
|
5514
5628
|
// src/types/common.ts
|
|
5515
5629
|
var getStatusBadgeAction = (status) => {
|
|
5516
5630
|
const actionMap = {
|
|
@@ -5803,40 +5917,91 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
|
|
|
5803
5917
|
};
|
|
5804
5918
|
};
|
|
5805
5919
|
|
|
5806
|
-
// src/
|
|
5807
|
-
import {
|
|
5808
|
-
var
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
),
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5920
|
+
// src/hooks/useGoalDrafts.ts
|
|
5921
|
+
import { useState as useState13, useCallback as useCallback4 } from "react";
|
|
5922
|
+
var DEFAULT_GOAL_DRAFTS_PAGINATION = {
|
|
5923
|
+
total: 0,
|
|
5924
|
+
page: 1,
|
|
5925
|
+
limit: 10,
|
|
5926
|
+
totalPages: 0
|
|
5927
|
+
};
|
|
5928
|
+
var handleGoalDraftFetchError = createFetchErrorHandler(
|
|
5929
|
+
"Erro ao validar dados de rascunhos de aulas",
|
|
5930
|
+
"Erro ao carregar rascunhos de aulas"
|
|
5931
|
+
);
|
|
5932
|
+
var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
5933
|
+
return () => {
|
|
5934
|
+
const [state, setState] = useState13({
|
|
5935
|
+
models: [],
|
|
5936
|
+
loading: false,
|
|
5937
|
+
error: null,
|
|
5938
|
+
pagination: DEFAULT_GOAL_DRAFTS_PAGINATION
|
|
5939
|
+
});
|
|
5940
|
+
const fetchModels = useCallback4(
|
|
5941
|
+
async (filters, subjectsMap) => {
|
|
5942
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
5943
|
+
try {
|
|
5944
|
+
const responseData = await fetchGoalDrafts(filters);
|
|
5945
|
+
const validatedData = goalModelsApiResponseSchema.parse(responseData);
|
|
5946
|
+
const tableItems = validatedData.data.drafts.map(
|
|
5947
|
+
(draft) => transformGoalModelToTableItem(draft, subjectsMap)
|
|
5948
|
+
);
|
|
5949
|
+
const limit = filters?.limit || 10;
|
|
5950
|
+
const page = filters?.page || 1;
|
|
5951
|
+
const total = validatedData.data.total;
|
|
5952
|
+
const totalPages = Math.ceil(total / limit);
|
|
5953
|
+
setState({
|
|
5954
|
+
models: tableItems,
|
|
5955
|
+
loading: false,
|
|
5956
|
+
error: null,
|
|
5957
|
+
pagination: {
|
|
5958
|
+
total,
|
|
5959
|
+
page,
|
|
5960
|
+
limit,
|
|
5961
|
+
totalPages
|
|
5962
|
+
}
|
|
5963
|
+
});
|
|
5964
|
+
} catch (error) {
|
|
5965
|
+
const errorMessage = handleGoalDraftFetchError(error);
|
|
5966
|
+
setState((prev) => ({
|
|
5967
|
+
...prev,
|
|
5968
|
+
loading: false,
|
|
5969
|
+
error: errorMessage
|
|
5970
|
+
}));
|
|
5971
|
+
}
|
|
5972
|
+
},
|
|
5973
|
+
[fetchGoalDrafts]
|
|
5974
|
+
);
|
|
5975
|
+
const deleteModel = useCallback4(
|
|
5976
|
+
async (id) => {
|
|
5977
|
+
try {
|
|
5978
|
+
await deleteGoalDraft(id);
|
|
5979
|
+
return true;
|
|
5980
|
+
} catch (error) {
|
|
5981
|
+
console.error("Erro ao deletar rascunho:", error);
|
|
5982
|
+
return false;
|
|
5983
|
+
}
|
|
5984
|
+
},
|
|
5985
|
+
[deleteGoalDraft]
|
|
5986
|
+
);
|
|
5987
|
+
return {
|
|
5988
|
+
...state,
|
|
5989
|
+
fetchModels,
|
|
5990
|
+
deleteModel
|
|
5991
|
+
};
|
|
5992
|
+
};
|
|
5834
5993
|
};
|
|
5835
5994
|
|
|
5836
5995
|
// src/components/shared/ModelsTabBase/ModelsTabBase.tsx
|
|
5837
|
-
import { useState as
|
|
5996
|
+
import { useState as useState14, useCallback as useCallback5, useMemo as useMemo4, useRef as useRef6, useEffect as useEffect13 } from "react";
|
|
5838
5997
|
import { Plus } from "phosphor-react";
|
|
5839
|
-
|
|
5998
|
+
|
|
5999
|
+
// src/components/ActivitiesHistory/components/ErrorDisplay.tsx
|
|
6000
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
6001
|
+
var ErrorDisplay = ({ error }) => /* @__PURE__ */ jsx35("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx35(Text_default, { size: "lg", color: "text-error-500", children: error }) });
|
|
6002
|
+
|
|
6003
|
+
// src/components/shared/ModelsTabBase/ModelsTabBase.tsx
|
|
6004
|
+
import { Fragment as Fragment7, jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5840
6005
|
var ModelsTabBase = ({
|
|
5841
6006
|
fetchModels: fetchModelsProp,
|
|
5842
6007
|
deleteModel: deleteModelProp,
|
|
@@ -5854,8 +6019,8 @@ var ModelsTabBase = ({
|
|
|
5854
6019
|
buildFiltersFromParams: buildFiltersFromParams2,
|
|
5855
6020
|
createUseModels
|
|
5856
6021
|
}) => {
|
|
5857
|
-
const [deleteDialogOpen, setDeleteDialogOpen] =
|
|
5858
|
-
const [modelToDelete, setModelToDelete] =
|
|
6022
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = useState14(false);
|
|
6023
|
+
const [modelToDelete, setModelToDelete] = useState14(null);
|
|
5859
6024
|
const { addToast } = useToast();
|
|
5860
6025
|
const fetchModelsRef = useRef6(fetchModelsProp);
|
|
5861
6026
|
fetchModelsRef.current = fetchModelsProp;
|
|
@@ -5882,7 +6047,7 @@ var ModelsTabBase = ({
|
|
|
5882
6047
|
() => createFiltersConfig(userFilterData),
|
|
5883
6048
|
[createFiltersConfig, userFilterData]
|
|
5884
6049
|
);
|
|
5885
|
-
const handleDeleteClick =
|
|
6050
|
+
const handleDeleteClick = useCallback5((model) => {
|
|
5886
6051
|
setModelToDelete(model);
|
|
5887
6052
|
setDeleteDialogOpen(true);
|
|
5888
6053
|
}, []);
|
|
@@ -5901,7 +6066,7 @@ var ModelsTabBase = ({
|
|
|
5901
6066
|
handleDeleteClick
|
|
5902
6067
|
]
|
|
5903
6068
|
);
|
|
5904
|
-
const handleParamsChange =
|
|
6069
|
+
const handleParamsChange = useCallback5(
|
|
5905
6070
|
(params) => {
|
|
5906
6071
|
const filters = buildFiltersFromParams2(params);
|
|
5907
6072
|
fetchModels(filters, subjectsMapRef.current);
|
|
@@ -5911,7 +6076,7 @@ var ModelsTabBase = ({
|
|
|
5911
6076
|
useEffect13(() => {
|
|
5912
6077
|
fetchModels({ page: 1, limit: 10 }, subjectsMapRef.current);
|
|
5913
6078
|
}, [fetchModels]);
|
|
5914
|
-
const handleConfirmDelete =
|
|
6079
|
+
const handleConfirmDelete = useCallback5(async () => {
|
|
5915
6080
|
if (modelToDelete) {
|
|
5916
6081
|
const success = await deleteModel(modelToDelete.id);
|
|
5917
6082
|
if (success) {
|
|
@@ -5924,13 +6089,13 @@ var ModelsTabBase = ({
|
|
|
5924
6089
|
setDeleteDialogOpen(false);
|
|
5925
6090
|
setModelToDelete(null);
|
|
5926
6091
|
}, [modelToDelete, deleteModel, fetchModels, addToast]);
|
|
5927
|
-
const handleCancelDelete =
|
|
6092
|
+
const handleCancelDelete = useCallback5(() => {
|
|
5928
6093
|
setDeleteDialogOpen(false);
|
|
5929
6094
|
setModelToDelete(null);
|
|
5930
6095
|
}, []);
|
|
5931
|
-
return /* @__PURE__ */
|
|
5932
|
-
/* @__PURE__ */
|
|
5933
|
-
modelsError ? /* @__PURE__ */
|
|
6096
|
+
return /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
6097
|
+
/* @__PURE__ */ jsx36(Toaster_default, {}),
|
|
6098
|
+
modelsError ? /* @__PURE__ */ jsx36(ErrorDisplay, { error: modelsError }) : /* @__PURE__ */ jsx36("div", { className: "w-full", "data-testid": config.testId, children: /* @__PURE__ */ jsx36(
|
|
5934
6099
|
TableProvider,
|
|
5935
6100
|
{
|
|
5936
6101
|
data: models,
|
|
@@ -5954,14 +6119,14 @@ var ModelsTabBase = ({
|
|
|
5954
6119
|
image: noSearchImage
|
|
5955
6120
|
},
|
|
5956
6121
|
emptyState: {
|
|
5957
|
-
component: /* @__PURE__ */
|
|
6122
|
+
component: /* @__PURE__ */ jsx36(
|
|
5958
6123
|
EmptyState_default,
|
|
5959
6124
|
{
|
|
5960
6125
|
image: emptyStateImage,
|
|
5961
6126
|
title: config.emptyStateTitle,
|
|
5962
6127
|
description: config.emptyStateDescription,
|
|
5963
6128
|
buttonText: "Criar modelo",
|
|
5964
|
-
buttonIcon: /* @__PURE__ */
|
|
6129
|
+
buttonIcon: /* @__PURE__ */ jsx36(Plus, { size: 18 }),
|
|
5965
6130
|
buttonVariant: "outline",
|
|
5966
6131
|
buttonAction: "primary",
|
|
5967
6132
|
onButtonClick: onCreateModel
|
|
@@ -5975,22 +6140,22 @@ var ModelsTabBase = ({
|
|
|
5975
6140
|
table,
|
|
5976
6141
|
pagination: paginationComponent
|
|
5977
6142
|
} = renderProps;
|
|
5978
|
-
return /* @__PURE__ */
|
|
5979
|
-
/* @__PURE__ */
|
|
5980
|
-
/* @__PURE__ */
|
|
6143
|
+
return /* @__PURE__ */ jsxs24("div", { className: "space-y-4", children: [
|
|
6144
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between gap-4", children: [
|
|
6145
|
+
/* @__PURE__ */ jsx36(
|
|
5981
6146
|
Button_default,
|
|
5982
6147
|
{
|
|
5983
6148
|
variant: "solid",
|
|
5984
6149
|
action: "primary",
|
|
5985
6150
|
size: "medium",
|
|
5986
6151
|
onClick: onCreateModel,
|
|
5987
|
-
iconLeft: /* @__PURE__ */
|
|
6152
|
+
iconLeft: /* @__PURE__ */ jsx36(Plus, { size: 18, weight: "bold" }),
|
|
5988
6153
|
children: "Criar modelo"
|
|
5989
6154
|
}
|
|
5990
6155
|
),
|
|
5991
6156
|
controls
|
|
5992
6157
|
] }),
|
|
5993
|
-
/* @__PURE__ */
|
|
6158
|
+
/* @__PURE__ */ jsxs24("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
|
|
5994
6159
|
table,
|
|
5995
6160
|
paginationComponent
|
|
5996
6161
|
] })
|
|
@@ -5998,7 +6163,7 @@ var ModelsTabBase = ({
|
|
|
5998
6163
|
}
|
|
5999
6164
|
}
|
|
6000
6165
|
) }),
|
|
6001
|
-
/* @__PURE__ */
|
|
6166
|
+
/* @__PURE__ */ jsx36(
|
|
6002
6167
|
AlertDialog,
|
|
6003
6168
|
{
|
|
6004
6169
|
isOpen: deleteDialogOpen,
|
|
@@ -6014,92 +6179,98 @@ var ModelsTabBase = ({
|
|
|
6014
6179
|
] });
|
|
6015
6180
|
};
|
|
6016
6181
|
|
|
6017
|
-
// src/components/
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
render: (value) => {
|
|
6027
|
-
const title = typeof value === "string" ? value : "";
|
|
6028
|
-
return /* @__PURE__ */ jsx36(Text_default, { size: "sm", title, className: "truncate block", children: title });
|
|
6029
|
-
}
|
|
6030
|
-
},
|
|
6031
|
-
{
|
|
6032
|
-
key: "savedAt",
|
|
6033
|
-
label: "Salvo em",
|
|
6034
|
-
sortable: true,
|
|
6035
|
-
className: "w-[120px]"
|
|
6036
|
-
},
|
|
6037
|
-
{
|
|
6038
|
-
key: "subject",
|
|
6039
|
-
label: "Mat\xE9ria",
|
|
6040
|
-
sortable: true,
|
|
6041
|
-
className: "max-w-[160px]",
|
|
6042
|
-
render: (value) => {
|
|
6043
|
-
const subjectName = typeof value === "string" ? value : "";
|
|
6044
|
-
return renderSubjectCell(subjectName, mapSubjectNameToEnum, true);
|
|
6045
|
-
}
|
|
6046
|
-
},
|
|
6182
|
+
// src/components/RecommendedLessonsHistory/config/draftsFiltersConfig.ts
|
|
6183
|
+
var getSubjectOptions = (data) => {
|
|
6184
|
+
if (!data?.subjects) return [];
|
|
6185
|
+
return data.subjects.map((subject) => ({
|
|
6186
|
+
id: subject.id,
|
|
6187
|
+
name: subject.name
|
|
6188
|
+
}));
|
|
6189
|
+
};
|
|
6190
|
+
var createGoalDraftsFiltersConfig = (userData) => [
|
|
6047
6191
|
{
|
|
6048
|
-
key: "
|
|
6049
|
-
label: "",
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
}
|
|
6057
|
-
|
|
6058
|
-
e.stopPropagation();
|
|
6059
|
-
onEdit?.(row);
|
|
6060
|
-
};
|
|
6061
|
-
const handleDelete = (e) => {
|
|
6062
|
-
e.stopPropagation();
|
|
6063
|
-
onDelete(row);
|
|
6064
|
-
};
|
|
6065
|
-
return /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2 justify-end", children: [
|
|
6066
|
-
onSend && /* @__PURE__ */ jsx36(
|
|
6067
|
-
Button_default,
|
|
6068
|
-
{
|
|
6069
|
-
variant: "outline",
|
|
6070
|
-
action: "primary",
|
|
6071
|
-
size: "small",
|
|
6072
|
-
iconLeft: /* @__PURE__ */ jsx36(PaperPlaneTilt, { size: 16 }),
|
|
6073
|
-
onClick: handleSend,
|
|
6074
|
-
"aria-label": config.sendButtonAriaLabel,
|
|
6075
|
-
children: config.sendButtonLabel
|
|
6076
|
-
}
|
|
6077
|
-
),
|
|
6078
|
-
/* @__PURE__ */ jsx36(
|
|
6079
|
-
IconButton_default,
|
|
6080
|
-
{
|
|
6081
|
-
icon: /* @__PURE__ */ jsx36(Trash, { size: 20 }),
|
|
6082
|
-
size: "md",
|
|
6083
|
-
onClick: handleDelete,
|
|
6084
|
-
"aria-label": config.deleteButtonAriaLabel,
|
|
6085
|
-
className: "text-text-600 hover:text-error-500 hover:bg-transparent"
|
|
6086
|
-
}
|
|
6087
|
-
),
|
|
6088
|
-
onEdit && /* @__PURE__ */ jsx36(
|
|
6089
|
-
IconButton_default,
|
|
6090
|
-
{
|
|
6091
|
-
icon: /* @__PURE__ */ jsx36(PencilSimple, { size: 20 }),
|
|
6092
|
-
size: "md",
|
|
6093
|
-
onClick: handleEdit,
|
|
6094
|
-
"aria-label": config.editButtonAriaLabel,
|
|
6095
|
-
className: "text-text-600 hover:text-primary-700 hover:bg-transparent"
|
|
6096
|
-
}
|
|
6097
|
-
)
|
|
6098
|
-
] });
|
|
6099
|
-
}
|
|
6192
|
+
key: "content",
|
|
6193
|
+
label: "CONTE\xDADO",
|
|
6194
|
+
categories: [
|
|
6195
|
+
{
|
|
6196
|
+
key: "subject",
|
|
6197
|
+
label: "Mat\xE9ria",
|
|
6198
|
+
selectedIds: [],
|
|
6199
|
+
itens: getSubjectOptions(userData)
|
|
6200
|
+
}
|
|
6201
|
+
]
|
|
6100
6202
|
}
|
|
6101
6203
|
];
|
|
6102
6204
|
|
|
6205
|
+
// src/components/RecommendedLessonsHistory/utils/filterBuilders.ts
|
|
6206
|
+
var buildGoalModelsFiltersFromParams = (params) => {
|
|
6207
|
+
const filters = {
|
|
6208
|
+
page: params.page,
|
|
6209
|
+
limit: params.limit
|
|
6210
|
+
};
|
|
6211
|
+
if (params.search) {
|
|
6212
|
+
filters.search = params.search;
|
|
6213
|
+
}
|
|
6214
|
+
if (Array.isArray(params.subject) && params.subject.length > 0) {
|
|
6215
|
+
filters.subjectId = params.subject[0];
|
|
6216
|
+
}
|
|
6217
|
+
return filters;
|
|
6218
|
+
};
|
|
6219
|
+
|
|
6220
|
+
// src/components/RecommendedLessonsHistory/tabs/DraftsTab.tsx
|
|
6221
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
6222
|
+
var GOAL_DRAFTS_CONFIG = {
|
|
6223
|
+
entityName: "rascunho",
|
|
6224
|
+
entityNamePlural: "rascunhos",
|
|
6225
|
+
testId: "goal-drafts-tab",
|
|
6226
|
+
emptyStateTitle: "Voc\xEA n\xE3o tem aulas recomendadas em rascunho",
|
|
6227
|
+
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!",
|
|
6228
|
+
searchPlaceholder: "Buscar rascunho"
|
|
6229
|
+
};
|
|
6230
|
+
var GOAL_DRAFTS_COLUMNS_CONFIG = {
|
|
6231
|
+
sendButtonLabel: "Enviar aula",
|
|
6232
|
+
sendButtonAriaLabel: "Enviar rascunho",
|
|
6233
|
+
deleteButtonAriaLabel: "Deletar rascunho",
|
|
6234
|
+
editButtonAriaLabel: "Editar rascunho"
|
|
6235
|
+
};
|
|
6236
|
+
var GoalDraftsTab = ({
|
|
6237
|
+
fetchGoalDrafts,
|
|
6238
|
+
deleteGoalDraft,
|
|
6239
|
+
onCreateDraft,
|
|
6240
|
+
onSendDraft,
|
|
6241
|
+
onEditDraft,
|
|
6242
|
+
emptyStateImage,
|
|
6243
|
+
noSearchImage,
|
|
6244
|
+
mapSubjectNameToEnum,
|
|
6245
|
+
userFilterData,
|
|
6246
|
+
subjectsMap
|
|
6247
|
+
}) => /* @__PURE__ */ jsx37(
|
|
6248
|
+
ModelsTabBase,
|
|
6249
|
+
{
|
|
6250
|
+
fetchModels: fetchGoalDrafts,
|
|
6251
|
+
deleteModel: deleteGoalDraft,
|
|
6252
|
+
onCreateModel: onCreateDraft,
|
|
6253
|
+
onSend: onSendDraft,
|
|
6254
|
+
onEditModel: onEditDraft,
|
|
6255
|
+
emptyStateImage,
|
|
6256
|
+
noSearchImage,
|
|
6257
|
+
mapSubjectNameToEnum,
|
|
6258
|
+
userFilterData,
|
|
6259
|
+
subjectsMap,
|
|
6260
|
+
config: GOAL_DRAFTS_CONFIG,
|
|
6261
|
+
createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
|
|
6262
|
+
mapSubject,
|
|
6263
|
+
send,
|
|
6264
|
+
edit,
|
|
6265
|
+
del,
|
|
6266
|
+
GOAL_DRAFTS_COLUMNS_CONFIG
|
|
6267
|
+
),
|
|
6268
|
+
createFiltersConfig: createGoalDraftsFiltersConfig,
|
|
6269
|
+
buildFiltersFromParams: buildGoalModelsFiltersFromParams,
|
|
6270
|
+
createUseModels: createUseGoalDrafts
|
|
6271
|
+
}
|
|
6272
|
+
);
|
|
6273
|
+
|
|
6103
6274
|
// src/components/CheckBoxGroup/CheckBoxGroup.helpers.ts
|
|
6104
6275
|
var areSelectedIdsEqual = (ids1, ids2) => {
|
|
6105
6276
|
if (ids1 === ids2) return true;
|
|
@@ -6182,7 +6353,7 @@ var calculateFormattedItemsForAutoSelection = (category, allCategories) => {
|
|
|
6182
6353
|
};
|
|
6183
6354
|
|
|
6184
6355
|
// src/components/CheckBoxGroup/CheckBoxGroup.tsx
|
|
6185
|
-
import { jsx as
|
|
6356
|
+
import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6186
6357
|
var CheckboxGroup = ({
|
|
6187
6358
|
categories,
|
|
6188
6359
|
onCategoriesChange,
|
|
@@ -6190,7 +6361,7 @@ var CheckboxGroup = ({
|
|
|
6190
6361
|
showDivider = true,
|
|
6191
6362
|
showSingleItem = false
|
|
6192
6363
|
}) => {
|
|
6193
|
-
const [openAccordion, setOpenAccordion] =
|
|
6364
|
+
const [openAccordion, setOpenAccordion] = useState15("");
|
|
6194
6365
|
const onCategoriesChangeRef = useRef7(onCategoriesChange);
|
|
6195
6366
|
const previousCategoriesRef = useRef7(categories);
|
|
6196
6367
|
const appliedAutoSelectionRef = useRef7("");
|
|
@@ -6490,7 +6661,7 @@ var CheckboxGroup = ({
|
|
|
6490
6661
|
const renderCheckboxItem = (item, categoryKey) => {
|
|
6491
6662
|
const uniqueId = `${categoryKey}-${item.id}`;
|
|
6492
6663
|
return /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-3 px-2", children: [
|
|
6493
|
-
/* @__PURE__ */
|
|
6664
|
+
/* @__PURE__ */ jsx38(
|
|
6494
6665
|
CheckBox_default,
|
|
6495
6666
|
{
|
|
6496
6667
|
id: uniqueId,
|
|
@@ -6498,7 +6669,7 @@ var CheckboxGroup = ({
|
|
|
6498
6669
|
onChange: () => toggleItem(categoryKey, item.id)
|
|
6499
6670
|
}
|
|
6500
6671
|
),
|
|
6501
|
-
/* @__PURE__ */
|
|
6672
|
+
/* @__PURE__ */ jsx38(
|
|
6502
6673
|
"label",
|
|
6503
6674
|
{
|
|
6504
6675
|
htmlFor: uniqueId,
|
|
@@ -6513,7 +6684,7 @@ var CheckboxGroup = ({
|
|
|
6513
6684
|
{
|
|
6514
6685
|
className: "flex flex-col gap-3",
|
|
6515
6686
|
children: [
|
|
6516
|
-
"groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */
|
|
6687
|
+
"groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ jsx38(Text_default, { size: "sm", className: "mt-2", weight: "semibold", children: formattedGroup.groupLabel }),
|
|
6517
6688
|
formattedGroup.itens?.map(
|
|
6518
6689
|
(item) => renderCheckboxItem(item, categoryKey)
|
|
6519
6690
|
)
|
|
@@ -6523,7 +6694,7 @@ var CheckboxGroup = ({
|
|
|
6523
6694
|
);
|
|
6524
6695
|
const renderAccordionTrigger = (category, isEnabled) => /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between w-full p-2", children: [
|
|
6525
6696
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-3", children: [
|
|
6526
|
-
/* @__PURE__ */
|
|
6697
|
+
/* @__PURE__ */ jsx38(
|
|
6527
6698
|
CheckBox_default,
|
|
6528
6699
|
{
|
|
6529
6700
|
checked: isMinimalOneCheckBoxIsSelected(category.key),
|
|
@@ -6532,7 +6703,7 @@ var CheckboxGroup = ({
|
|
|
6532
6703
|
onChange: () => toggleAllInCategory(category.key)
|
|
6533
6704
|
}
|
|
6534
6705
|
),
|
|
6535
|
-
/* @__PURE__ */
|
|
6706
|
+
/* @__PURE__ */ jsx38(
|
|
6536
6707
|
Text_default,
|
|
6537
6708
|
{
|
|
6538
6709
|
size: "sm",
|
|
@@ -6542,7 +6713,7 @@ var CheckboxGroup = ({
|
|
|
6542
6713
|
}
|
|
6543
6714
|
)
|
|
6544
6715
|
] }),
|
|
6545
|
-
(openAccordion === category.key || isEnabled) && /* @__PURE__ */
|
|
6716
|
+
(openAccordion === category.key || isEnabled) && /* @__PURE__ */ jsx38(Badge_default, { variant: "solid", action: "info", children: getBadgeText2(category) })
|
|
6546
6717
|
] });
|
|
6547
6718
|
const renderCompactSingleItem = (category) => {
|
|
6548
6719
|
const formattedItems = getFormattedItems(category.key);
|
|
@@ -6556,8 +6727,8 @@ var CheckboxGroup = ({
|
|
|
6556
6727
|
{
|
|
6557
6728
|
className: "flex items-center justify-between w-full px-3 py-2",
|
|
6558
6729
|
children: [
|
|
6559
|
-
/* @__PURE__ */
|
|
6560
|
-
/* @__PURE__ */
|
|
6730
|
+
/* @__PURE__ */ jsx38(Text_default, { size: "sm", weight: "bold", className: "text-text-800", children: category.label }),
|
|
6731
|
+
/* @__PURE__ */ jsx38(Text_default, { size: "sm", className: "text-text-950", children: singleItem.name })
|
|
6561
6732
|
]
|
|
6562
6733
|
},
|
|
6563
6734
|
category.key
|
|
@@ -6575,14 +6746,14 @@ var CheckboxGroup = ({
|
|
|
6575
6746
|
if (compactSingleItem && hasOnlyOneAvailableItem && isEnabled) {
|
|
6576
6747
|
return /* @__PURE__ */ jsxs25("div", { children: [
|
|
6577
6748
|
renderCompactSingleItem(category),
|
|
6578
|
-
showDivider && /* @__PURE__ */
|
|
6749
|
+
showDivider && /* @__PURE__ */ jsx38(Divider_default, {})
|
|
6579
6750
|
] }, category.key);
|
|
6580
6751
|
}
|
|
6581
6752
|
const hasNoItems = formattedItems.every(
|
|
6582
6753
|
(group) => !group.itens || group.itens.length === 0
|
|
6583
6754
|
);
|
|
6584
6755
|
return /* @__PURE__ */ jsxs25("div", { children: [
|
|
6585
|
-
/* @__PURE__ */
|
|
6756
|
+
/* @__PURE__ */ jsx38(
|
|
6586
6757
|
CardAccordation,
|
|
6587
6758
|
{
|
|
6588
6759
|
value: category.key,
|
|
@@ -6592,12 +6763,12 @@ var CheckboxGroup = ({
|
|
|
6592
6763
|
openAccordion === category.key && "bg-background-50 border-none"
|
|
6593
6764
|
),
|
|
6594
6765
|
trigger: renderAccordionTrigger(category, isEnabled),
|
|
6595
|
-
children: /* @__PURE__ */
|
|
6766
|
+
children: /* @__PURE__ */ jsx38("div", { className: "flex flex-col gap-3 pt-2", children: hasNoItems && isEnabled ? /* @__PURE__ */ jsx38("div", { className: "px-2 py-4", children: /* @__PURE__ */ jsx38(Text_default, { size: "sm", className: "text-text-500 text-center", children: "Sem dados" }) }) : formattedItems.map(
|
|
6596
6767
|
(formattedGroup, idx) => renderFormattedGroup(formattedGroup, idx, category.key)
|
|
6597
6768
|
) })
|
|
6598
6769
|
}
|
|
6599
6770
|
),
|
|
6600
|
-
openAccordion !== category.key && showDivider && /* @__PURE__ */
|
|
6771
|
+
openAccordion !== category.key && showDivider && /* @__PURE__ */ jsx38(Divider_default, {})
|
|
6601
6772
|
] }, category.key);
|
|
6602
6773
|
};
|
|
6603
6774
|
useEffect14(() => {
|
|
@@ -6611,7 +6782,7 @@ var CheckboxGroup = ({
|
|
|
6611
6782
|
}, 0);
|
|
6612
6783
|
}
|
|
6613
6784
|
}, [categories, openAccordion]);
|
|
6614
|
-
return /* @__PURE__ */
|
|
6785
|
+
return /* @__PURE__ */ jsx38(
|
|
6615
6786
|
AccordionGroup,
|
|
6616
6787
|
{
|
|
6617
6788
|
type: "single",
|
|
@@ -6624,7 +6795,7 @@ var CheckboxGroup = ({
|
|
|
6624
6795
|
};
|
|
6625
6796
|
|
|
6626
6797
|
// src/components/Filter/FilterModal.tsx
|
|
6627
|
-
import { jsx as
|
|
6798
|
+
import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6628
6799
|
var FilterModal = ({
|
|
6629
6800
|
isOpen,
|
|
6630
6801
|
onClose,
|
|
@@ -6652,7 +6823,7 @@ var FilterModal = ({
|
|
|
6652
6823
|
const handleClear = () => {
|
|
6653
6824
|
onClear();
|
|
6654
6825
|
};
|
|
6655
|
-
return /* @__PURE__ */
|
|
6826
|
+
return /* @__PURE__ */ jsx39(
|
|
6656
6827
|
Modal_default,
|
|
6657
6828
|
{
|
|
6658
6829
|
isOpen,
|
|
@@ -6660,10 +6831,10 @@ var FilterModal = ({
|
|
|
6660
6831
|
title,
|
|
6661
6832
|
size,
|
|
6662
6833
|
footer: /* @__PURE__ */ jsxs26("div", { className: "flex gap-3 justify-end w-full", children: [
|
|
6663
|
-
/* @__PURE__ */
|
|
6664
|
-
/* @__PURE__ */
|
|
6834
|
+
/* @__PURE__ */ jsx39(Button_default, { variant: "outline", onClick: handleClear, children: clearLabel }),
|
|
6835
|
+
/* @__PURE__ */ jsx39(Button_default, { onClick: handleApply, children: applyLabel })
|
|
6665
6836
|
] }),
|
|
6666
|
-
children: /* @__PURE__ */
|
|
6837
|
+
children: /* @__PURE__ */ jsx39("div", { className: "flex flex-col gap-6", children: filterConfigs.map((config, index) => /* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-4", children: [
|
|
6667
6838
|
/* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2 text-text-400 text-sm font-medium uppercase", children: [
|
|
6668
6839
|
config.key === "academic" && /* @__PURE__ */ jsxs26(
|
|
6669
6840
|
"svg",
|
|
@@ -6675,7 +6846,7 @@ var FilterModal = ({
|
|
|
6675
6846
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6676
6847
|
className: "text-text-400",
|
|
6677
6848
|
children: [
|
|
6678
|
-
/* @__PURE__ */
|
|
6849
|
+
/* @__PURE__ */ jsx39(
|
|
6679
6850
|
"path",
|
|
6680
6851
|
{
|
|
6681
6852
|
d: "M8 2L2 5.33333L8 8.66667L14 5.33333L8 2Z",
|
|
@@ -6685,7 +6856,7 @@ var FilterModal = ({
|
|
|
6685
6856
|
strokeLinejoin: "round"
|
|
6686
6857
|
}
|
|
6687
6858
|
),
|
|
6688
|
-
/* @__PURE__ */
|
|
6859
|
+
/* @__PURE__ */ jsx39(
|
|
6689
6860
|
"path",
|
|
6690
6861
|
{
|
|
6691
6862
|
d: "M2 10.6667L8 14L14 10.6667",
|
|
@@ -6695,7 +6866,7 @@ var FilterModal = ({
|
|
|
6695
6866
|
strokeLinejoin: "round"
|
|
6696
6867
|
}
|
|
6697
6868
|
),
|
|
6698
|
-
/* @__PURE__ */
|
|
6869
|
+
/* @__PURE__ */ jsx39(
|
|
6699
6870
|
"path",
|
|
6700
6871
|
{
|
|
6701
6872
|
d: "M2 8L8 11.3333L14 8",
|
|
@@ -6718,7 +6889,7 @@ var FilterModal = ({
|
|
|
6718
6889
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6719
6890
|
className: "text-text-400",
|
|
6720
6891
|
children: [
|
|
6721
|
-
/* @__PURE__ */
|
|
6892
|
+
/* @__PURE__ */ jsx39(
|
|
6722
6893
|
"path",
|
|
6723
6894
|
{
|
|
6724
6895
|
d: "M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z",
|
|
@@ -6728,7 +6899,7 @@ var FilterModal = ({
|
|
|
6728
6899
|
strokeLinejoin: "round"
|
|
6729
6900
|
}
|
|
6730
6901
|
),
|
|
6731
|
-
/* @__PURE__ */
|
|
6902
|
+
/* @__PURE__ */ jsx39(
|
|
6732
6903
|
"path",
|
|
6733
6904
|
{
|
|
6734
6905
|
d: "M2 6H14",
|
|
@@ -6738,7 +6909,7 @@ var FilterModal = ({
|
|
|
6738
6909
|
strokeLinejoin: "round"
|
|
6739
6910
|
}
|
|
6740
6911
|
),
|
|
6741
|
-
/* @__PURE__ */
|
|
6912
|
+
/* @__PURE__ */ jsx39(
|
|
6742
6913
|
"path",
|
|
6743
6914
|
{
|
|
6744
6915
|
d: "M6 2V14",
|
|
@@ -6751,9 +6922,9 @@ var FilterModal = ({
|
|
|
6751
6922
|
]
|
|
6752
6923
|
}
|
|
6753
6924
|
),
|
|
6754
|
-
/* @__PURE__ */
|
|
6925
|
+
/* @__PURE__ */ jsx39("span", { children: config.label })
|
|
6755
6926
|
] }),
|
|
6756
|
-
/* @__PURE__ */
|
|
6927
|
+
/* @__PURE__ */ jsx39(
|
|
6757
6928
|
CheckboxGroup,
|
|
6758
6929
|
{
|
|
6759
6930
|
categories: config.categories,
|
|
@@ -6767,7 +6938,7 @@ var FilterModal = ({
|
|
|
6767
6938
|
|
|
6768
6939
|
// src/components/TableProvider/TableProvider.tsx
|
|
6769
6940
|
import { Funnel } from "phosphor-react";
|
|
6770
|
-
import { Fragment as Fragment8, jsx as
|
|
6941
|
+
import { Fragment as Fragment8, jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6771
6942
|
function TableProvider({
|
|
6772
6943
|
data,
|
|
6773
6944
|
headers,
|
|
@@ -6791,7 +6962,7 @@ function TableProvider({
|
|
|
6791
6962
|
containerClassName,
|
|
6792
6963
|
children
|
|
6793
6964
|
}) {
|
|
6794
|
-
const [searchQuery, setSearchQuery] =
|
|
6965
|
+
const [searchQuery, setSearchQuery] = useState16("");
|
|
6795
6966
|
const sortResultRaw = useTableSort(data, { syncWithUrl: true });
|
|
6796
6967
|
const sortResult = enableTableSort ? sortResultRaw : {
|
|
6797
6968
|
sortedData: data,
|
|
@@ -6832,9 +7003,9 @@ function TableProvider({
|
|
|
6832
7003
|
totalItems,
|
|
6833
7004
|
totalPages
|
|
6834
7005
|
} = paginationConfig;
|
|
6835
|
-
const [currentPage, setCurrentPage] =
|
|
6836
|
-
const [itemsPerPage, setItemsPerPage] =
|
|
6837
|
-
const [isFilterModalOpen, setIsFilterModalOpen] =
|
|
7006
|
+
const [currentPage, setCurrentPage] = useState16(1);
|
|
7007
|
+
const [itemsPerPage, setItemsPerPage] = useState16(defaultItemsPerPage);
|
|
7008
|
+
const [isFilterModalOpen, setIsFilterModalOpen] = useState16(false);
|
|
6838
7009
|
const combinedParams = useMemo6(() => {
|
|
6839
7010
|
const params = {
|
|
6840
7011
|
page: currentPage,
|
|
@@ -6865,23 +7036,23 @@ function TableProvider({
|
|
|
6865
7036
|
useEffect15(() => {
|
|
6866
7037
|
onParamsChange?.(combinedParams);
|
|
6867
7038
|
}, [combinedParams]);
|
|
6868
|
-
const handleSearchChange =
|
|
7039
|
+
const handleSearchChange = useCallback6((value) => {
|
|
6869
7040
|
setSearchQuery(value);
|
|
6870
7041
|
setCurrentPage(1);
|
|
6871
7042
|
}, []);
|
|
6872
|
-
const handleFilterApply =
|
|
7043
|
+
const handleFilterApply = useCallback6(() => {
|
|
6873
7044
|
applyFilters();
|
|
6874
7045
|
setIsFilterModalOpen(false);
|
|
6875
7046
|
setCurrentPage(1);
|
|
6876
7047
|
}, [applyFilters]);
|
|
6877
|
-
const handlePageChange =
|
|
7048
|
+
const handlePageChange = useCallback6((page) => {
|
|
6878
7049
|
setCurrentPage(page);
|
|
6879
7050
|
}, []);
|
|
6880
|
-
const handleItemsPerPageChange =
|
|
7051
|
+
const handleItemsPerPageChange = useCallback6((items) => {
|
|
6881
7052
|
setItemsPerPage(items);
|
|
6882
7053
|
setCurrentPage(1);
|
|
6883
7054
|
}, []);
|
|
6884
|
-
const handleRowClickInternal =
|
|
7055
|
+
const handleRowClickInternal = useCallback6(
|
|
6885
7056
|
(row, index) => {
|
|
6886
7057
|
if (enableRowClick && onRowClick) {
|
|
6887
7058
|
onRowClick(row, index);
|
|
@@ -6916,13 +7087,13 @@ function TableProvider({
|
|
|
6916
7087
|
size: "medium",
|
|
6917
7088
|
onClick: () => setIsFilterModalOpen(true),
|
|
6918
7089
|
children: [
|
|
6919
|
-
/* @__PURE__ */
|
|
7090
|
+
/* @__PURE__ */ jsx40(Funnel, { size: 20 }),
|
|
6920
7091
|
"Filtros",
|
|
6921
|
-
hasActiveFilters && /* @__PURE__ */
|
|
7092
|
+
hasActiveFilters && /* @__PURE__ */ jsx40("span", { className: "ml-2 rounded-full bg-primary-500 px-2 py-0.5 text-xs text-white", children: Object.keys(activeFilters).length })
|
|
6922
7093
|
]
|
|
6923
7094
|
}
|
|
6924
7095
|
),
|
|
6925
|
-
enableSearch && /* @__PURE__ */
|
|
7096
|
+
enableSearch && /* @__PURE__ */ jsx40("div", { className: "flex-1", children: /* @__PURE__ */ jsx40(
|
|
6926
7097
|
Search_default,
|
|
6927
7098
|
{
|
|
6928
7099
|
value: searchQuery,
|
|
@@ -6934,10 +7105,10 @@ function TableProvider({
|
|
|
6934
7105
|
) })
|
|
6935
7106
|
] });
|
|
6936
7107
|
const headerSection = (headerContent || controls) && /* @__PURE__ */ jsxs27("div", { className: "flex flex-col md:flex-row items-stretch md:items-center justify-between gap-4", children: [
|
|
6937
|
-
headerContent && /* @__PURE__ */
|
|
6938
|
-
controls && /* @__PURE__ */
|
|
7108
|
+
headerContent && /* @__PURE__ */ jsx40("div", { children: headerContent }),
|
|
7109
|
+
controls && /* @__PURE__ */ jsx40("div", { className: "flex-1 md:flex-none", children: controls })
|
|
6939
7110
|
] });
|
|
6940
|
-
const table = /* @__PURE__ */
|
|
7111
|
+
const table = /* @__PURE__ */ jsx40("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsxs27(
|
|
6941
7112
|
Table_default,
|
|
6942
7113
|
{
|
|
6943
7114
|
variant,
|
|
@@ -6948,11 +7119,11 @@ function TableProvider({
|
|
|
6948
7119
|
showEmpty,
|
|
6949
7120
|
emptyState,
|
|
6950
7121
|
children: [
|
|
6951
|
-
/* @__PURE__ */
|
|
7122
|
+
/* @__PURE__ */ jsx40("thead", { children: /* @__PURE__ */ jsx40(
|
|
6952
7123
|
TableRow,
|
|
6953
7124
|
{
|
|
6954
7125
|
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
6955
|
-
children: headers.map((header, index) => /* @__PURE__ */
|
|
7126
|
+
children: headers.map((header, index) => /* @__PURE__ */ jsx40(
|
|
6956
7127
|
TableHead,
|
|
6957
7128
|
{
|
|
6958
7129
|
sortable: enableTableSort && header.sortable,
|
|
@@ -6966,7 +7137,7 @@ function TableProvider({
|
|
|
6966
7137
|
))
|
|
6967
7138
|
}
|
|
6968
7139
|
) }),
|
|
6969
|
-
/* @__PURE__ */
|
|
7140
|
+
/* @__PURE__ */ jsx40(TableBody, { children: loading ? /* @__PURE__ */ jsx40(TableRow, { children: /* @__PURE__ */ jsx40(TableCell, { colSpan: headers.length, className: "text-center py-8", children: /* @__PURE__ */ jsx40("span", { className: "text-text-400 text-sm", children: "Carregando..." }) }) }) : displayData.map((row, rowIndex) => {
|
|
6970
7141
|
const effectiveIndex = useInternalPagination ? (currentPage - 1) * itemsPerPage + rowIndex : rowIndex;
|
|
6971
7142
|
const rowKeyValue = rowKey ? (() => {
|
|
6972
7143
|
const keyValue = row[rowKey];
|
|
@@ -6978,7 +7149,7 @@ function TableProvider({
|
|
|
6978
7149
|
}
|
|
6979
7150
|
return String(keyValue);
|
|
6980
7151
|
})() : `row-${effectiveIndex}`;
|
|
6981
|
-
return /* @__PURE__ */
|
|
7152
|
+
return /* @__PURE__ */ jsx40(
|
|
6982
7153
|
TableRow,
|
|
6983
7154
|
{
|
|
6984
7155
|
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
@@ -6999,7 +7170,7 @@ function TableProvider({
|
|
|
6999
7170
|
}
|
|
7000
7171
|
}
|
|
7001
7172
|
const content = header.render ? header.render(value, row, effectiveIndex) : defaultContent;
|
|
7002
|
-
return /* @__PURE__ */
|
|
7173
|
+
return /* @__PURE__ */ jsx40(
|
|
7003
7174
|
TableCell,
|
|
7004
7175
|
{
|
|
7005
7176
|
className: header.className,
|
|
@@ -7018,7 +7189,7 @@ function TableProvider({
|
|
|
7018
7189
|
]
|
|
7019
7190
|
}
|
|
7020
7191
|
) });
|
|
7021
|
-
const pagination = enablePagination && !isEmpty && /* @__PURE__ */
|
|
7192
|
+
const pagination = enablePagination && !isEmpty && /* @__PURE__ */ jsx40("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx40(
|
|
7022
7193
|
TablePagination_default,
|
|
7023
7194
|
{
|
|
7024
7195
|
currentPage,
|
|
@@ -7038,7 +7209,7 @@ function TableProvider({
|
|
|
7038
7209
|
table,
|
|
7039
7210
|
pagination
|
|
7040
7211
|
}),
|
|
7041
|
-
enableFilters && /* @__PURE__ */
|
|
7212
|
+
enableFilters && /* @__PURE__ */ jsx40(
|
|
7042
7213
|
FilterModal,
|
|
7043
7214
|
{
|
|
7044
7215
|
isOpen: isFilterModalOpen,
|
|
@@ -7056,7 +7227,7 @@ function TableProvider({
|
|
|
7056
7227
|
headerSection,
|
|
7057
7228
|
table,
|
|
7058
7229
|
pagination,
|
|
7059
|
-
enableFilters && /* @__PURE__ */
|
|
7230
|
+
enableFilters && /* @__PURE__ */ jsx40(
|
|
7060
7231
|
FilterModal,
|
|
7061
7232
|
{
|
|
7062
7233
|
isOpen: isFilterModalOpen,
|
|
@@ -7071,7 +7242,7 @@ function TableProvider({
|
|
|
7071
7242
|
}
|
|
7072
7243
|
|
|
7073
7244
|
// src/components/RecommendedLessonsHistory/config/modelsFiltersConfig.ts
|
|
7074
|
-
var
|
|
7245
|
+
var getSubjectOptions2 = (data) => {
|
|
7075
7246
|
if (!data?.subjects) return [];
|
|
7076
7247
|
return data.subjects.map((subject) => ({
|
|
7077
7248
|
id: subject.id,
|
|
@@ -7087,29 +7258,14 @@ var createGoalModelsFiltersConfig = (userData) => [
|
|
|
7087
7258
|
key: "subject",
|
|
7088
7259
|
label: "Mat\xE9ria",
|
|
7089
7260
|
selectedIds: [],
|
|
7090
|
-
itens:
|
|
7261
|
+
itens: getSubjectOptions2(userData)
|
|
7091
7262
|
}
|
|
7092
7263
|
]
|
|
7093
7264
|
}
|
|
7094
7265
|
];
|
|
7095
7266
|
|
|
7096
|
-
// src/components/RecommendedLessonsHistory/utils/filterBuilders.ts
|
|
7097
|
-
var buildGoalModelsFiltersFromParams = (params) => {
|
|
7098
|
-
const filters = {
|
|
7099
|
-
page: params.page,
|
|
7100
|
-
limit: params.limit
|
|
7101
|
-
};
|
|
7102
|
-
if (params.search) {
|
|
7103
|
-
filters.search = params.search;
|
|
7104
|
-
}
|
|
7105
|
-
if (Array.isArray(params.subject) && params.subject.length > 0) {
|
|
7106
|
-
filters.subjectId = params.subject[0];
|
|
7107
|
-
}
|
|
7108
|
-
return filters;
|
|
7109
|
-
};
|
|
7110
|
-
|
|
7111
7267
|
// src/components/RecommendedLessonsHistory/tabs/ModelsTab.tsx
|
|
7112
|
-
import { jsx as
|
|
7268
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
7113
7269
|
var GOAL_MODELS_CONFIG = {
|
|
7114
7270
|
entityName: "aula",
|
|
7115
7271
|
entityNamePlural: "aulas",
|
|
@@ -7135,7 +7291,7 @@ var GoalModelsTab = ({
|
|
|
7135
7291
|
mapSubjectNameToEnum,
|
|
7136
7292
|
userFilterData,
|
|
7137
7293
|
subjectsMap
|
|
7138
|
-
}) => /* @__PURE__ */
|
|
7294
|
+
}) => /* @__PURE__ */ jsx41(
|
|
7139
7295
|
ModelsTabBase,
|
|
7140
7296
|
{
|
|
7141
7297
|
fetchModels: fetchGoalModels,
|
|
@@ -7163,7 +7319,7 @@ var GoalModelsTab = ({
|
|
|
7163
7319
|
);
|
|
7164
7320
|
|
|
7165
7321
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
7166
|
-
import { Fragment as Fragment9, jsx as
|
|
7322
|
+
import { Fragment as Fragment9, jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7167
7323
|
var GoalPageTab = /* @__PURE__ */ ((GoalPageTab2) => {
|
|
7168
7324
|
GoalPageTab2["HISTORY"] = "history";
|
|
7169
7325
|
GoalPageTab2["DRAFTS"] = "drafts";
|
|
@@ -7209,7 +7365,7 @@ var getSchoolOptions = (data) => {
|
|
|
7209
7365
|
name: school.name
|
|
7210
7366
|
}));
|
|
7211
7367
|
};
|
|
7212
|
-
var
|
|
7368
|
+
var getSubjectOptions3 = (data) => {
|
|
7213
7369
|
if (!data?.subjects) return [];
|
|
7214
7370
|
return data.subjects.map((subject) => ({
|
|
7215
7371
|
id: subject.id,
|
|
@@ -7275,7 +7431,7 @@ var createGoalFiltersConfig = (userData) => [
|
|
|
7275
7431
|
key: "subject",
|
|
7276
7432
|
label: "Mat\xE9ria",
|
|
7277
7433
|
selectedIds: [],
|
|
7278
|
-
itens:
|
|
7434
|
+
itens: getSubjectOptions3(userData)
|
|
7279
7435
|
},
|
|
7280
7436
|
{
|
|
7281
7437
|
key: "theme",
|
|
@@ -7328,7 +7484,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7328
7484
|
className: "max-w-[200px] truncate",
|
|
7329
7485
|
render: (value) => {
|
|
7330
7486
|
const title = typeof value === "string" ? value : "";
|
|
7331
|
-
return /* @__PURE__ */
|
|
7487
|
+
return /* @__PURE__ */ jsx42(Text_default, { size: "sm", title, children: title });
|
|
7332
7488
|
}
|
|
7333
7489
|
},
|
|
7334
7490
|
{
|
|
@@ -7338,7 +7494,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7338
7494
|
className: "max-w-[150px] truncate",
|
|
7339
7495
|
render: (value) => {
|
|
7340
7496
|
const school = typeof value === "string" ? value : "";
|
|
7341
|
-
return /* @__PURE__ */
|
|
7497
|
+
return /* @__PURE__ */ jsx42(Text_default, { size: "sm", title: school, children: school });
|
|
7342
7498
|
}
|
|
7343
7499
|
},
|
|
7344
7500
|
{
|
|
@@ -7355,11 +7511,11 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7355
7511
|
const subjectName = typeof value === "string" ? value : "";
|
|
7356
7512
|
const subjectEnum = mapSubjectNameToEnum?.(subjectName);
|
|
7357
7513
|
if (!subjectEnum) {
|
|
7358
|
-
return /* @__PURE__ */
|
|
7514
|
+
return /* @__PURE__ */ jsx42(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
7359
7515
|
}
|
|
7360
7516
|
const subjectInfo = getSubjectInfo(subjectEnum);
|
|
7361
7517
|
return /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", title: subjectName, children: [
|
|
7362
|
-
/* @__PURE__ */
|
|
7518
|
+
/* @__PURE__ */ jsx42(
|
|
7363
7519
|
"span",
|
|
7364
7520
|
{
|
|
7365
7521
|
className: cn(
|
|
@@ -7369,7 +7525,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7369
7525
|
children: subjectInfo.icon
|
|
7370
7526
|
}
|
|
7371
7527
|
),
|
|
7372
|
-
/* @__PURE__ */
|
|
7528
|
+
/* @__PURE__ */ jsx42(Text_default, { size: "sm", className: "truncate", children: subjectName })
|
|
7373
7529
|
] });
|
|
7374
7530
|
}
|
|
7375
7531
|
},
|
|
@@ -7385,9 +7541,9 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7385
7541
|
render: (value) => {
|
|
7386
7542
|
const status = typeof value === "string" ? value : "";
|
|
7387
7543
|
if (!status) {
|
|
7388
|
-
return /* @__PURE__ */
|
|
7544
|
+
return /* @__PURE__ */ jsx42(Text_default, { size: "sm", color: "text-text-500", children: "-" });
|
|
7389
7545
|
}
|
|
7390
|
-
return /* @__PURE__ */
|
|
7546
|
+
return /* @__PURE__ */ jsx42(
|
|
7391
7547
|
Badge_default,
|
|
7392
7548
|
{
|
|
7393
7549
|
variant: "solid",
|
|
@@ -7402,7 +7558,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7402
7558
|
key: "completionPercentage",
|
|
7403
7559
|
label: "Conclus\xE3o",
|
|
7404
7560
|
sortable: true,
|
|
7405
|
-
render: (value) => /* @__PURE__ */
|
|
7561
|
+
render: (value) => /* @__PURE__ */ jsx42(
|
|
7406
7562
|
ProgressBar_default,
|
|
7407
7563
|
{
|
|
7408
7564
|
value: Number(value),
|
|
@@ -7429,19 +7585,19 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7429
7585
|
onEditGoal?.(row.id);
|
|
7430
7586
|
};
|
|
7431
7587
|
return /* @__PURE__ */ jsxs28("div", { className: "flex justify-center gap-2", children: [
|
|
7432
|
-
/* @__PURE__ */
|
|
7588
|
+
/* @__PURE__ */ jsx42(
|
|
7433
7589
|
IconButton_default,
|
|
7434
7590
|
{
|
|
7435
|
-
icon: /* @__PURE__ */
|
|
7591
|
+
icon: /* @__PURE__ */ jsx42(Trash2, { size: 20 }),
|
|
7436
7592
|
size: "sm",
|
|
7437
7593
|
title: "Excluir",
|
|
7438
7594
|
onClick: handleDelete
|
|
7439
7595
|
}
|
|
7440
7596
|
),
|
|
7441
|
-
/* @__PURE__ */
|
|
7597
|
+
/* @__PURE__ */ jsx42(
|
|
7442
7598
|
IconButton_default,
|
|
7443
7599
|
{
|
|
7444
|
-
icon: /* @__PURE__ */
|
|
7600
|
+
icon: /* @__PURE__ */ jsx42(PencilSimple2, { size: 20 }),
|
|
7445
7601
|
size: "sm",
|
|
7446
7602
|
title: "Editar",
|
|
7447
7603
|
onClick: handleEdit
|
|
@@ -7455,7 +7611,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7455
7611
|
label: "",
|
|
7456
7612
|
sortable: false,
|
|
7457
7613
|
className: "w-12",
|
|
7458
|
-
render: () => /* @__PURE__ */
|
|
7614
|
+
render: () => /* @__PURE__ */ jsx42("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx42(CaretRight6, { size: 20, className: "text-text-600" }) })
|
|
7459
7615
|
}
|
|
7460
7616
|
];
|
|
7461
7617
|
var RecommendedLessonsHistory = ({
|
|
@@ -7477,10 +7633,14 @@ var RecommendedLessonsHistory = ({
|
|
|
7477
7633
|
onSendLesson,
|
|
7478
7634
|
onEditModel,
|
|
7479
7635
|
subjectsMap,
|
|
7636
|
+
fetchGoalDrafts,
|
|
7637
|
+
deleteGoalDraft,
|
|
7638
|
+
onSendDraft,
|
|
7639
|
+
onEditDraft,
|
|
7480
7640
|
defaultTab,
|
|
7481
7641
|
onTabChange
|
|
7482
7642
|
}) => {
|
|
7483
|
-
const [activeTab, setActiveTab] =
|
|
7643
|
+
const [activeTab, setActiveTab] = useState17(
|
|
7484
7644
|
defaultTab ?? "history" /* HISTORY */
|
|
7485
7645
|
);
|
|
7486
7646
|
useEffect16(() => {
|
|
@@ -7488,7 +7648,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7488
7648
|
setActiveTab(defaultTab);
|
|
7489
7649
|
}
|
|
7490
7650
|
}, [defaultTab]);
|
|
7491
|
-
const handleTabChange =
|
|
7651
|
+
const handleTabChange = useCallback7(
|
|
7492
7652
|
(value) => {
|
|
7493
7653
|
const newTab = value;
|
|
7494
7654
|
setActiveTab(newTab);
|
|
@@ -7519,7 +7679,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7519
7679
|
() => createTableColumns(mapSubjectNameToEnum, onDeleteGoal, onEditGoal),
|
|
7520
7680
|
[mapSubjectNameToEnum, onDeleteGoal, onEditGoal]
|
|
7521
7681
|
);
|
|
7522
|
-
const handleParamsChange =
|
|
7682
|
+
const handleParamsChange = useCallback7(
|
|
7523
7683
|
(params) => {
|
|
7524
7684
|
const filters = buildFiltersFromParams(params);
|
|
7525
7685
|
fetchGoals(filters);
|
|
@@ -7532,10 +7692,10 @@ var RecommendedLessonsHistory = ({
|
|
|
7532
7692
|
"data-testid": "recommended-lessons-history",
|
|
7533
7693
|
className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
|
|
7534
7694
|
children: [
|
|
7535
|
-
/* @__PURE__ */
|
|
7695
|
+
/* @__PURE__ */ jsx42("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
|
|
7536
7696
|
/* @__PURE__ */ jsxs28("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: [
|
|
7537
7697
|
/* @__PURE__ */ jsxs28("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: [
|
|
7538
|
-
/* @__PURE__ */
|
|
7698
|
+
/* @__PURE__ */ jsx42(
|
|
7539
7699
|
Text_default,
|
|
7540
7700
|
{
|
|
7541
7701
|
as: "h1",
|
|
@@ -7544,7 +7704,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7544
7704
|
children: title
|
|
7545
7705
|
}
|
|
7546
7706
|
),
|
|
7547
|
-
/* @__PURE__ */
|
|
7707
|
+
/* @__PURE__ */ jsx42("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ jsx42(
|
|
7548
7708
|
Menu,
|
|
7549
7709
|
{
|
|
7550
7710
|
defaultValue: "history" /* HISTORY */,
|
|
@@ -7558,7 +7718,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7558
7718
|
variant: "menu2",
|
|
7559
7719
|
className: "w-full lg:w-auto max-w-full min-w-0",
|
|
7560
7720
|
children: [
|
|
7561
|
-
/* @__PURE__ */
|
|
7721
|
+
/* @__PURE__ */ jsx42(
|
|
7562
7722
|
MenuItem,
|
|
7563
7723
|
{
|
|
7564
7724
|
variant: "menu2",
|
|
@@ -7568,7 +7728,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7568
7728
|
children: "Hist\xF3rico"
|
|
7569
7729
|
}
|
|
7570
7730
|
),
|
|
7571
|
-
/* @__PURE__ */
|
|
7731
|
+
/* @__PURE__ */ jsx42(
|
|
7572
7732
|
MenuItem,
|
|
7573
7733
|
{
|
|
7574
7734
|
variant: "menu2",
|
|
@@ -7578,7 +7738,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7578
7738
|
children: "Rascunhos"
|
|
7579
7739
|
}
|
|
7580
7740
|
),
|
|
7581
|
-
/* @__PURE__ */
|
|
7741
|
+
/* @__PURE__ */ jsx42(
|
|
7582
7742
|
MenuItem,
|
|
7583
7743
|
{
|
|
7584
7744
|
variant: "menu2",
|
|
@@ -7595,7 +7755,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7595
7755
|
) })
|
|
7596
7756
|
] }),
|
|
7597
7757
|
/* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
|
|
7598
|
-
activeTab === "history" /* HISTORY */ && /* @__PURE__ */
|
|
7758
|
+
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ jsx42(Fragment9, { children: error ? /* @__PURE__ */ jsx42("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx42(Text_default, { size: "lg", color: "text-error-500", children: error }) }) : /* @__PURE__ */ jsx42("div", { className: "w-full", children: /* @__PURE__ */ jsx42(
|
|
7599
7759
|
TableProvider,
|
|
7600
7760
|
{
|
|
7601
7761
|
data: goals,
|
|
@@ -7620,14 +7780,14 @@ var RecommendedLessonsHistory = ({
|
|
|
7620
7780
|
image: noSearchImage
|
|
7621
7781
|
},
|
|
7622
7782
|
emptyState: {
|
|
7623
|
-
component: /* @__PURE__ */
|
|
7783
|
+
component: /* @__PURE__ */ jsx42(
|
|
7624
7784
|
EmptyState_default,
|
|
7625
7785
|
{
|
|
7626
7786
|
image: emptyStateImage,
|
|
7627
7787
|
title: "Crie uma nova aula",
|
|
7628
7788
|
description: "Selecione um conjunto de aulas organizadas por tema e ajude seus alunos a estudarem de forma estruturada e eficiente!",
|
|
7629
7789
|
buttonText: createButtonText,
|
|
7630
|
-
buttonIcon: /* @__PURE__ */
|
|
7790
|
+
buttonIcon: /* @__PURE__ */ jsx42(Plus2, { size: 18 }),
|
|
7631
7791
|
buttonVariant: "outline",
|
|
7632
7792
|
buttonAction: "primary",
|
|
7633
7793
|
onButtonClick: onCreateLesson
|
|
@@ -7644,14 +7804,14 @@ var RecommendedLessonsHistory = ({
|
|
|
7644
7804
|
} = renderProps;
|
|
7645
7805
|
return /* @__PURE__ */ jsxs28("div", { className: "space-y-4", children: [
|
|
7646
7806
|
/* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between gap-4", children: [
|
|
7647
|
-
/* @__PURE__ */
|
|
7807
|
+
/* @__PURE__ */ jsx42(
|
|
7648
7808
|
Button_default,
|
|
7649
7809
|
{
|
|
7650
7810
|
variant: "solid",
|
|
7651
7811
|
action: "primary",
|
|
7652
7812
|
size: "medium",
|
|
7653
7813
|
onClick: onCreateLesson,
|
|
7654
|
-
iconLeft: /* @__PURE__ */
|
|
7814
|
+
iconLeft: /* @__PURE__ */ jsx42(Plus2, { size: 18, weight: "bold" }),
|
|
7655
7815
|
children: createButtonText
|
|
7656
7816
|
}
|
|
7657
7817
|
),
|
|
@@ -7665,8 +7825,22 @@ var RecommendedLessonsHistory = ({
|
|
|
7665
7825
|
}
|
|
7666
7826
|
}
|
|
7667
7827
|
) }) }),
|
|
7668
|
-
activeTab === "drafts" /* DRAFTS */ &&
|
|
7669
|
-
|
|
7828
|
+
activeTab === "drafts" /* DRAFTS */ && fetchGoalDrafts && deleteGoalDraft && onCreateLesson && /* @__PURE__ */ jsx42(
|
|
7829
|
+
GoalDraftsTab,
|
|
7830
|
+
{
|
|
7831
|
+
fetchGoalDrafts,
|
|
7832
|
+
deleteGoalDraft,
|
|
7833
|
+
onCreateDraft: onCreateLesson,
|
|
7834
|
+
onSendDraft,
|
|
7835
|
+
onEditDraft,
|
|
7836
|
+
emptyStateImage,
|
|
7837
|
+
noSearchImage,
|
|
7838
|
+
mapSubjectNameToEnum,
|
|
7839
|
+
userFilterData,
|
|
7840
|
+
subjectsMap
|
|
7841
|
+
}
|
|
7842
|
+
),
|
|
7843
|
+
activeTab === "models" /* MODELS */ && fetchGoalModels && deleteGoalModel && onCreateModel && /* @__PURE__ */ jsx42(
|
|
7670
7844
|
GoalModelsTab,
|
|
7671
7845
|
{
|
|
7672
7846
|
fetchGoalModels,
|