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
|
@@ -37,7 +37,7 @@ __export(RecommendedLessonsHistory_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(RecommendedLessonsHistory_exports);
|
|
38
38
|
|
|
39
39
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
40
|
-
var
|
|
40
|
+
var import_react24 = require("react");
|
|
41
41
|
var import_phosphor_react17 = require("phosphor-react");
|
|
42
42
|
|
|
43
43
|
// src/utils/utils.ts
|
|
@@ -580,7 +580,7 @@ var injectStore = (children, store) => import_react2.Children.map(children, (chi
|
|
|
580
580
|
});
|
|
581
581
|
|
|
582
582
|
// src/components/TableProvider/TableProvider.tsx
|
|
583
|
-
var
|
|
583
|
+
var import_react23 = require("react");
|
|
584
584
|
|
|
585
585
|
// src/components/Table/Table.tsx
|
|
586
586
|
var import_react4 = require("react");
|
|
@@ -2678,7 +2678,7 @@ Search.displayName = "Search";
|
|
|
2678
2678
|
var Search_default = Search;
|
|
2679
2679
|
|
|
2680
2680
|
// src/components/CheckBoxGroup/CheckBoxGroup.tsx
|
|
2681
|
-
var
|
|
2681
|
+
var import_react22 = require("react");
|
|
2682
2682
|
|
|
2683
2683
|
// src/components/CheckBox/CheckBox.tsx
|
|
2684
2684
|
var import_react12 = require("react");
|
|
@@ -5469,6 +5469,120 @@ var getSubjectInfo = (subject) => {
|
|
|
5469
5469
|
};
|
|
5470
5470
|
};
|
|
5471
5471
|
|
|
5472
|
+
// src/components/shared/ModelsTabBase/createModelsTableColumnsBase.tsx
|
|
5473
|
+
var import_phosphor_react14 = require("phosphor-react");
|
|
5474
|
+
|
|
5475
|
+
// src/utils/renderSubjectCell.tsx
|
|
5476
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5477
|
+
var renderSubjectCell = (subjectName, mapSubjectNameToEnum, showEmptyDash = false) => {
|
|
5478
|
+
if (!subjectName) {
|
|
5479
|
+
return showEmptyDash ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text_default, { size: "sm", color: "text-text-400", children: "-" }) : null;
|
|
5480
|
+
}
|
|
5481
|
+
const subjectEnum = mapSubjectNameToEnum?.(subjectName);
|
|
5482
|
+
if (!subjectEnum) {
|
|
5483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
5484
|
+
}
|
|
5485
|
+
const subjectInfo = getSubjectInfo(subjectEnum);
|
|
5486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2", title: subjectName, children: [
|
|
5487
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5488
|
+
"span",
|
|
5489
|
+
{
|
|
5490
|
+
className: cn(
|
|
5491
|
+
"w-[21px] h-[21px] flex items-center justify-center rounded-sm text-text-950 shrink-0",
|
|
5492
|
+
subjectInfo.colorClass
|
|
5493
|
+
),
|
|
5494
|
+
children: subjectInfo.icon
|
|
5495
|
+
}
|
|
5496
|
+
),
|
|
5497
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text_default, { size: "sm", className: "truncate", children: subjectName })
|
|
5498
|
+
] });
|
|
5499
|
+
};
|
|
5500
|
+
|
|
5501
|
+
// src/components/shared/ModelsTabBase/createModelsTableColumnsBase.tsx
|
|
5502
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5503
|
+
var createModelsTableColumnsBase = (mapSubjectNameToEnum, onSend, onEdit, onDelete, config) => [
|
|
5504
|
+
{
|
|
5505
|
+
key: "title",
|
|
5506
|
+
label: "T\xEDtulo",
|
|
5507
|
+
sortable: true,
|
|
5508
|
+
className: "max-w-[400px]",
|
|
5509
|
+
render: (value) => {
|
|
5510
|
+
const title = typeof value === "string" ? value : "";
|
|
5511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text_default, { size: "sm", title, className: "truncate block", children: title });
|
|
5512
|
+
}
|
|
5513
|
+
},
|
|
5514
|
+
{
|
|
5515
|
+
key: "savedAt",
|
|
5516
|
+
label: "Salvo em",
|
|
5517
|
+
sortable: true,
|
|
5518
|
+
className: "w-[120px]"
|
|
5519
|
+
},
|
|
5520
|
+
{
|
|
5521
|
+
key: "subject",
|
|
5522
|
+
label: "Mat\xE9ria",
|
|
5523
|
+
sortable: true,
|
|
5524
|
+
className: "max-w-[160px]",
|
|
5525
|
+
render: (value) => {
|
|
5526
|
+
const subjectName = typeof value === "string" ? value : "";
|
|
5527
|
+
return renderSubjectCell(subjectName, mapSubjectNameToEnum, true);
|
|
5528
|
+
}
|
|
5529
|
+
},
|
|
5530
|
+
{
|
|
5531
|
+
key: "actions",
|
|
5532
|
+
label: "",
|
|
5533
|
+
sortable: false,
|
|
5534
|
+
className: "w-[220px]",
|
|
5535
|
+
render: (_value, row) => {
|
|
5536
|
+
const handleSend = (e) => {
|
|
5537
|
+
e.stopPropagation();
|
|
5538
|
+
onSend?.(row);
|
|
5539
|
+
};
|
|
5540
|
+
const handleEdit = (e) => {
|
|
5541
|
+
e.stopPropagation();
|
|
5542
|
+
onEdit?.(row);
|
|
5543
|
+
};
|
|
5544
|
+
const handleDelete = (e) => {
|
|
5545
|
+
e.stopPropagation();
|
|
5546
|
+
onDelete(row);
|
|
5547
|
+
};
|
|
5548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2 justify-end", children: [
|
|
5549
|
+
onSend && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5550
|
+
Button_default,
|
|
5551
|
+
{
|
|
5552
|
+
variant: "outline",
|
|
5553
|
+
action: "primary",
|
|
5554
|
+
size: "small",
|
|
5555
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_phosphor_react14.PaperPlaneTilt, { size: 16 }),
|
|
5556
|
+
onClick: handleSend,
|
|
5557
|
+
"aria-label": config.sendButtonAriaLabel,
|
|
5558
|
+
children: config.sendButtonLabel
|
|
5559
|
+
}
|
|
5560
|
+
),
|
|
5561
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5562
|
+
IconButton_default,
|
|
5563
|
+
{
|
|
5564
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_phosphor_react14.Trash, { size: 20 }),
|
|
5565
|
+
size: "md",
|
|
5566
|
+
onClick: handleDelete,
|
|
5567
|
+
"aria-label": config.deleteButtonAriaLabel,
|
|
5568
|
+
className: "text-text-600 hover:text-error-500 hover:bg-transparent"
|
|
5569
|
+
}
|
|
5570
|
+
),
|
|
5571
|
+
onEdit && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5572
|
+
IconButton_default,
|
|
5573
|
+
{
|
|
5574
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_phosphor_react14.PencilSimple, { size: 20 }),
|
|
5575
|
+
size: "md",
|
|
5576
|
+
onClick: handleEdit,
|
|
5577
|
+
"aria-label": config.editButtonAriaLabel,
|
|
5578
|
+
className: "text-text-600 hover:text-primary-700 hover:bg-transparent"
|
|
5579
|
+
}
|
|
5580
|
+
)
|
|
5581
|
+
] });
|
|
5582
|
+
}
|
|
5583
|
+
}
|
|
5584
|
+
];
|
|
5585
|
+
|
|
5472
5586
|
// src/types/common.ts
|
|
5473
5587
|
var getStatusBadgeAction = (status) => {
|
|
5474
5588
|
const actionMap = {
|
|
@@ -5761,40 +5875,91 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
|
|
|
5761
5875
|
};
|
|
5762
5876
|
};
|
|
5763
5877
|
|
|
5764
|
-
// src/
|
|
5765
|
-
var
|
|
5766
|
-
var
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
),
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5878
|
+
// src/hooks/useGoalDrafts.ts
|
|
5879
|
+
var import_react20 = require("react");
|
|
5880
|
+
var DEFAULT_GOAL_DRAFTS_PAGINATION = {
|
|
5881
|
+
total: 0,
|
|
5882
|
+
page: 1,
|
|
5883
|
+
limit: 10,
|
|
5884
|
+
totalPages: 0
|
|
5885
|
+
};
|
|
5886
|
+
var handleGoalDraftFetchError = createFetchErrorHandler(
|
|
5887
|
+
"Erro ao validar dados de rascunhos de aulas",
|
|
5888
|
+
"Erro ao carregar rascunhos de aulas"
|
|
5889
|
+
);
|
|
5890
|
+
var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
5891
|
+
return () => {
|
|
5892
|
+
const [state, setState] = (0, import_react20.useState)({
|
|
5893
|
+
models: [],
|
|
5894
|
+
loading: false,
|
|
5895
|
+
error: null,
|
|
5896
|
+
pagination: DEFAULT_GOAL_DRAFTS_PAGINATION
|
|
5897
|
+
});
|
|
5898
|
+
const fetchModels = (0, import_react20.useCallback)(
|
|
5899
|
+
async (filters, subjectsMap) => {
|
|
5900
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
5901
|
+
try {
|
|
5902
|
+
const responseData = await fetchGoalDrafts(filters);
|
|
5903
|
+
const validatedData = goalModelsApiResponseSchema.parse(responseData);
|
|
5904
|
+
const tableItems = validatedData.data.drafts.map(
|
|
5905
|
+
(draft) => transformGoalModelToTableItem(draft, subjectsMap)
|
|
5906
|
+
);
|
|
5907
|
+
const limit = filters?.limit || 10;
|
|
5908
|
+
const page = filters?.page || 1;
|
|
5909
|
+
const total = validatedData.data.total;
|
|
5910
|
+
const totalPages = Math.ceil(total / limit);
|
|
5911
|
+
setState({
|
|
5912
|
+
models: tableItems,
|
|
5913
|
+
loading: false,
|
|
5914
|
+
error: null,
|
|
5915
|
+
pagination: {
|
|
5916
|
+
total,
|
|
5917
|
+
page,
|
|
5918
|
+
limit,
|
|
5919
|
+
totalPages
|
|
5920
|
+
}
|
|
5921
|
+
});
|
|
5922
|
+
} catch (error) {
|
|
5923
|
+
const errorMessage = handleGoalDraftFetchError(error);
|
|
5924
|
+
setState((prev) => ({
|
|
5925
|
+
...prev,
|
|
5926
|
+
loading: false,
|
|
5927
|
+
error: errorMessage
|
|
5928
|
+
}));
|
|
5929
|
+
}
|
|
5930
|
+
},
|
|
5931
|
+
[fetchGoalDrafts]
|
|
5932
|
+
);
|
|
5933
|
+
const deleteModel = (0, import_react20.useCallback)(
|
|
5934
|
+
async (id) => {
|
|
5935
|
+
try {
|
|
5936
|
+
await deleteGoalDraft(id);
|
|
5937
|
+
return true;
|
|
5938
|
+
} catch (error) {
|
|
5939
|
+
console.error("Erro ao deletar rascunho:", error);
|
|
5940
|
+
return false;
|
|
5941
|
+
}
|
|
5942
|
+
},
|
|
5943
|
+
[deleteGoalDraft]
|
|
5944
|
+
);
|
|
5945
|
+
return {
|
|
5946
|
+
...state,
|
|
5947
|
+
fetchModels,
|
|
5948
|
+
deleteModel
|
|
5949
|
+
};
|
|
5950
|
+
};
|
|
5792
5951
|
};
|
|
5793
5952
|
|
|
5794
5953
|
// src/components/shared/ModelsTabBase/ModelsTabBase.tsx
|
|
5795
|
-
var
|
|
5796
|
-
var
|
|
5954
|
+
var import_react21 = require("react");
|
|
5955
|
+
var import_phosphor_react15 = require("phosphor-react");
|
|
5956
|
+
|
|
5957
|
+
// src/components/ActivitiesHistory/components/ErrorDisplay.tsx
|
|
5797
5958
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5959
|
+
var ErrorDisplay = ({ error }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text_default, { size: "lg", color: "text-error-500", children: error }) });
|
|
5960
|
+
|
|
5961
|
+
// src/components/shared/ModelsTabBase/ModelsTabBase.tsx
|
|
5962
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5798
5963
|
var ModelsTabBase = ({
|
|
5799
5964
|
fetchModels: fetchModelsProp,
|
|
5800
5965
|
deleteModel: deleteModelProp,
|
|
@@ -5812,16 +5977,16 @@ var ModelsTabBase = ({
|
|
|
5812
5977
|
buildFiltersFromParams: buildFiltersFromParams2,
|
|
5813
5978
|
createUseModels
|
|
5814
5979
|
}) => {
|
|
5815
|
-
const [deleteDialogOpen, setDeleteDialogOpen] = (0,
|
|
5816
|
-
const [modelToDelete, setModelToDelete] = (0,
|
|
5980
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react21.useState)(false);
|
|
5981
|
+
const [modelToDelete, setModelToDelete] = (0, import_react21.useState)(null);
|
|
5817
5982
|
const { addToast } = useToast();
|
|
5818
|
-
const fetchModelsRef = (0,
|
|
5983
|
+
const fetchModelsRef = (0, import_react21.useRef)(fetchModelsProp);
|
|
5819
5984
|
fetchModelsRef.current = fetchModelsProp;
|
|
5820
|
-
const deleteModelRef = (0,
|
|
5985
|
+
const deleteModelRef = (0, import_react21.useRef)(deleteModelProp);
|
|
5821
5986
|
deleteModelRef.current = deleteModelProp;
|
|
5822
|
-
const subjectsMapRef = (0,
|
|
5987
|
+
const subjectsMapRef = (0, import_react21.useRef)(subjectsMap);
|
|
5823
5988
|
subjectsMapRef.current = subjectsMap;
|
|
5824
|
-
const useModels = (0,
|
|
5989
|
+
const useModels = (0, import_react21.useMemo)(
|
|
5825
5990
|
() => createUseModels(
|
|
5826
5991
|
(filters) => fetchModelsRef.current(filters),
|
|
5827
5992
|
(id) => deleteModelRef.current(id)
|
|
@@ -5836,15 +6001,15 @@ var ModelsTabBase = ({
|
|
|
5836
6001
|
fetchModels,
|
|
5837
6002
|
deleteModel
|
|
5838
6003
|
} = useModels();
|
|
5839
|
-
const modelsFilterConfigs = (0,
|
|
6004
|
+
const modelsFilterConfigs = (0, import_react21.useMemo)(
|
|
5840
6005
|
() => createFiltersConfig(userFilterData),
|
|
5841
6006
|
[createFiltersConfig, userFilterData]
|
|
5842
6007
|
);
|
|
5843
|
-
const handleDeleteClick = (0,
|
|
6008
|
+
const handleDeleteClick = (0, import_react21.useCallback)((model) => {
|
|
5844
6009
|
setModelToDelete(model);
|
|
5845
6010
|
setDeleteDialogOpen(true);
|
|
5846
6011
|
}, []);
|
|
5847
|
-
const modelsTableColumns = (0,
|
|
6012
|
+
const modelsTableColumns = (0, import_react21.useMemo)(
|
|
5848
6013
|
() => createTableColumns2(
|
|
5849
6014
|
mapSubjectNameToEnum,
|
|
5850
6015
|
onSend,
|
|
@@ -5859,17 +6024,17 @@ var ModelsTabBase = ({
|
|
|
5859
6024
|
handleDeleteClick
|
|
5860
6025
|
]
|
|
5861
6026
|
);
|
|
5862
|
-
const handleParamsChange = (0,
|
|
6027
|
+
const handleParamsChange = (0, import_react21.useCallback)(
|
|
5863
6028
|
(params) => {
|
|
5864
6029
|
const filters = buildFiltersFromParams2(params);
|
|
5865
6030
|
fetchModels(filters, subjectsMapRef.current);
|
|
5866
6031
|
},
|
|
5867
6032
|
[buildFiltersFromParams2, fetchModels]
|
|
5868
6033
|
);
|
|
5869
|
-
(0,
|
|
6034
|
+
(0, import_react21.useEffect)(() => {
|
|
5870
6035
|
fetchModels({ page: 1, limit: 10 }, subjectsMapRef.current);
|
|
5871
6036
|
}, [fetchModels]);
|
|
5872
|
-
const handleConfirmDelete = (0,
|
|
6037
|
+
const handleConfirmDelete = (0, import_react21.useCallback)(async () => {
|
|
5873
6038
|
if (modelToDelete) {
|
|
5874
6039
|
const success = await deleteModel(modelToDelete.id);
|
|
5875
6040
|
if (success) {
|
|
@@ -5882,13 +6047,13 @@ var ModelsTabBase = ({
|
|
|
5882
6047
|
setDeleteDialogOpen(false);
|
|
5883
6048
|
setModelToDelete(null);
|
|
5884
6049
|
}, [modelToDelete, deleteModel, fetchModels, addToast]);
|
|
5885
|
-
const handleCancelDelete = (0,
|
|
6050
|
+
const handleCancelDelete = (0, import_react21.useCallback)(() => {
|
|
5886
6051
|
setDeleteDialogOpen(false);
|
|
5887
6052
|
setModelToDelete(null);
|
|
5888
6053
|
}, []);
|
|
5889
|
-
return /* @__PURE__ */ (0,
|
|
5890
|
-
/* @__PURE__ */ (0,
|
|
5891
|
-
modelsError ? /* @__PURE__ */ (0,
|
|
6054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
6055
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Toaster_default, {}),
|
|
6056
|
+
modelsError ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ErrorDisplay, { error: modelsError }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-full", "data-testid": config.testId, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5892
6057
|
TableProvider,
|
|
5893
6058
|
{
|
|
5894
6059
|
data: models,
|
|
@@ -5912,14 +6077,14 @@ var ModelsTabBase = ({
|
|
|
5912
6077
|
image: noSearchImage
|
|
5913
6078
|
},
|
|
5914
6079
|
emptyState: {
|
|
5915
|
-
component: /* @__PURE__ */ (0,
|
|
6080
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5916
6081
|
EmptyState_default,
|
|
5917
6082
|
{
|
|
5918
6083
|
image: emptyStateImage,
|
|
5919
6084
|
title: config.emptyStateTitle,
|
|
5920
6085
|
description: config.emptyStateDescription,
|
|
5921
6086
|
buttonText: "Criar modelo",
|
|
5922
|
-
buttonIcon: /* @__PURE__ */ (0,
|
|
6087
|
+
buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react15.Plus, { size: 18 }),
|
|
5923
6088
|
buttonVariant: "outline",
|
|
5924
6089
|
buttonAction: "primary",
|
|
5925
6090
|
onButtonClick: onCreateModel
|
|
@@ -5933,22 +6098,22 @@ var ModelsTabBase = ({
|
|
|
5933
6098
|
table,
|
|
5934
6099
|
pagination: paginationComponent
|
|
5935
6100
|
} = renderProps;
|
|
5936
|
-
return /* @__PURE__ */ (0,
|
|
5937
|
-
/* @__PURE__ */ (0,
|
|
5938
|
-
/* @__PURE__ */ (0,
|
|
6101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-4", children: [
|
|
6102
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
6103
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5939
6104
|
Button_default,
|
|
5940
6105
|
{
|
|
5941
6106
|
variant: "solid",
|
|
5942
6107
|
action: "primary",
|
|
5943
6108
|
size: "medium",
|
|
5944
6109
|
onClick: onCreateModel,
|
|
5945
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
6110
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react15.Plus, { size: 18, weight: "bold" }),
|
|
5946
6111
|
children: "Criar modelo"
|
|
5947
6112
|
}
|
|
5948
6113
|
),
|
|
5949
6114
|
controls
|
|
5950
6115
|
] }),
|
|
5951
|
-
/* @__PURE__ */ (0,
|
|
6116
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
|
|
5952
6117
|
table,
|
|
5953
6118
|
paginationComponent
|
|
5954
6119
|
] })
|
|
@@ -5956,7 +6121,7 @@ var ModelsTabBase = ({
|
|
|
5956
6121
|
}
|
|
5957
6122
|
}
|
|
5958
6123
|
) }),
|
|
5959
|
-
/* @__PURE__ */ (0,
|
|
6124
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5960
6125
|
AlertDialog,
|
|
5961
6126
|
{
|
|
5962
6127
|
isOpen: deleteDialogOpen,
|
|
@@ -5972,92 +6137,98 @@ var ModelsTabBase = ({
|
|
|
5972
6137
|
] });
|
|
5973
6138
|
};
|
|
5974
6139
|
|
|
5975
|
-
// src/components/
|
|
5976
|
-
var
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
render: (value) => {
|
|
5985
|
-
const title = typeof value === "string" ? value : "";
|
|
5986
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text_default, { size: "sm", title, className: "truncate block", children: title });
|
|
5987
|
-
}
|
|
5988
|
-
},
|
|
5989
|
-
{
|
|
5990
|
-
key: "savedAt",
|
|
5991
|
-
label: "Salvo em",
|
|
5992
|
-
sortable: true,
|
|
5993
|
-
className: "w-[120px]"
|
|
5994
|
-
},
|
|
5995
|
-
{
|
|
5996
|
-
key: "subject",
|
|
5997
|
-
label: "Mat\xE9ria",
|
|
5998
|
-
sortable: true,
|
|
5999
|
-
className: "max-w-[160px]",
|
|
6000
|
-
render: (value) => {
|
|
6001
|
-
const subjectName = typeof value === "string" ? value : "";
|
|
6002
|
-
return renderSubjectCell(subjectName, mapSubjectNameToEnum, true);
|
|
6003
|
-
}
|
|
6004
|
-
},
|
|
6140
|
+
// src/components/RecommendedLessonsHistory/config/draftsFiltersConfig.ts
|
|
6141
|
+
var getSubjectOptions = (data) => {
|
|
6142
|
+
if (!data?.subjects) return [];
|
|
6143
|
+
return data.subjects.map((subject) => ({
|
|
6144
|
+
id: subject.id,
|
|
6145
|
+
name: subject.name
|
|
6146
|
+
}));
|
|
6147
|
+
};
|
|
6148
|
+
var createGoalDraftsFiltersConfig = (userData) => [
|
|
6005
6149
|
{
|
|
6006
|
-
key: "
|
|
6007
|
-
label: "",
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
}
|
|
6015
|
-
|
|
6016
|
-
e.stopPropagation();
|
|
6017
|
-
onEdit?.(row);
|
|
6018
|
-
};
|
|
6019
|
-
const handleDelete = (e) => {
|
|
6020
|
-
e.stopPropagation();
|
|
6021
|
-
onDelete(row);
|
|
6022
|
-
};
|
|
6023
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-2 justify-end", children: [
|
|
6024
|
-
onSend && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6025
|
-
Button_default,
|
|
6026
|
-
{
|
|
6027
|
-
variant: "outline",
|
|
6028
|
-
action: "primary",
|
|
6029
|
-
size: "small",
|
|
6030
|
-
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react15.PaperPlaneTilt, { size: 16 }),
|
|
6031
|
-
onClick: handleSend,
|
|
6032
|
-
"aria-label": config.sendButtonAriaLabel,
|
|
6033
|
-
children: config.sendButtonLabel
|
|
6034
|
-
}
|
|
6035
|
-
),
|
|
6036
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6037
|
-
IconButton_default,
|
|
6038
|
-
{
|
|
6039
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react15.Trash, { size: 20 }),
|
|
6040
|
-
size: "md",
|
|
6041
|
-
onClick: handleDelete,
|
|
6042
|
-
"aria-label": config.deleteButtonAriaLabel,
|
|
6043
|
-
className: "text-text-600 hover:text-error-500 hover:bg-transparent"
|
|
6044
|
-
}
|
|
6045
|
-
),
|
|
6046
|
-
onEdit && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6047
|
-
IconButton_default,
|
|
6048
|
-
{
|
|
6049
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react15.PencilSimple, { size: 20 }),
|
|
6050
|
-
size: "md",
|
|
6051
|
-
onClick: handleEdit,
|
|
6052
|
-
"aria-label": config.editButtonAriaLabel,
|
|
6053
|
-
className: "text-text-600 hover:text-primary-700 hover:bg-transparent"
|
|
6054
|
-
}
|
|
6055
|
-
)
|
|
6056
|
-
] });
|
|
6057
|
-
}
|
|
6150
|
+
key: "content",
|
|
6151
|
+
label: "CONTE\xDADO",
|
|
6152
|
+
categories: [
|
|
6153
|
+
{
|
|
6154
|
+
key: "subject",
|
|
6155
|
+
label: "Mat\xE9ria",
|
|
6156
|
+
selectedIds: [],
|
|
6157
|
+
itens: getSubjectOptions(userData)
|
|
6158
|
+
}
|
|
6159
|
+
]
|
|
6058
6160
|
}
|
|
6059
6161
|
];
|
|
6060
6162
|
|
|
6163
|
+
// src/components/RecommendedLessonsHistory/utils/filterBuilders.ts
|
|
6164
|
+
var buildGoalModelsFiltersFromParams = (params) => {
|
|
6165
|
+
const filters = {
|
|
6166
|
+
page: params.page,
|
|
6167
|
+
limit: params.limit
|
|
6168
|
+
};
|
|
6169
|
+
if (params.search) {
|
|
6170
|
+
filters.search = params.search;
|
|
6171
|
+
}
|
|
6172
|
+
if (Array.isArray(params.subject) && params.subject.length > 0) {
|
|
6173
|
+
filters.subjectId = params.subject[0];
|
|
6174
|
+
}
|
|
6175
|
+
return filters;
|
|
6176
|
+
};
|
|
6177
|
+
|
|
6178
|
+
// src/components/RecommendedLessonsHistory/tabs/DraftsTab.tsx
|
|
6179
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6180
|
+
var GOAL_DRAFTS_CONFIG = {
|
|
6181
|
+
entityName: "rascunho",
|
|
6182
|
+
entityNamePlural: "rascunhos",
|
|
6183
|
+
testId: "goal-drafts-tab",
|
|
6184
|
+
emptyStateTitle: "Voc\xEA n\xE3o tem aulas recomendadas em rascunho",
|
|
6185
|
+
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!",
|
|
6186
|
+
searchPlaceholder: "Buscar rascunho"
|
|
6187
|
+
};
|
|
6188
|
+
var GOAL_DRAFTS_COLUMNS_CONFIG = {
|
|
6189
|
+
sendButtonLabel: "Enviar aula",
|
|
6190
|
+
sendButtonAriaLabel: "Enviar rascunho",
|
|
6191
|
+
deleteButtonAriaLabel: "Deletar rascunho",
|
|
6192
|
+
editButtonAriaLabel: "Editar rascunho"
|
|
6193
|
+
};
|
|
6194
|
+
var GoalDraftsTab = ({
|
|
6195
|
+
fetchGoalDrafts,
|
|
6196
|
+
deleteGoalDraft,
|
|
6197
|
+
onCreateDraft,
|
|
6198
|
+
onSendDraft,
|
|
6199
|
+
onEditDraft,
|
|
6200
|
+
emptyStateImage,
|
|
6201
|
+
noSearchImage,
|
|
6202
|
+
mapSubjectNameToEnum,
|
|
6203
|
+
userFilterData,
|
|
6204
|
+
subjectsMap
|
|
6205
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6206
|
+
ModelsTabBase,
|
|
6207
|
+
{
|
|
6208
|
+
fetchModels: fetchGoalDrafts,
|
|
6209
|
+
deleteModel: deleteGoalDraft,
|
|
6210
|
+
onCreateModel: onCreateDraft,
|
|
6211
|
+
onSend: onSendDraft,
|
|
6212
|
+
onEditModel: onEditDraft,
|
|
6213
|
+
emptyStateImage,
|
|
6214
|
+
noSearchImage,
|
|
6215
|
+
mapSubjectNameToEnum,
|
|
6216
|
+
userFilterData,
|
|
6217
|
+
subjectsMap,
|
|
6218
|
+
config: GOAL_DRAFTS_CONFIG,
|
|
6219
|
+
createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
|
|
6220
|
+
mapSubject,
|
|
6221
|
+
send,
|
|
6222
|
+
edit,
|
|
6223
|
+
del,
|
|
6224
|
+
GOAL_DRAFTS_COLUMNS_CONFIG
|
|
6225
|
+
),
|
|
6226
|
+
createFiltersConfig: createGoalDraftsFiltersConfig,
|
|
6227
|
+
buildFiltersFromParams: buildGoalModelsFiltersFromParams,
|
|
6228
|
+
createUseModels: createUseGoalDrafts
|
|
6229
|
+
}
|
|
6230
|
+
);
|
|
6231
|
+
|
|
6061
6232
|
// src/components/CheckBoxGroup/CheckBoxGroup.helpers.ts
|
|
6062
6233
|
var areSelectedIdsEqual = (ids1, ids2) => {
|
|
6063
6234
|
if (ids1 === ids2) return true;
|
|
@@ -6140,7 +6311,7 @@ var calculateFormattedItemsForAutoSelection = (category, allCategories) => {
|
|
|
6140
6311
|
};
|
|
6141
6312
|
|
|
6142
6313
|
// src/components/CheckBoxGroup/CheckBoxGroup.tsx
|
|
6143
|
-
var
|
|
6314
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6144
6315
|
var CheckboxGroup = ({
|
|
6145
6316
|
categories,
|
|
6146
6317
|
onCategoriesChange,
|
|
@@ -6148,14 +6319,14 @@ var CheckboxGroup = ({
|
|
|
6148
6319
|
showDivider = true,
|
|
6149
6320
|
showSingleItem = false
|
|
6150
6321
|
}) => {
|
|
6151
|
-
const [openAccordion, setOpenAccordion] = (0,
|
|
6152
|
-
const onCategoriesChangeRef = (0,
|
|
6153
|
-
const previousCategoriesRef = (0,
|
|
6154
|
-
const appliedAutoSelectionRef = (0,
|
|
6155
|
-
(0,
|
|
6322
|
+
const [openAccordion, setOpenAccordion] = (0, import_react22.useState)("");
|
|
6323
|
+
const onCategoriesChangeRef = (0, import_react22.useRef)(onCategoriesChange);
|
|
6324
|
+
const previousCategoriesRef = (0, import_react22.useRef)(categories);
|
|
6325
|
+
const appliedAutoSelectionRef = (0, import_react22.useRef)("");
|
|
6326
|
+
(0, import_react22.useEffect)(() => {
|
|
6156
6327
|
onCategoriesChangeRef.current = onCategoriesChange;
|
|
6157
6328
|
}, [onCategoriesChange]);
|
|
6158
|
-
const categoriesWithAutoSelection = (0,
|
|
6329
|
+
const categoriesWithAutoSelection = (0, import_react22.useMemo)(() => {
|
|
6159
6330
|
return categories.map((category) => {
|
|
6160
6331
|
const filteredItems = calculateFormattedItemsForAutoSelection(
|
|
6161
6332
|
category,
|
|
@@ -6170,7 +6341,7 @@ var CheckboxGroup = ({
|
|
|
6170
6341
|
return category;
|
|
6171
6342
|
});
|
|
6172
6343
|
}, [categories]);
|
|
6173
|
-
(0,
|
|
6344
|
+
(0, import_react22.useEffect)(() => {
|
|
6174
6345
|
const categoriesChanged = categories !== previousCategoriesRef.current;
|
|
6175
6346
|
previousCategoriesRef.current = categories;
|
|
6176
6347
|
const hasAutoSelectionChanges = categoriesWithAutoSelection.some(
|
|
@@ -6292,7 +6463,7 @@ var CheckboxGroup = ({
|
|
|
6292
6463
|
);
|
|
6293
6464
|
return groupedItems.length ? groupedItems : [{ itens: [] }];
|
|
6294
6465
|
};
|
|
6295
|
-
const formattedItemsMap = (0,
|
|
6466
|
+
const formattedItemsMap = (0, import_react22.useMemo)(() => {
|
|
6296
6467
|
const formattedItemsMap2 = {};
|
|
6297
6468
|
for (const category of categories) {
|
|
6298
6469
|
const formattedItems = calculateFormattedItems(category.key);
|
|
@@ -6447,8 +6618,8 @@ var CheckboxGroup = ({
|
|
|
6447
6618
|
};
|
|
6448
6619
|
const renderCheckboxItem = (item, categoryKey) => {
|
|
6449
6620
|
const uniqueId = `${categoryKey}-${item.id}`;
|
|
6450
|
-
return /* @__PURE__ */ (0,
|
|
6451
|
-
/* @__PURE__ */ (0,
|
|
6621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3 px-2", children: [
|
|
6622
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6452
6623
|
CheckBox_default,
|
|
6453
6624
|
{
|
|
6454
6625
|
id: uniqueId,
|
|
@@ -6456,7 +6627,7 @@ var CheckboxGroup = ({
|
|
|
6456
6627
|
onChange: () => toggleItem(categoryKey, item.id)
|
|
6457
6628
|
}
|
|
6458
6629
|
),
|
|
6459
|
-
/* @__PURE__ */ (0,
|
|
6630
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6460
6631
|
"label",
|
|
6461
6632
|
{
|
|
6462
6633
|
htmlFor: uniqueId,
|
|
@@ -6466,12 +6637,12 @@ var CheckboxGroup = ({
|
|
|
6466
6637
|
)
|
|
6467
6638
|
] }, item.id);
|
|
6468
6639
|
};
|
|
6469
|
-
const renderFormattedGroup = (formattedGroup, idx, categoryKey) => /* @__PURE__ */ (0,
|
|
6640
|
+
const renderFormattedGroup = (formattedGroup, idx, categoryKey) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
6470
6641
|
"div",
|
|
6471
6642
|
{
|
|
6472
6643
|
className: "flex flex-col gap-3",
|
|
6473
6644
|
children: [
|
|
6474
|
-
"groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ (0,
|
|
6645
|
+
"groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text_default, { size: "sm", className: "mt-2", weight: "semibold", children: formattedGroup.groupLabel }),
|
|
6475
6646
|
formattedGroup.itens?.map(
|
|
6476
6647
|
(item) => renderCheckboxItem(item, categoryKey)
|
|
6477
6648
|
)
|
|
@@ -6479,9 +6650,9 @@ var CheckboxGroup = ({
|
|
|
6479
6650
|
},
|
|
6480
6651
|
formattedGroup.groupLabel || `group-${idx}`
|
|
6481
6652
|
);
|
|
6482
|
-
const renderAccordionTrigger = (category, isEnabled) => /* @__PURE__ */ (0,
|
|
6483
|
-
/* @__PURE__ */ (0,
|
|
6484
|
-
/* @__PURE__ */ (0,
|
|
6653
|
+
const renderAccordionTrigger = (category, isEnabled) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between w-full p-2", children: [
|
|
6654
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
6655
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6485
6656
|
CheckBox_default,
|
|
6486
6657
|
{
|
|
6487
6658
|
checked: isMinimalOneCheckBoxIsSelected(category.key),
|
|
@@ -6490,7 +6661,7 @@ var CheckboxGroup = ({
|
|
|
6490
6661
|
onChange: () => toggleAllInCategory(category.key)
|
|
6491
6662
|
}
|
|
6492
6663
|
),
|
|
6493
|
-
/* @__PURE__ */ (0,
|
|
6664
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6494
6665
|
Text_default,
|
|
6495
6666
|
{
|
|
6496
6667
|
size: "sm",
|
|
@@ -6500,7 +6671,7 @@ var CheckboxGroup = ({
|
|
|
6500
6671
|
}
|
|
6501
6672
|
)
|
|
6502
6673
|
] }),
|
|
6503
|
-
(openAccordion === category.key || isEnabled) && /* @__PURE__ */ (0,
|
|
6674
|
+
(openAccordion === category.key || isEnabled) && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Badge_default, { variant: "solid", action: "info", children: getBadgeText2(category) })
|
|
6504
6675
|
] });
|
|
6505
6676
|
const renderCompactSingleItem = (category) => {
|
|
6506
6677
|
const formattedItems = getFormattedItems(category.key);
|
|
@@ -6509,13 +6680,13 @@ var CheckboxGroup = ({
|
|
|
6509
6680
|
return null;
|
|
6510
6681
|
}
|
|
6511
6682
|
const singleItem = allItems[0];
|
|
6512
|
-
return /* @__PURE__ */ (0,
|
|
6683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
6513
6684
|
"div",
|
|
6514
6685
|
{
|
|
6515
6686
|
className: "flex items-center justify-between w-full px-3 py-2",
|
|
6516
6687
|
children: [
|
|
6517
|
-
/* @__PURE__ */ (0,
|
|
6518
|
-
/* @__PURE__ */ (0,
|
|
6688
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-800", children: category.label }),
|
|
6689
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text_default, { size: "sm", className: "text-text-950", children: singleItem.name })
|
|
6519
6690
|
]
|
|
6520
6691
|
},
|
|
6521
6692
|
category.key
|
|
@@ -6531,16 +6702,16 @@ var CheckboxGroup = ({
|
|
|
6531
6702
|
const allItems = formattedItems.flatMap((group) => group.itens || []);
|
|
6532
6703
|
const hasOnlyOneAvailableItem = allItems.length === 1;
|
|
6533
6704
|
if (compactSingleItem && hasOnlyOneAvailableItem && isEnabled) {
|
|
6534
|
-
return /* @__PURE__ */ (0,
|
|
6705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
6535
6706
|
renderCompactSingleItem(category),
|
|
6536
|
-
showDivider && /* @__PURE__ */ (0,
|
|
6707
|
+
showDivider && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Divider_default, {})
|
|
6537
6708
|
] }, category.key);
|
|
6538
6709
|
}
|
|
6539
6710
|
const hasNoItems = formattedItems.every(
|
|
6540
6711
|
(group) => !group.itens || group.itens.length === 0
|
|
6541
6712
|
);
|
|
6542
|
-
return /* @__PURE__ */ (0,
|
|
6543
|
-
/* @__PURE__ */ (0,
|
|
6713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
6714
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6544
6715
|
CardAccordation,
|
|
6545
6716
|
{
|
|
6546
6717
|
value: category.key,
|
|
@@ -6550,15 +6721,15 @@ var CheckboxGroup = ({
|
|
|
6550
6721
|
openAccordion === category.key && "bg-background-50 border-none"
|
|
6551
6722
|
),
|
|
6552
6723
|
trigger: renderAccordionTrigger(category, isEnabled),
|
|
6553
|
-
children: /* @__PURE__ */ (0,
|
|
6724
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-col gap-3 pt-2", children: hasNoItems && isEnabled ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "px-2 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text_default, { size: "sm", className: "text-text-500 text-center", children: "Sem dados" }) }) : formattedItems.map(
|
|
6554
6725
|
(formattedGroup, idx) => renderFormattedGroup(formattedGroup, idx, category.key)
|
|
6555
6726
|
) })
|
|
6556
6727
|
}
|
|
6557
6728
|
),
|
|
6558
|
-
openAccordion !== category.key && showDivider && /* @__PURE__ */ (0,
|
|
6729
|
+
openAccordion !== category.key && showDivider && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Divider_default, {})
|
|
6559
6730
|
] }, category.key);
|
|
6560
6731
|
};
|
|
6561
|
-
(0,
|
|
6732
|
+
(0, import_react22.useEffect)(() => {
|
|
6562
6733
|
if (!openAccordion) return;
|
|
6563
6734
|
const category = categories.find((c) => c.key === openAccordion);
|
|
6564
6735
|
if (!category) return;
|
|
@@ -6569,7 +6740,7 @@ var CheckboxGroup = ({
|
|
|
6569
6740
|
}, 0);
|
|
6570
6741
|
}
|
|
6571
6742
|
}, [categories, openAccordion]);
|
|
6572
|
-
return /* @__PURE__ */ (0,
|
|
6743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6573
6744
|
AccordionGroup,
|
|
6574
6745
|
{
|
|
6575
6746
|
type: "single",
|
|
@@ -6582,7 +6753,7 @@ var CheckboxGroup = ({
|
|
|
6582
6753
|
};
|
|
6583
6754
|
|
|
6584
6755
|
// src/components/Filter/FilterModal.tsx
|
|
6585
|
-
var
|
|
6756
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6586
6757
|
var FilterModal = ({
|
|
6587
6758
|
isOpen,
|
|
6588
6759
|
onClose,
|
|
@@ -6610,20 +6781,20 @@ var FilterModal = ({
|
|
|
6610
6781
|
const handleClear = () => {
|
|
6611
6782
|
onClear();
|
|
6612
6783
|
};
|
|
6613
|
-
return /* @__PURE__ */ (0,
|
|
6784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6614
6785
|
Modal_default,
|
|
6615
6786
|
{
|
|
6616
6787
|
isOpen,
|
|
6617
6788
|
onClose,
|
|
6618
6789
|
title,
|
|
6619
6790
|
size,
|
|
6620
|
-
footer: /* @__PURE__ */ (0,
|
|
6621
|
-
/* @__PURE__ */ (0,
|
|
6622
|
-
/* @__PURE__ */ (0,
|
|
6791
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex gap-3 justify-end w-full", children: [
|
|
6792
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button_default, { variant: "outline", onClick: handleClear, children: clearLabel }),
|
|
6793
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button_default, { onClick: handleApply, children: applyLabel })
|
|
6623
6794
|
] }),
|
|
6624
|
-
children: /* @__PURE__ */ (0,
|
|
6625
|
-
/* @__PURE__ */ (0,
|
|
6626
|
-
config.key === "academic" && /* @__PURE__ */ (0,
|
|
6795
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex flex-col gap-6", children: filterConfigs.map((config, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
6796
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2 text-text-400 text-sm font-medium uppercase", children: [
|
|
6797
|
+
config.key === "academic" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6627
6798
|
"svg",
|
|
6628
6799
|
{
|
|
6629
6800
|
width: "16",
|
|
@@ -6633,7 +6804,7 @@ var FilterModal = ({
|
|
|
6633
6804
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6634
6805
|
className: "text-text-400",
|
|
6635
6806
|
children: [
|
|
6636
|
-
/* @__PURE__ */ (0,
|
|
6807
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6637
6808
|
"path",
|
|
6638
6809
|
{
|
|
6639
6810
|
d: "M8 2L2 5.33333L8 8.66667L14 5.33333L8 2Z",
|
|
@@ -6643,7 +6814,7 @@ var FilterModal = ({
|
|
|
6643
6814
|
strokeLinejoin: "round"
|
|
6644
6815
|
}
|
|
6645
6816
|
),
|
|
6646
|
-
/* @__PURE__ */ (0,
|
|
6817
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6647
6818
|
"path",
|
|
6648
6819
|
{
|
|
6649
6820
|
d: "M2 10.6667L8 14L14 10.6667",
|
|
@@ -6653,7 +6824,7 @@ var FilterModal = ({
|
|
|
6653
6824
|
strokeLinejoin: "round"
|
|
6654
6825
|
}
|
|
6655
6826
|
),
|
|
6656
|
-
/* @__PURE__ */ (0,
|
|
6827
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6657
6828
|
"path",
|
|
6658
6829
|
{
|
|
6659
6830
|
d: "M2 8L8 11.3333L14 8",
|
|
@@ -6666,7 +6837,7 @@ var FilterModal = ({
|
|
|
6666
6837
|
]
|
|
6667
6838
|
}
|
|
6668
6839
|
),
|
|
6669
|
-
config.key === "content" && /* @__PURE__ */ (0,
|
|
6840
|
+
config.key === "content" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6670
6841
|
"svg",
|
|
6671
6842
|
{
|
|
6672
6843
|
width: "16",
|
|
@@ -6676,7 +6847,7 @@ var FilterModal = ({
|
|
|
6676
6847
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6677
6848
|
className: "text-text-400",
|
|
6678
6849
|
children: [
|
|
6679
|
-
/* @__PURE__ */ (0,
|
|
6850
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6680
6851
|
"path",
|
|
6681
6852
|
{
|
|
6682
6853
|
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",
|
|
@@ -6686,7 +6857,7 @@ var FilterModal = ({
|
|
|
6686
6857
|
strokeLinejoin: "round"
|
|
6687
6858
|
}
|
|
6688
6859
|
),
|
|
6689
|
-
/* @__PURE__ */ (0,
|
|
6860
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6690
6861
|
"path",
|
|
6691
6862
|
{
|
|
6692
6863
|
d: "M2 6H14",
|
|
@@ -6696,7 +6867,7 @@ var FilterModal = ({
|
|
|
6696
6867
|
strokeLinejoin: "round"
|
|
6697
6868
|
}
|
|
6698
6869
|
),
|
|
6699
|
-
/* @__PURE__ */ (0,
|
|
6870
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6700
6871
|
"path",
|
|
6701
6872
|
{
|
|
6702
6873
|
d: "M6 2V14",
|
|
@@ -6709,9 +6880,9 @@ var FilterModal = ({
|
|
|
6709
6880
|
]
|
|
6710
6881
|
}
|
|
6711
6882
|
),
|
|
6712
|
-
/* @__PURE__ */ (0,
|
|
6883
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: config.label })
|
|
6713
6884
|
] }),
|
|
6714
|
-
/* @__PURE__ */ (0,
|
|
6885
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6715
6886
|
CheckboxGroup,
|
|
6716
6887
|
{
|
|
6717
6888
|
categories: config.categories,
|
|
@@ -6725,7 +6896,7 @@ var FilterModal = ({
|
|
|
6725
6896
|
|
|
6726
6897
|
// src/components/TableProvider/TableProvider.tsx
|
|
6727
6898
|
var import_phosphor_react16 = require("phosphor-react");
|
|
6728
|
-
var
|
|
6899
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6729
6900
|
function TableProvider({
|
|
6730
6901
|
data,
|
|
6731
6902
|
headers,
|
|
@@ -6749,7 +6920,7 @@ function TableProvider({
|
|
|
6749
6920
|
containerClassName,
|
|
6750
6921
|
children
|
|
6751
6922
|
}) {
|
|
6752
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
6923
|
+
const [searchQuery, setSearchQuery] = (0, import_react23.useState)("");
|
|
6753
6924
|
const sortResultRaw = useTableSort(data, { syncWithUrl: true });
|
|
6754
6925
|
const sortResult = enableTableSort ? sortResultRaw : {
|
|
6755
6926
|
sortedData: data,
|
|
@@ -6760,7 +6931,7 @@ function TableProvider({
|
|
|
6760
6931
|
};
|
|
6761
6932
|
const { sortedData, sortColumn, sortDirection, handleSort } = sortResult;
|
|
6762
6933
|
const filterResultRaw = useTableFilter(initialFilters, { syncWithUrl: true });
|
|
6763
|
-
const disabledFilterResult = (0,
|
|
6934
|
+
const disabledFilterResult = (0, import_react23.useMemo)(
|
|
6764
6935
|
() => ({
|
|
6765
6936
|
filterConfigs: [],
|
|
6766
6937
|
activeFilters: {},
|
|
@@ -6790,10 +6961,10 @@ function TableProvider({
|
|
|
6790
6961
|
totalItems,
|
|
6791
6962
|
totalPages
|
|
6792
6963
|
} = paginationConfig;
|
|
6793
|
-
const [currentPage, setCurrentPage] = (0,
|
|
6794
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
6795
|
-
const [isFilterModalOpen, setIsFilterModalOpen] = (0,
|
|
6796
|
-
const combinedParams = (0,
|
|
6964
|
+
const [currentPage, setCurrentPage] = (0, import_react23.useState)(1);
|
|
6965
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react23.useState)(defaultItemsPerPage);
|
|
6966
|
+
const [isFilterModalOpen, setIsFilterModalOpen] = (0, import_react23.useState)(false);
|
|
6967
|
+
const combinedParams = (0, import_react23.useMemo)(() => {
|
|
6797
6968
|
const params = {
|
|
6798
6969
|
page: currentPage,
|
|
6799
6970
|
limit: itemsPerPage
|
|
@@ -6820,26 +6991,26 @@ function TableProvider({
|
|
|
6820
6991
|
enableFilters,
|
|
6821
6992
|
enableTableSort
|
|
6822
6993
|
]);
|
|
6823
|
-
(0,
|
|
6994
|
+
(0, import_react23.useEffect)(() => {
|
|
6824
6995
|
onParamsChange?.(combinedParams);
|
|
6825
6996
|
}, [combinedParams]);
|
|
6826
|
-
const handleSearchChange = (0,
|
|
6997
|
+
const handleSearchChange = (0, import_react23.useCallback)((value) => {
|
|
6827
6998
|
setSearchQuery(value);
|
|
6828
6999
|
setCurrentPage(1);
|
|
6829
7000
|
}, []);
|
|
6830
|
-
const handleFilterApply = (0,
|
|
7001
|
+
const handleFilterApply = (0, import_react23.useCallback)(() => {
|
|
6831
7002
|
applyFilters();
|
|
6832
7003
|
setIsFilterModalOpen(false);
|
|
6833
7004
|
setCurrentPage(1);
|
|
6834
7005
|
}, [applyFilters]);
|
|
6835
|
-
const handlePageChange = (0,
|
|
7006
|
+
const handlePageChange = (0, import_react23.useCallback)((page) => {
|
|
6836
7007
|
setCurrentPage(page);
|
|
6837
7008
|
}, []);
|
|
6838
|
-
const handleItemsPerPageChange = (0,
|
|
7009
|
+
const handleItemsPerPageChange = (0, import_react23.useCallback)((items) => {
|
|
6839
7010
|
setItemsPerPage(items);
|
|
6840
7011
|
setCurrentPage(1);
|
|
6841
7012
|
}, []);
|
|
6842
|
-
const handleRowClickInternal = (0,
|
|
7013
|
+
const handleRowClickInternal = (0, import_react23.useCallback)(
|
|
6843
7014
|
(row, index) => {
|
|
6844
7015
|
if (enableRowClick && onRowClick) {
|
|
6845
7016
|
onRowClick(row, index);
|
|
@@ -6847,7 +7018,7 @@ function TableProvider({
|
|
|
6847
7018
|
},
|
|
6848
7019
|
[enableRowClick, onRowClick]
|
|
6849
7020
|
);
|
|
6850
|
-
const useInternalPagination = (0,
|
|
7021
|
+
const useInternalPagination = (0, import_react23.useMemo)(
|
|
6851
7022
|
() => enablePagination && !onParamsChange && totalItems === void 0 && totalPages === void 0,
|
|
6852
7023
|
[enablePagination, onParamsChange, totalItems, totalPages]
|
|
6853
7024
|
);
|
|
@@ -6855,7 +7026,7 @@ function TableProvider({
|
|
|
6855
7026
|
(totalItems ?? (useInternalPagination ? sortedData.length : data.length)) / itemsPerPage
|
|
6856
7027
|
);
|
|
6857
7028
|
const calculatedTotalItems = totalItems ?? (useInternalPagination ? sortedData.length : data.length);
|
|
6858
|
-
const displayData = (0,
|
|
7029
|
+
const displayData = (0, import_react23.useMemo)(() => {
|
|
6859
7030
|
if (!useInternalPagination) {
|
|
6860
7031
|
return sortedData;
|
|
6861
7032
|
}
|
|
@@ -6866,21 +7037,21 @@ function TableProvider({
|
|
|
6866
7037
|
const showLoading = loading;
|
|
6867
7038
|
const showNoSearchResult = !loading && data.length === 0 && searchQuery.trim() !== "";
|
|
6868
7039
|
const showEmpty = !loading && data.length === 0 && searchQuery.trim() === "";
|
|
6869
|
-
const controls = (enableSearch || enableFilters) && /* @__PURE__ */ (0,
|
|
6870
|
-
enableFilters && /* @__PURE__ */ (0,
|
|
7040
|
+
const controls = (enableSearch || enableFilters) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
7041
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6871
7042
|
Button_default,
|
|
6872
7043
|
{
|
|
6873
7044
|
variant: "outline",
|
|
6874
7045
|
size: "medium",
|
|
6875
7046
|
onClick: () => setIsFilterModalOpen(true),
|
|
6876
7047
|
children: [
|
|
6877
|
-
/* @__PURE__ */ (0,
|
|
7048
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react16.Funnel, { size: 20 }),
|
|
6878
7049
|
"Filtros",
|
|
6879
|
-
hasActiveFilters && /* @__PURE__ */ (0,
|
|
7050
|
+
hasActiveFilters && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "ml-2 rounded-full bg-primary-500 px-2 py-0.5 text-xs text-white", children: Object.keys(activeFilters).length })
|
|
6880
7051
|
]
|
|
6881
7052
|
}
|
|
6882
7053
|
),
|
|
6883
|
-
enableSearch && /* @__PURE__ */ (0,
|
|
7054
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6884
7055
|
Search_default,
|
|
6885
7056
|
{
|
|
6886
7057
|
value: searchQuery,
|
|
@@ -6891,11 +7062,11 @@ function TableProvider({
|
|
|
6891
7062
|
}
|
|
6892
7063
|
) })
|
|
6893
7064
|
] });
|
|
6894
|
-
const headerSection = (headerContent || controls) && /* @__PURE__ */ (0,
|
|
6895
|
-
headerContent && /* @__PURE__ */ (0,
|
|
6896
|
-
controls && /* @__PURE__ */ (0,
|
|
7065
|
+
const headerSection = (headerContent || controls) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col md:flex-row items-stretch md:items-center justify-between gap-4", children: [
|
|
7066
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: headerContent }),
|
|
7067
|
+
controls && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1 md:flex-none", children: controls })
|
|
6897
7068
|
] });
|
|
6898
|
-
const table = /* @__PURE__ */ (0,
|
|
7069
|
+
const table = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6899
7070
|
Table_default,
|
|
6900
7071
|
{
|
|
6901
7072
|
variant,
|
|
@@ -6906,11 +7077,11 @@ function TableProvider({
|
|
|
6906
7077
|
showEmpty,
|
|
6907
7078
|
emptyState,
|
|
6908
7079
|
children: [
|
|
6909
|
-
/* @__PURE__ */ (0,
|
|
7080
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6910
7081
|
TableRow,
|
|
6911
7082
|
{
|
|
6912
7083
|
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
6913
|
-
children: headers.map((header, index) => /* @__PURE__ */ (0,
|
|
7084
|
+
children: headers.map((header, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6914
7085
|
TableHead,
|
|
6915
7086
|
{
|
|
6916
7087
|
sortable: enableTableSort && header.sortable,
|
|
@@ -6924,7 +7095,7 @@ function TableProvider({
|
|
|
6924
7095
|
))
|
|
6925
7096
|
}
|
|
6926
7097
|
) }),
|
|
6927
|
-
/* @__PURE__ */ (0,
|
|
7098
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TableCell, { colSpan: headers.length, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-text-400 text-sm", children: "Carregando..." }) }) }) : displayData.map((row, rowIndex) => {
|
|
6928
7099
|
const effectiveIndex = useInternalPagination ? (currentPage - 1) * itemsPerPage + rowIndex : rowIndex;
|
|
6929
7100
|
const rowKeyValue = rowKey ? (() => {
|
|
6930
7101
|
const keyValue = row[rowKey];
|
|
@@ -6936,7 +7107,7 @@ function TableProvider({
|
|
|
6936
7107
|
}
|
|
6937
7108
|
return String(keyValue);
|
|
6938
7109
|
})() : `row-${effectiveIndex}`;
|
|
6939
|
-
return /* @__PURE__ */ (0,
|
|
7110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6940
7111
|
TableRow,
|
|
6941
7112
|
{
|
|
6942
7113
|
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
@@ -6957,7 +7128,7 @@ function TableProvider({
|
|
|
6957
7128
|
}
|
|
6958
7129
|
}
|
|
6959
7130
|
const content = header.render ? header.render(value, row, effectiveIndex) : defaultContent;
|
|
6960
|
-
return /* @__PURE__ */ (0,
|
|
7131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6961
7132
|
TableCell,
|
|
6962
7133
|
{
|
|
6963
7134
|
className: header.className,
|
|
@@ -6976,7 +7147,7 @@ function TableProvider({
|
|
|
6976
7147
|
]
|
|
6977
7148
|
}
|
|
6978
7149
|
) });
|
|
6979
|
-
const pagination = enablePagination && !isEmpty && /* @__PURE__ */ (0,
|
|
7150
|
+
const pagination = enablePagination && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6980
7151
|
TablePagination_default,
|
|
6981
7152
|
{
|
|
6982
7153
|
currentPage,
|
|
@@ -6990,13 +7161,13 @@ function TableProvider({
|
|
|
6990
7161
|
}
|
|
6991
7162
|
) });
|
|
6992
7163
|
if (children) {
|
|
6993
|
-
return /* @__PURE__ */ (0,
|
|
7164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
6994
7165
|
children({
|
|
6995
7166
|
controls: headerSection || controls || null,
|
|
6996
7167
|
table,
|
|
6997
7168
|
pagination
|
|
6998
7169
|
}),
|
|
6999
|
-
enableFilters && /* @__PURE__ */ (0,
|
|
7170
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7000
7171
|
FilterModal,
|
|
7001
7172
|
{
|
|
7002
7173
|
isOpen: isFilterModalOpen,
|
|
@@ -7010,11 +7181,11 @@ function TableProvider({
|
|
|
7010
7181
|
] });
|
|
7011
7182
|
}
|
|
7012
7183
|
const wrapperClassName = containerClassName || "w-full space-y-4";
|
|
7013
|
-
return /* @__PURE__ */ (0,
|
|
7184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: wrapperClassName, children: [
|
|
7014
7185
|
headerSection,
|
|
7015
7186
|
table,
|
|
7016
7187
|
pagination,
|
|
7017
|
-
enableFilters && /* @__PURE__ */ (0,
|
|
7188
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7018
7189
|
FilterModal,
|
|
7019
7190
|
{
|
|
7020
7191
|
isOpen: isFilterModalOpen,
|
|
@@ -7029,7 +7200,7 @@ function TableProvider({
|
|
|
7029
7200
|
}
|
|
7030
7201
|
|
|
7031
7202
|
// src/components/RecommendedLessonsHistory/config/modelsFiltersConfig.ts
|
|
7032
|
-
var
|
|
7203
|
+
var getSubjectOptions2 = (data) => {
|
|
7033
7204
|
if (!data?.subjects) return [];
|
|
7034
7205
|
return data.subjects.map((subject) => ({
|
|
7035
7206
|
id: subject.id,
|
|
@@ -7045,29 +7216,14 @@ var createGoalModelsFiltersConfig = (userData) => [
|
|
|
7045
7216
|
key: "subject",
|
|
7046
7217
|
label: "Mat\xE9ria",
|
|
7047
7218
|
selectedIds: [],
|
|
7048
|
-
itens:
|
|
7219
|
+
itens: getSubjectOptions2(userData)
|
|
7049
7220
|
}
|
|
7050
7221
|
]
|
|
7051
7222
|
}
|
|
7052
7223
|
];
|
|
7053
7224
|
|
|
7054
|
-
// src/components/RecommendedLessonsHistory/utils/filterBuilders.ts
|
|
7055
|
-
var buildGoalModelsFiltersFromParams = (params) => {
|
|
7056
|
-
const filters = {
|
|
7057
|
-
page: params.page,
|
|
7058
|
-
limit: params.limit
|
|
7059
|
-
};
|
|
7060
|
-
if (params.search) {
|
|
7061
|
-
filters.search = params.search;
|
|
7062
|
-
}
|
|
7063
|
-
if (Array.isArray(params.subject) && params.subject.length > 0) {
|
|
7064
|
-
filters.subjectId = params.subject[0];
|
|
7065
|
-
}
|
|
7066
|
-
return filters;
|
|
7067
|
-
};
|
|
7068
|
-
|
|
7069
7225
|
// src/components/RecommendedLessonsHistory/tabs/ModelsTab.tsx
|
|
7070
|
-
var
|
|
7226
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
7071
7227
|
var GOAL_MODELS_CONFIG = {
|
|
7072
7228
|
entityName: "aula",
|
|
7073
7229
|
entityNamePlural: "aulas",
|
|
@@ -7093,7 +7249,7 @@ var GoalModelsTab = ({
|
|
|
7093
7249
|
mapSubjectNameToEnum,
|
|
7094
7250
|
userFilterData,
|
|
7095
7251
|
subjectsMap
|
|
7096
|
-
}) => /* @__PURE__ */ (0,
|
|
7252
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7097
7253
|
ModelsTabBase,
|
|
7098
7254
|
{
|
|
7099
7255
|
fetchModels: fetchGoalModels,
|
|
@@ -7121,7 +7277,7 @@ var GoalModelsTab = ({
|
|
|
7121
7277
|
);
|
|
7122
7278
|
|
|
7123
7279
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
7124
|
-
var
|
|
7280
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7125
7281
|
var GoalPageTab = /* @__PURE__ */ ((GoalPageTab2) => {
|
|
7126
7282
|
GoalPageTab2["HISTORY"] = "history";
|
|
7127
7283
|
GoalPageTab2["DRAFTS"] = "drafts";
|
|
@@ -7167,7 +7323,7 @@ var getSchoolOptions = (data) => {
|
|
|
7167
7323
|
name: school.name
|
|
7168
7324
|
}));
|
|
7169
7325
|
};
|
|
7170
|
-
var
|
|
7326
|
+
var getSubjectOptions3 = (data) => {
|
|
7171
7327
|
if (!data?.subjects) return [];
|
|
7172
7328
|
return data.subjects.map((subject) => ({
|
|
7173
7329
|
id: subject.id,
|
|
@@ -7233,7 +7389,7 @@ var createGoalFiltersConfig = (userData) => [
|
|
|
7233
7389
|
key: "subject",
|
|
7234
7390
|
label: "Mat\xE9ria",
|
|
7235
7391
|
selectedIds: [],
|
|
7236
|
-
itens:
|
|
7392
|
+
itens: getSubjectOptions3(userData)
|
|
7237
7393
|
},
|
|
7238
7394
|
{
|
|
7239
7395
|
key: "theme",
|
|
@@ -7286,7 +7442,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7286
7442
|
className: "max-w-[200px] truncate",
|
|
7287
7443
|
render: (value) => {
|
|
7288
7444
|
const title = typeof value === "string" ? value : "";
|
|
7289
|
-
return /* @__PURE__ */ (0,
|
|
7445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", title, children: title });
|
|
7290
7446
|
}
|
|
7291
7447
|
},
|
|
7292
7448
|
{
|
|
@@ -7296,7 +7452,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7296
7452
|
className: "max-w-[150px] truncate",
|
|
7297
7453
|
render: (value) => {
|
|
7298
7454
|
const school = typeof value === "string" ? value : "";
|
|
7299
|
-
return /* @__PURE__ */ (0,
|
|
7455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", title: school, children: school });
|
|
7300
7456
|
}
|
|
7301
7457
|
},
|
|
7302
7458
|
{
|
|
@@ -7313,11 +7469,11 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7313
7469
|
const subjectName = typeof value === "string" ? value : "";
|
|
7314
7470
|
const subjectEnum = mapSubjectNameToEnum?.(subjectName);
|
|
7315
7471
|
if (!subjectEnum) {
|
|
7316
|
-
return /* @__PURE__ */ (0,
|
|
7472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
7317
7473
|
}
|
|
7318
7474
|
const subjectInfo = getSubjectInfo(subjectEnum);
|
|
7319
|
-
return /* @__PURE__ */ (0,
|
|
7320
|
-
/* @__PURE__ */ (0,
|
|
7475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-2", title: subjectName, children: [
|
|
7476
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7321
7477
|
"span",
|
|
7322
7478
|
{
|
|
7323
7479
|
className: cn(
|
|
@@ -7327,7 +7483,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7327
7483
|
children: subjectInfo.icon
|
|
7328
7484
|
}
|
|
7329
7485
|
),
|
|
7330
|
-
/* @__PURE__ */ (0,
|
|
7486
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", className: "truncate", children: subjectName })
|
|
7331
7487
|
] });
|
|
7332
7488
|
}
|
|
7333
7489
|
},
|
|
@@ -7343,9 +7499,9 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7343
7499
|
render: (value) => {
|
|
7344
7500
|
const status = typeof value === "string" ? value : "";
|
|
7345
7501
|
if (!status) {
|
|
7346
|
-
return /* @__PURE__ */ (0,
|
|
7502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", color: "text-text-500", children: "-" });
|
|
7347
7503
|
}
|
|
7348
|
-
return /* @__PURE__ */ (0,
|
|
7504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7349
7505
|
Badge_default,
|
|
7350
7506
|
{
|
|
7351
7507
|
variant: "solid",
|
|
@@ -7360,7 +7516,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7360
7516
|
key: "completionPercentage",
|
|
7361
7517
|
label: "Conclus\xE3o",
|
|
7362
7518
|
sortable: true,
|
|
7363
|
-
render: (value) => /* @__PURE__ */ (0,
|
|
7519
|
+
render: (value) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7364
7520
|
ProgressBar_default,
|
|
7365
7521
|
{
|
|
7366
7522
|
value: Number(value),
|
|
@@ -7386,20 +7542,20 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7386
7542
|
e.stopPropagation();
|
|
7387
7543
|
onEditGoal?.(row.id);
|
|
7388
7544
|
};
|
|
7389
|
-
return /* @__PURE__ */ (0,
|
|
7390
|
-
/* @__PURE__ */ (0,
|
|
7545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex justify-center gap-2", children: [
|
|
7546
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7391
7547
|
IconButton_default,
|
|
7392
7548
|
{
|
|
7393
|
-
icon: /* @__PURE__ */ (0,
|
|
7549
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react17.Trash, { size: 20 }),
|
|
7394
7550
|
size: "sm",
|
|
7395
7551
|
title: "Excluir",
|
|
7396
7552
|
onClick: handleDelete
|
|
7397
7553
|
}
|
|
7398
7554
|
),
|
|
7399
|
-
/* @__PURE__ */ (0,
|
|
7555
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7400
7556
|
IconButton_default,
|
|
7401
7557
|
{
|
|
7402
|
-
icon: /* @__PURE__ */ (0,
|
|
7558
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react17.PencilSimple, { size: 20 }),
|
|
7403
7559
|
size: "sm",
|
|
7404
7560
|
title: "Editar",
|
|
7405
7561
|
onClick: handleEdit
|
|
@@ -7413,7 +7569,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7413
7569
|
label: "",
|
|
7414
7570
|
sortable: false,
|
|
7415
7571
|
className: "w-12",
|
|
7416
|
-
render: () => /* @__PURE__ */ (0,
|
|
7572
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react17.CaretRight, { size: 20, className: "text-text-600" }) })
|
|
7417
7573
|
}
|
|
7418
7574
|
];
|
|
7419
7575
|
var RecommendedLessonsHistory = ({
|
|
@@ -7435,18 +7591,22 @@ var RecommendedLessonsHistory = ({
|
|
|
7435
7591
|
onSendLesson,
|
|
7436
7592
|
onEditModel,
|
|
7437
7593
|
subjectsMap,
|
|
7594
|
+
fetchGoalDrafts,
|
|
7595
|
+
deleteGoalDraft,
|
|
7596
|
+
onSendDraft,
|
|
7597
|
+
onEditDraft,
|
|
7438
7598
|
defaultTab,
|
|
7439
7599
|
onTabChange
|
|
7440
7600
|
}) => {
|
|
7441
|
-
const [activeTab, setActiveTab] = (0,
|
|
7601
|
+
const [activeTab, setActiveTab] = (0, import_react24.useState)(
|
|
7442
7602
|
defaultTab ?? "history" /* HISTORY */
|
|
7443
7603
|
);
|
|
7444
|
-
(0,
|
|
7604
|
+
(0, import_react24.useEffect)(() => {
|
|
7445
7605
|
if (defaultTab !== void 0) {
|
|
7446
7606
|
setActiveTab(defaultTab);
|
|
7447
7607
|
}
|
|
7448
7608
|
}, [defaultTab]);
|
|
7449
|
-
const handleTabChange = (0,
|
|
7609
|
+
const handleTabChange = (0, import_react24.useCallback)(
|
|
7450
7610
|
(value) => {
|
|
7451
7611
|
const newTab = value;
|
|
7452
7612
|
setActiveTab(newTab);
|
|
@@ -7454,9 +7614,9 @@ var RecommendedLessonsHistory = ({
|
|
|
7454
7614
|
},
|
|
7455
7615
|
[onTabChange]
|
|
7456
7616
|
);
|
|
7457
|
-
const fetchGoalsHistoryRef = (0,
|
|
7617
|
+
const fetchGoalsHistoryRef = (0, import_react24.useRef)(fetchGoalsHistory);
|
|
7458
7618
|
fetchGoalsHistoryRef.current = fetchGoalsHistory;
|
|
7459
|
-
const useGoalsHistory = (0,
|
|
7619
|
+
const useGoalsHistory = (0, import_react24.useMemo)(
|
|
7460
7620
|
() => createUseRecommendedLessonsHistory(
|
|
7461
7621
|
(filters) => fetchGoalsHistoryRef.current(filters)
|
|
7462
7622
|
),
|
|
@@ -7469,31 +7629,31 @@ var RecommendedLessonsHistory = ({
|
|
|
7469
7629
|
pagination,
|
|
7470
7630
|
fetchGoals
|
|
7471
7631
|
} = useGoalsHistory();
|
|
7472
|
-
const initialFilterConfigs = (0,
|
|
7632
|
+
const initialFilterConfigs = (0, import_react24.useMemo)(
|
|
7473
7633
|
() => createGoalFiltersConfig(userFilterData),
|
|
7474
7634
|
[userFilterData]
|
|
7475
7635
|
);
|
|
7476
|
-
const tableColumns = (0,
|
|
7636
|
+
const tableColumns = (0, import_react24.useMemo)(
|
|
7477
7637
|
() => createTableColumns(mapSubjectNameToEnum, onDeleteGoal, onEditGoal),
|
|
7478
7638
|
[mapSubjectNameToEnum, onDeleteGoal, onEditGoal]
|
|
7479
7639
|
);
|
|
7480
|
-
const handleParamsChange = (0,
|
|
7640
|
+
const handleParamsChange = (0, import_react24.useCallback)(
|
|
7481
7641
|
(params) => {
|
|
7482
7642
|
const filters = buildFiltersFromParams(params);
|
|
7483
7643
|
fetchGoals(filters);
|
|
7484
7644
|
},
|
|
7485
7645
|
[fetchGoals]
|
|
7486
7646
|
);
|
|
7487
|
-
return /* @__PURE__ */ (0,
|
|
7647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7488
7648
|
"div",
|
|
7489
7649
|
{
|
|
7490
7650
|
"data-testid": "recommended-lessons-history",
|
|
7491
7651
|
className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
|
|
7492
7652
|
children: [
|
|
7493
|
-
/* @__PURE__ */ (0,
|
|
7494
|
-
/* @__PURE__ */ (0,
|
|
7495
|
-
/* @__PURE__ */ (0,
|
|
7496
|
-
/* @__PURE__ */ (0,
|
|
7653
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
|
|
7654
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.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: [
|
|
7655
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.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: [
|
|
7656
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7497
7657
|
Text_default,
|
|
7498
7658
|
{
|
|
7499
7659
|
as: "h1",
|
|
@@ -7502,7 +7662,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7502
7662
|
children: title
|
|
7503
7663
|
}
|
|
7504
7664
|
),
|
|
7505
|
-
/* @__PURE__ */ (0,
|
|
7665
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7506
7666
|
Menu,
|
|
7507
7667
|
{
|
|
7508
7668
|
defaultValue: "history" /* HISTORY */,
|
|
@@ -7510,13 +7670,13 @@ var RecommendedLessonsHistory = ({
|
|
|
7510
7670
|
onValueChange: handleTabChange,
|
|
7511
7671
|
variant: "menu2",
|
|
7512
7672
|
className: "bg-transparent shadow-none px-0",
|
|
7513
|
-
children: /* @__PURE__ */ (0,
|
|
7673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7514
7674
|
MenuContent,
|
|
7515
7675
|
{
|
|
7516
7676
|
variant: "menu2",
|
|
7517
7677
|
className: "w-full lg:w-auto max-w-full min-w-0",
|
|
7518
7678
|
children: [
|
|
7519
|
-
/* @__PURE__ */ (0,
|
|
7679
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7520
7680
|
MenuItem,
|
|
7521
7681
|
{
|
|
7522
7682
|
variant: "menu2",
|
|
@@ -7526,7 +7686,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7526
7686
|
children: "Hist\xF3rico"
|
|
7527
7687
|
}
|
|
7528
7688
|
),
|
|
7529
|
-
/* @__PURE__ */ (0,
|
|
7689
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7530
7690
|
MenuItem,
|
|
7531
7691
|
{
|
|
7532
7692
|
variant: "menu2",
|
|
@@ -7536,7 +7696,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7536
7696
|
children: "Rascunhos"
|
|
7537
7697
|
}
|
|
7538
7698
|
),
|
|
7539
|
-
/* @__PURE__ */ (0,
|
|
7699
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7540
7700
|
MenuItem,
|
|
7541
7701
|
{
|
|
7542
7702
|
variant: "menu2",
|
|
@@ -7552,8 +7712,8 @@ var RecommendedLessonsHistory = ({
|
|
|
7552
7712
|
}
|
|
7553
7713
|
) })
|
|
7554
7714
|
] }),
|
|
7555
|
-
/* @__PURE__ */ (0,
|
|
7556
|
-
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0,
|
|
7715
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
|
|
7716
|
+
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children: error ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "lg", color: "text-error-500", children: error }) }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7557
7717
|
TableProvider,
|
|
7558
7718
|
{
|
|
7559
7719
|
data: goals,
|
|
@@ -7578,14 +7738,14 @@ var RecommendedLessonsHistory = ({
|
|
|
7578
7738
|
image: noSearchImage
|
|
7579
7739
|
},
|
|
7580
7740
|
emptyState: {
|
|
7581
|
-
component: /* @__PURE__ */ (0,
|
|
7741
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7582
7742
|
EmptyState_default,
|
|
7583
7743
|
{
|
|
7584
7744
|
image: emptyStateImage,
|
|
7585
7745
|
title: "Crie uma nova aula",
|
|
7586
7746
|
description: "Selecione um conjunto de aulas organizadas por tema e ajude seus alunos a estudarem de forma estruturada e eficiente!",
|
|
7587
7747
|
buttonText: createButtonText,
|
|
7588
|
-
buttonIcon: /* @__PURE__ */ (0,
|
|
7748
|
+
buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react17.Plus, { size: 18 }),
|
|
7589
7749
|
buttonVariant: "outline",
|
|
7590
7750
|
buttonAction: "primary",
|
|
7591
7751
|
onButtonClick: onCreateLesson
|
|
@@ -7600,22 +7760,22 @@ var RecommendedLessonsHistory = ({
|
|
|
7600
7760
|
table,
|
|
7601
7761
|
pagination: paginationComponent
|
|
7602
7762
|
} = renderProps;
|
|
7603
|
-
return /* @__PURE__ */ (0,
|
|
7604
|
-
/* @__PURE__ */ (0,
|
|
7605
|
-
/* @__PURE__ */ (0,
|
|
7763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "space-y-4", children: [
|
|
7764
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
7765
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7606
7766
|
Button_default,
|
|
7607
7767
|
{
|
|
7608
7768
|
variant: "solid",
|
|
7609
7769
|
action: "primary",
|
|
7610
7770
|
size: "medium",
|
|
7611
7771
|
onClick: onCreateLesson,
|
|
7612
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
7772
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react17.Plus, { size: 18, weight: "bold" }),
|
|
7613
7773
|
children: createButtonText
|
|
7614
7774
|
}
|
|
7615
7775
|
),
|
|
7616
7776
|
controls
|
|
7617
7777
|
] }),
|
|
7618
|
-
/* @__PURE__ */ (0,
|
|
7778
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
|
|
7619
7779
|
table,
|
|
7620
7780
|
paginationComponent
|
|
7621
7781
|
] })
|
|
@@ -7623,8 +7783,22 @@ var RecommendedLessonsHistory = ({
|
|
|
7623
7783
|
}
|
|
7624
7784
|
}
|
|
7625
7785
|
) }) }),
|
|
7626
|
-
activeTab === "drafts" /* DRAFTS */ &&
|
|
7627
|
-
|
|
7786
|
+
activeTab === "drafts" /* DRAFTS */ && fetchGoalDrafts && deleteGoalDraft && onCreateLesson && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7787
|
+
GoalDraftsTab,
|
|
7788
|
+
{
|
|
7789
|
+
fetchGoalDrafts,
|
|
7790
|
+
deleteGoalDraft,
|
|
7791
|
+
onCreateDraft: onCreateLesson,
|
|
7792
|
+
onSendDraft,
|
|
7793
|
+
onEditDraft,
|
|
7794
|
+
emptyStateImage,
|
|
7795
|
+
noSearchImage,
|
|
7796
|
+
mapSubjectNameToEnum,
|
|
7797
|
+
userFilterData,
|
|
7798
|
+
subjectsMap
|
|
7799
|
+
}
|
|
7800
|
+
),
|
|
7801
|
+
activeTab === "models" /* MODELS */ && fetchGoalModels && deleteGoalModel && onCreateModel && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7628
7802
|
GoalModelsTab,
|
|
7629
7803
|
{
|
|
7630
7804
|
fetchGoalModels,
|