analytica-frontend-lib 1.2.84 → 1.2.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  // src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
2
- import { useState as useState16, useCallback as useCallback6, useMemo as useMemo7, useRef as useRef8, useEffect as useEffect16 } from "react";
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 useState15, useEffect as useEffect15, useMemo as useMemo6, useCallback as useCallback5 } from "react";
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 useState14 } from "react";
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 {
@@ -5917,13 +5917,90 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
5917
5917
  };
5918
5918
  };
5919
5919
 
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
+ };
5993
+ };
5994
+
5995
+ // src/components/shared/ModelsTabBase/ModelsTabBase.tsx
5996
+ import { useState as useState14, useCallback as useCallback5, useMemo as useMemo4, useRef as useRef6, useEffect as useEffect13 } from "react";
5997
+ import { Plus } from "phosphor-react";
5998
+
5920
5999
  // src/components/ActivitiesHistory/components/ErrorDisplay.tsx
5921
6000
  import { jsx as jsx35 } from "react/jsx-runtime";
5922
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 }) });
5923
6002
 
5924
6003
  // src/components/shared/ModelsTabBase/ModelsTabBase.tsx
5925
- import { useState as useState13, useCallback as useCallback4, useMemo as useMemo4, useRef as useRef6, useEffect as useEffect13 } from "react";
5926
- import { Plus } from "phosphor-react";
5927
6004
  import { Fragment as Fragment7, jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
5928
6005
  var ModelsTabBase = ({
5929
6006
  fetchModels: fetchModelsProp,
@@ -5942,8 +6019,8 @@ var ModelsTabBase = ({
5942
6019
  buildFiltersFromParams: buildFiltersFromParams2,
5943
6020
  createUseModels
5944
6021
  }) => {
5945
- const [deleteDialogOpen, setDeleteDialogOpen] = useState13(false);
5946
- const [modelToDelete, setModelToDelete] = useState13(null);
6022
+ const [deleteDialogOpen, setDeleteDialogOpen] = useState14(false);
6023
+ const [modelToDelete, setModelToDelete] = useState14(null);
5947
6024
  const { addToast } = useToast();
5948
6025
  const fetchModelsRef = useRef6(fetchModelsProp);
5949
6026
  fetchModelsRef.current = fetchModelsProp;
@@ -5970,7 +6047,7 @@ var ModelsTabBase = ({
5970
6047
  () => createFiltersConfig(userFilterData),
5971
6048
  [createFiltersConfig, userFilterData]
5972
6049
  );
5973
- const handleDeleteClick = useCallback4((model) => {
6050
+ const handleDeleteClick = useCallback5((model) => {
5974
6051
  setModelToDelete(model);
5975
6052
  setDeleteDialogOpen(true);
5976
6053
  }, []);
@@ -5989,7 +6066,7 @@ var ModelsTabBase = ({
5989
6066
  handleDeleteClick
5990
6067
  ]
5991
6068
  );
5992
- const handleParamsChange = useCallback4(
6069
+ const handleParamsChange = useCallback5(
5993
6070
  (params) => {
5994
6071
  const filters = buildFiltersFromParams2(params);
5995
6072
  fetchModels(filters, subjectsMapRef.current);
@@ -5999,7 +6076,7 @@ var ModelsTabBase = ({
5999
6076
  useEffect13(() => {
6000
6077
  fetchModels({ page: 1, limit: 10 }, subjectsMapRef.current);
6001
6078
  }, [fetchModels]);
6002
- const handleConfirmDelete = useCallback4(async () => {
6079
+ const handleConfirmDelete = useCallback5(async () => {
6003
6080
  if (modelToDelete) {
6004
6081
  const success = await deleteModel(modelToDelete.id);
6005
6082
  if (success) {
@@ -6012,7 +6089,7 @@ var ModelsTabBase = ({
6012
6089
  setDeleteDialogOpen(false);
6013
6090
  setModelToDelete(null);
6014
6091
  }, [modelToDelete, deleteModel, fetchModels, addToast]);
6015
- const handleCancelDelete = useCallback4(() => {
6092
+ const handleCancelDelete = useCallback5(() => {
6016
6093
  setDeleteDialogOpen(false);
6017
6094
  setModelToDelete(null);
6018
6095
  }, []);
@@ -6102,6 +6179,98 @@ var ModelsTabBase = ({
6102
6179
  ] });
6103
6180
  };
6104
6181
 
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) => [
6191
+ {
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
+ ]
6202
+ }
6203
+ ];
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
+
6105
6274
  // src/components/CheckBoxGroup/CheckBoxGroup.helpers.ts
6106
6275
  var areSelectedIdsEqual = (ids1, ids2) => {
6107
6276
  if (ids1 === ids2) return true;
@@ -6184,7 +6353,7 @@ var calculateFormattedItemsForAutoSelection = (category, allCategories) => {
6184
6353
  };
6185
6354
 
6186
6355
  // src/components/CheckBoxGroup/CheckBoxGroup.tsx
6187
- import { jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
6356
+ import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
6188
6357
  var CheckboxGroup = ({
6189
6358
  categories,
6190
6359
  onCategoriesChange,
@@ -6192,7 +6361,7 @@ var CheckboxGroup = ({
6192
6361
  showDivider = true,
6193
6362
  showSingleItem = false
6194
6363
  }) => {
6195
- const [openAccordion, setOpenAccordion] = useState14("");
6364
+ const [openAccordion, setOpenAccordion] = useState15("");
6196
6365
  const onCategoriesChangeRef = useRef7(onCategoriesChange);
6197
6366
  const previousCategoriesRef = useRef7(categories);
6198
6367
  const appliedAutoSelectionRef = useRef7("");
@@ -6492,7 +6661,7 @@ var CheckboxGroup = ({
6492
6661
  const renderCheckboxItem = (item, categoryKey) => {
6493
6662
  const uniqueId = `${categoryKey}-${item.id}`;
6494
6663
  return /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-3 px-2", children: [
6495
- /* @__PURE__ */ jsx37(
6664
+ /* @__PURE__ */ jsx38(
6496
6665
  CheckBox_default,
6497
6666
  {
6498
6667
  id: uniqueId,
@@ -6500,7 +6669,7 @@ var CheckboxGroup = ({
6500
6669
  onChange: () => toggleItem(categoryKey, item.id)
6501
6670
  }
6502
6671
  ),
6503
- /* @__PURE__ */ jsx37(
6672
+ /* @__PURE__ */ jsx38(
6504
6673
  "label",
6505
6674
  {
6506
6675
  htmlFor: uniqueId,
@@ -6515,7 +6684,7 @@ var CheckboxGroup = ({
6515
6684
  {
6516
6685
  className: "flex flex-col gap-3",
6517
6686
  children: [
6518
- "groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ jsx37(Text_default, { size: "sm", className: "mt-2", weight: "semibold", children: formattedGroup.groupLabel }),
6687
+ "groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ jsx38(Text_default, { size: "sm", className: "mt-2", weight: "semibold", children: formattedGroup.groupLabel }),
6519
6688
  formattedGroup.itens?.map(
6520
6689
  (item) => renderCheckboxItem(item, categoryKey)
6521
6690
  )
@@ -6525,7 +6694,7 @@ var CheckboxGroup = ({
6525
6694
  );
6526
6695
  const renderAccordionTrigger = (category, isEnabled) => /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between w-full p-2", children: [
6527
6696
  /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-3", children: [
6528
- /* @__PURE__ */ jsx37(
6697
+ /* @__PURE__ */ jsx38(
6529
6698
  CheckBox_default,
6530
6699
  {
6531
6700
  checked: isMinimalOneCheckBoxIsSelected(category.key),
@@ -6534,7 +6703,7 @@ var CheckboxGroup = ({
6534
6703
  onChange: () => toggleAllInCategory(category.key)
6535
6704
  }
6536
6705
  ),
6537
- /* @__PURE__ */ jsx37(
6706
+ /* @__PURE__ */ jsx38(
6538
6707
  Text_default,
6539
6708
  {
6540
6709
  size: "sm",
@@ -6544,7 +6713,7 @@ var CheckboxGroup = ({
6544
6713
  }
6545
6714
  )
6546
6715
  ] }),
6547
- (openAccordion === category.key || isEnabled) && /* @__PURE__ */ jsx37(Badge_default, { variant: "solid", action: "info", children: getBadgeText2(category) })
6716
+ (openAccordion === category.key || isEnabled) && /* @__PURE__ */ jsx38(Badge_default, { variant: "solid", action: "info", children: getBadgeText2(category) })
6548
6717
  ] });
6549
6718
  const renderCompactSingleItem = (category) => {
6550
6719
  const formattedItems = getFormattedItems(category.key);
@@ -6558,8 +6727,8 @@ var CheckboxGroup = ({
6558
6727
  {
6559
6728
  className: "flex items-center justify-between w-full px-3 py-2",
6560
6729
  children: [
6561
- /* @__PURE__ */ jsx37(Text_default, { size: "sm", weight: "bold", className: "text-text-800", children: category.label }),
6562
- /* @__PURE__ */ jsx37(Text_default, { size: "sm", className: "text-text-950", children: singleItem.name })
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 })
6563
6732
  ]
6564
6733
  },
6565
6734
  category.key
@@ -6577,14 +6746,14 @@ var CheckboxGroup = ({
6577
6746
  if (compactSingleItem && hasOnlyOneAvailableItem && isEnabled) {
6578
6747
  return /* @__PURE__ */ jsxs25("div", { children: [
6579
6748
  renderCompactSingleItem(category),
6580
- showDivider && /* @__PURE__ */ jsx37(Divider_default, {})
6749
+ showDivider && /* @__PURE__ */ jsx38(Divider_default, {})
6581
6750
  ] }, category.key);
6582
6751
  }
6583
6752
  const hasNoItems = formattedItems.every(
6584
6753
  (group) => !group.itens || group.itens.length === 0
6585
6754
  );
6586
6755
  return /* @__PURE__ */ jsxs25("div", { children: [
6587
- /* @__PURE__ */ jsx37(
6756
+ /* @__PURE__ */ jsx38(
6588
6757
  CardAccordation,
6589
6758
  {
6590
6759
  value: category.key,
@@ -6594,12 +6763,12 @@ var CheckboxGroup = ({
6594
6763
  openAccordion === category.key && "bg-background-50 border-none"
6595
6764
  ),
6596
6765
  trigger: renderAccordionTrigger(category, isEnabled),
6597
- children: /* @__PURE__ */ jsx37("div", { className: "flex flex-col gap-3 pt-2", children: hasNoItems && isEnabled ? /* @__PURE__ */ jsx37("div", { className: "px-2 py-4", children: /* @__PURE__ */ jsx37(Text_default, { size: "sm", className: "text-text-500 text-center", children: "Sem dados" }) }) : formattedItems.map(
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(
6598
6767
  (formattedGroup, idx) => renderFormattedGroup(formattedGroup, idx, category.key)
6599
6768
  ) })
6600
6769
  }
6601
6770
  ),
6602
- openAccordion !== category.key && showDivider && /* @__PURE__ */ jsx37(Divider_default, {})
6771
+ openAccordion !== category.key && showDivider && /* @__PURE__ */ jsx38(Divider_default, {})
6603
6772
  ] }, category.key);
6604
6773
  };
6605
6774
  useEffect14(() => {
@@ -6613,7 +6782,7 @@ var CheckboxGroup = ({
6613
6782
  }, 0);
6614
6783
  }
6615
6784
  }, [categories, openAccordion]);
6616
- return /* @__PURE__ */ jsx37(
6785
+ return /* @__PURE__ */ jsx38(
6617
6786
  AccordionGroup,
6618
6787
  {
6619
6788
  type: "single",
@@ -6626,7 +6795,7 @@ var CheckboxGroup = ({
6626
6795
  };
6627
6796
 
6628
6797
  // src/components/Filter/FilterModal.tsx
6629
- import { jsx as jsx38, jsxs as jsxs26 } from "react/jsx-runtime";
6798
+ import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
6630
6799
  var FilterModal = ({
6631
6800
  isOpen,
6632
6801
  onClose,
@@ -6654,7 +6823,7 @@ var FilterModal = ({
6654
6823
  const handleClear = () => {
6655
6824
  onClear();
6656
6825
  };
6657
- return /* @__PURE__ */ jsx38(
6826
+ return /* @__PURE__ */ jsx39(
6658
6827
  Modal_default,
6659
6828
  {
6660
6829
  isOpen,
@@ -6662,10 +6831,10 @@ var FilterModal = ({
6662
6831
  title,
6663
6832
  size,
6664
6833
  footer: /* @__PURE__ */ jsxs26("div", { className: "flex gap-3 justify-end w-full", children: [
6665
- /* @__PURE__ */ jsx38(Button_default, { variant: "outline", onClick: handleClear, children: clearLabel }),
6666
- /* @__PURE__ */ jsx38(Button_default, { onClick: handleApply, children: applyLabel })
6834
+ /* @__PURE__ */ jsx39(Button_default, { variant: "outline", onClick: handleClear, children: clearLabel }),
6835
+ /* @__PURE__ */ jsx39(Button_default, { onClick: handleApply, children: applyLabel })
6667
6836
  ] }),
6668
- children: /* @__PURE__ */ jsx38("div", { className: "flex flex-col gap-6", children: filterConfigs.map((config, index) => /* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-4", children: [
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: [
6669
6838
  /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2 text-text-400 text-sm font-medium uppercase", children: [
6670
6839
  config.key === "academic" && /* @__PURE__ */ jsxs26(
6671
6840
  "svg",
@@ -6677,7 +6846,7 @@ var FilterModal = ({
6677
6846
  xmlns: "http://www.w3.org/2000/svg",
6678
6847
  className: "text-text-400",
6679
6848
  children: [
6680
- /* @__PURE__ */ jsx38(
6849
+ /* @__PURE__ */ jsx39(
6681
6850
  "path",
6682
6851
  {
6683
6852
  d: "M8 2L2 5.33333L8 8.66667L14 5.33333L8 2Z",
@@ -6687,7 +6856,7 @@ var FilterModal = ({
6687
6856
  strokeLinejoin: "round"
6688
6857
  }
6689
6858
  ),
6690
- /* @__PURE__ */ jsx38(
6859
+ /* @__PURE__ */ jsx39(
6691
6860
  "path",
6692
6861
  {
6693
6862
  d: "M2 10.6667L8 14L14 10.6667",
@@ -6697,7 +6866,7 @@ var FilterModal = ({
6697
6866
  strokeLinejoin: "round"
6698
6867
  }
6699
6868
  ),
6700
- /* @__PURE__ */ jsx38(
6869
+ /* @__PURE__ */ jsx39(
6701
6870
  "path",
6702
6871
  {
6703
6872
  d: "M2 8L8 11.3333L14 8",
@@ -6720,7 +6889,7 @@ var FilterModal = ({
6720
6889
  xmlns: "http://www.w3.org/2000/svg",
6721
6890
  className: "text-text-400",
6722
6891
  children: [
6723
- /* @__PURE__ */ jsx38(
6892
+ /* @__PURE__ */ jsx39(
6724
6893
  "path",
6725
6894
  {
6726
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",
@@ -6730,7 +6899,7 @@ var FilterModal = ({
6730
6899
  strokeLinejoin: "round"
6731
6900
  }
6732
6901
  ),
6733
- /* @__PURE__ */ jsx38(
6902
+ /* @__PURE__ */ jsx39(
6734
6903
  "path",
6735
6904
  {
6736
6905
  d: "M2 6H14",
@@ -6740,7 +6909,7 @@ var FilterModal = ({
6740
6909
  strokeLinejoin: "round"
6741
6910
  }
6742
6911
  ),
6743
- /* @__PURE__ */ jsx38(
6912
+ /* @__PURE__ */ jsx39(
6744
6913
  "path",
6745
6914
  {
6746
6915
  d: "M6 2V14",
@@ -6753,9 +6922,9 @@ var FilterModal = ({
6753
6922
  ]
6754
6923
  }
6755
6924
  ),
6756
- /* @__PURE__ */ jsx38("span", { children: config.label })
6925
+ /* @__PURE__ */ jsx39("span", { children: config.label })
6757
6926
  ] }),
6758
- /* @__PURE__ */ jsx38(
6927
+ /* @__PURE__ */ jsx39(
6759
6928
  CheckboxGroup,
6760
6929
  {
6761
6930
  categories: config.categories,
@@ -6769,7 +6938,7 @@ var FilterModal = ({
6769
6938
 
6770
6939
  // src/components/TableProvider/TableProvider.tsx
6771
6940
  import { Funnel } from "phosphor-react";
6772
- import { Fragment as Fragment8, jsx as jsx39, jsxs as jsxs27 } from "react/jsx-runtime";
6941
+ import { Fragment as Fragment8, jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
6773
6942
  function TableProvider({
6774
6943
  data,
6775
6944
  headers,
@@ -6793,7 +6962,7 @@ function TableProvider({
6793
6962
  containerClassName,
6794
6963
  children
6795
6964
  }) {
6796
- const [searchQuery, setSearchQuery] = useState15("");
6965
+ const [searchQuery, setSearchQuery] = useState16("");
6797
6966
  const sortResultRaw = useTableSort(data, { syncWithUrl: true });
6798
6967
  const sortResult = enableTableSort ? sortResultRaw : {
6799
6968
  sortedData: data,
@@ -6834,9 +7003,9 @@ function TableProvider({
6834
7003
  totalItems,
6835
7004
  totalPages
6836
7005
  } = paginationConfig;
6837
- const [currentPage, setCurrentPage] = useState15(1);
6838
- const [itemsPerPage, setItemsPerPage] = useState15(defaultItemsPerPage);
6839
- const [isFilterModalOpen, setIsFilterModalOpen] = useState15(false);
7006
+ const [currentPage, setCurrentPage] = useState16(1);
7007
+ const [itemsPerPage, setItemsPerPage] = useState16(defaultItemsPerPage);
7008
+ const [isFilterModalOpen, setIsFilterModalOpen] = useState16(false);
6840
7009
  const combinedParams = useMemo6(() => {
6841
7010
  const params = {
6842
7011
  page: currentPage,
@@ -6867,23 +7036,23 @@ function TableProvider({
6867
7036
  useEffect15(() => {
6868
7037
  onParamsChange?.(combinedParams);
6869
7038
  }, [combinedParams]);
6870
- const handleSearchChange = useCallback5((value) => {
7039
+ const handleSearchChange = useCallback6((value) => {
6871
7040
  setSearchQuery(value);
6872
7041
  setCurrentPage(1);
6873
7042
  }, []);
6874
- const handleFilterApply = useCallback5(() => {
7043
+ const handleFilterApply = useCallback6(() => {
6875
7044
  applyFilters();
6876
7045
  setIsFilterModalOpen(false);
6877
7046
  setCurrentPage(1);
6878
7047
  }, [applyFilters]);
6879
- const handlePageChange = useCallback5((page) => {
7048
+ const handlePageChange = useCallback6((page) => {
6880
7049
  setCurrentPage(page);
6881
7050
  }, []);
6882
- const handleItemsPerPageChange = useCallback5((items) => {
7051
+ const handleItemsPerPageChange = useCallback6((items) => {
6883
7052
  setItemsPerPage(items);
6884
7053
  setCurrentPage(1);
6885
7054
  }, []);
6886
- const handleRowClickInternal = useCallback5(
7055
+ const handleRowClickInternal = useCallback6(
6887
7056
  (row, index) => {
6888
7057
  if (enableRowClick && onRowClick) {
6889
7058
  onRowClick(row, index);
@@ -6918,13 +7087,13 @@ function TableProvider({
6918
7087
  size: "medium",
6919
7088
  onClick: () => setIsFilterModalOpen(true),
6920
7089
  children: [
6921
- /* @__PURE__ */ jsx39(Funnel, { size: 20 }),
7090
+ /* @__PURE__ */ jsx40(Funnel, { size: 20 }),
6922
7091
  "Filtros",
6923
- hasActiveFilters && /* @__PURE__ */ jsx39("span", { className: "ml-2 rounded-full bg-primary-500 px-2 py-0.5 text-xs text-white", children: Object.keys(activeFilters).length })
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 })
6924
7093
  ]
6925
7094
  }
6926
7095
  ),
6927
- enableSearch && /* @__PURE__ */ jsx39("div", { className: "flex-1", children: /* @__PURE__ */ jsx39(
7096
+ enableSearch && /* @__PURE__ */ jsx40("div", { className: "flex-1", children: /* @__PURE__ */ jsx40(
6928
7097
  Search_default,
6929
7098
  {
6930
7099
  value: searchQuery,
@@ -6936,10 +7105,10 @@ function TableProvider({
6936
7105
  ) })
6937
7106
  ] });
6938
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: [
6939
- headerContent && /* @__PURE__ */ jsx39("div", { children: headerContent }),
6940
- controls && /* @__PURE__ */ jsx39("div", { className: "flex-1 md:flex-none", children: controls })
7108
+ headerContent && /* @__PURE__ */ jsx40("div", { children: headerContent }),
7109
+ controls && /* @__PURE__ */ jsx40("div", { className: "flex-1 md:flex-none", children: controls })
6941
7110
  ] });
6942
- const table = /* @__PURE__ */ jsx39("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsxs27(
7111
+ const table = /* @__PURE__ */ jsx40("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsxs27(
6943
7112
  Table_default,
6944
7113
  {
6945
7114
  variant,
@@ -6950,11 +7119,11 @@ function TableProvider({
6950
7119
  showEmpty,
6951
7120
  emptyState,
6952
7121
  children: [
6953
- /* @__PURE__ */ jsx39("thead", { children: /* @__PURE__ */ jsx39(
7122
+ /* @__PURE__ */ jsx40("thead", { children: /* @__PURE__ */ jsx40(
6954
7123
  TableRow,
6955
7124
  {
6956
7125
  variant: variant === "borderless" ? "defaultBorderless" : "default",
6957
- children: headers.map((header, index) => /* @__PURE__ */ jsx39(
7126
+ children: headers.map((header, index) => /* @__PURE__ */ jsx40(
6958
7127
  TableHead,
6959
7128
  {
6960
7129
  sortable: enableTableSort && header.sortable,
@@ -6968,7 +7137,7 @@ function TableProvider({
6968
7137
  ))
6969
7138
  }
6970
7139
  ) }),
6971
- /* @__PURE__ */ jsx39(TableBody, { children: loading ? /* @__PURE__ */ jsx39(TableRow, { children: /* @__PURE__ */ jsx39(TableCell, { colSpan: headers.length, className: "text-center py-8", children: /* @__PURE__ */ jsx39("span", { className: "text-text-400 text-sm", children: "Carregando..." }) }) }) : displayData.map((row, rowIndex) => {
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) => {
6972
7141
  const effectiveIndex = useInternalPagination ? (currentPage - 1) * itemsPerPage + rowIndex : rowIndex;
6973
7142
  const rowKeyValue = rowKey ? (() => {
6974
7143
  const keyValue = row[rowKey];
@@ -6980,7 +7149,7 @@ function TableProvider({
6980
7149
  }
6981
7150
  return String(keyValue);
6982
7151
  })() : `row-${effectiveIndex}`;
6983
- return /* @__PURE__ */ jsx39(
7152
+ return /* @__PURE__ */ jsx40(
6984
7153
  TableRow,
6985
7154
  {
6986
7155
  variant: variant === "borderless" ? "defaultBorderless" : "default",
@@ -7001,7 +7170,7 @@ function TableProvider({
7001
7170
  }
7002
7171
  }
7003
7172
  const content = header.render ? header.render(value, row, effectiveIndex) : defaultContent;
7004
- return /* @__PURE__ */ jsx39(
7173
+ return /* @__PURE__ */ jsx40(
7005
7174
  TableCell,
7006
7175
  {
7007
7176
  className: header.className,
@@ -7020,7 +7189,7 @@ function TableProvider({
7020
7189
  ]
7021
7190
  }
7022
7191
  ) });
7023
- const pagination = enablePagination && !isEmpty && /* @__PURE__ */ jsx39("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx39(
7192
+ const pagination = enablePagination && !isEmpty && /* @__PURE__ */ jsx40("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx40(
7024
7193
  TablePagination_default,
7025
7194
  {
7026
7195
  currentPage,
@@ -7040,7 +7209,7 @@ function TableProvider({
7040
7209
  table,
7041
7210
  pagination
7042
7211
  }),
7043
- enableFilters && /* @__PURE__ */ jsx39(
7212
+ enableFilters && /* @__PURE__ */ jsx40(
7044
7213
  FilterModal,
7045
7214
  {
7046
7215
  isOpen: isFilterModalOpen,
@@ -7058,7 +7227,7 @@ function TableProvider({
7058
7227
  headerSection,
7059
7228
  table,
7060
7229
  pagination,
7061
- enableFilters && /* @__PURE__ */ jsx39(
7230
+ enableFilters && /* @__PURE__ */ jsx40(
7062
7231
  FilterModal,
7063
7232
  {
7064
7233
  isOpen: isFilterModalOpen,
@@ -7073,7 +7242,7 @@ function TableProvider({
7073
7242
  }
7074
7243
 
7075
7244
  // src/components/RecommendedLessonsHistory/config/modelsFiltersConfig.ts
7076
- var getSubjectOptions = (data) => {
7245
+ var getSubjectOptions2 = (data) => {
7077
7246
  if (!data?.subjects) return [];
7078
7247
  return data.subjects.map((subject) => ({
7079
7248
  id: subject.id,
@@ -7089,29 +7258,14 @@ var createGoalModelsFiltersConfig = (userData) => [
7089
7258
  key: "subject",
7090
7259
  label: "Mat\xE9ria",
7091
7260
  selectedIds: [],
7092
- itens: getSubjectOptions(userData)
7261
+ itens: getSubjectOptions2(userData)
7093
7262
  }
7094
7263
  ]
7095
7264
  }
7096
7265
  ];
7097
7266
 
7098
- // src/components/RecommendedLessonsHistory/utils/filterBuilders.ts
7099
- var buildGoalModelsFiltersFromParams = (params) => {
7100
- const filters = {
7101
- page: params.page,
7102
- limit: params.limit
7103
- };
7104
- if (params.search) {
7105
- filters.search = params.search;
7106
- }
7107
- if (Array.isArray(params.subject) && params.subject.length > 0) {
7108
- filters.subjectId = params.subject[0];
7109
- }
7110
- return filters;
7111
- };
7112
-
7113
7267
  // src/components/RecommendedLessonsHistory/tabs/ModelsTab.tsx
7114
- import { jsx as jsx40 } from "react/jsx-runtime";
7268
+ import { jsx as jsx41 } from "react/jsx-runtime";
7115
7269
  var GOAL_MODELS_CONFIG = {
7116
7270
  entityName: "aula",
7117
7271
  entityNamePlural: "aulas",
@@ -7137,7 +7291,7 @@ var GoalModelsTab = ({
7137
7291
  mapSubjectNameToEnum,
7138
7292
  userFilterData,
7139
7293
  subjectsMap
7140
- }) => /* @__PURE__ */ jsx40(
7294
+ }) => /* @__PURE__ */ jsx41(
7141
7295
  ModelsTabBase,
7142
7296
  {
7143
7297
  fetchModels: fetchGoalModels,
@@ -7165,7 +7319,7 @@ var GoalModelsTab = ({
7165
7319
  );
7166
7320
 
7167
7321
  // src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
7168
- import { Fragment as Fragment9, jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
7322
+ import { Fragment as Fragment9, jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
7169
7323
  var GoalPageTab = /* @__PURE__ */ ((GoalPageTab2) => {
7170
7324
  GoalPageTab2["HISTORY"] = "history";
7171
7325
  GoalPageTab2["DRAFTS"] = "drafts";
@@ -7211,7 +7365,7 @@ var getSchoolOptions = (data) => {
7211
7365
  name: school.name
7212
7366
  }));
7213
7367
  };
7214
- var getSubjectOptions2 = (data) => {
7368
+ var getSubjectOptions3 = (data) => {
7215
7369
  if (!data?.subjects) return [];
7216
7370
  return data.subjects.map((subject) => ({
7217
7371
  id: subject.id,
@@ -7277,7 +7431,7 @@ var createGoalFiltersConfig = (userData) => [
7277
7431
  key: "subject",
7278
7432
  label: "Mat\xE9ria",
7279
7433
  selectedIds: [],
7280
- itens: getSubjectOptions2(userData)
7434
+ itens: getSubjectOptions3(userData)
7281
7435
  },
7282
7436
  {
7283
7437
  key: "theme",
@@ -7330,7 +7484,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
7330
7484
  className: "max-w-[200px] truncate",
7331
7485
  render: (value) => {
7332
7486
  const title = typeof value === "string" ? value : "";
7333
- return /* @__PURE__ */ jsx41(Text_default, { size: "sm", title, children: title });
7487
+ return /* @__PURE__ */ jsx42(Text_default, { size: "sm", title, children: title });
7334
7488
  }
7335
7489
  },
7336
7490
  {
@@ -7340,7 +7494,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
7340
7494
  className: "max-w-[150px] truncate",
7341
7495
  render: (value) => {
7342
7496
  const school = typeof value === "string" ? value : "";
7343
- return /* @__PURE__ */ jsx41(Text_default, { size: "sm", title: school, children: school });
7497
+ return /* @__PURE__ */ jsx42(Text_default, { size: "sm", title: school, children: school });
7344
7498
  }
7345
7499
  },
7346
7500
  {
@@ -7357,11 +7511,11 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
7357
7511
  const subjectName = typeof value === "string" ? value : "";
7358
7512
  const subjectEnum = mapSubjectNameToEnum?.(subjectName);
7359
7513
  if (!subjectEnum) {
7360
- return /* @__PURE__ */ jsx41(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
7514
+ return /* @__PURE__ */ jsx42(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
7361
7515
  }
7362
7516
  const subjectInfo = getSubjectInfo(subjectEnum);
7363
7517
  return /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", title: subjectName, children: [
7364
- /* @__PURE__ */ jsx41(
7518
+ /* @__PURE__ */ jsx42(
7365
7519
  "span",
7366
7520
  {
7367
7521
  className: cn(
@@ -7371,7 +7525,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
7371
7525
  children: subjectInfo.icon
7372
7526
  }
7373
7527
  ),
7374
- /* @__PURE__ */ jsx41(Text_default, { size: "sm", className: "truncate", children: subjectName })
7528
+ /* @__PURE__ */ jsx42(Text_default, { size: "sm", className: "truncate", children: subjectName })
7375
7529
  ] });
7376
7530
  }
7377
7531
  },
@@ -7387,9 +7541,9 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
7387
7541
  render: (value) => {
7388
7542
  const status = typeof value === "string" ? value : "";
7389
7543
  if (!status) {
7390
- return /* @__PURE__ */ jsx41(Text_default, { size: "sm", color: "text-text-500", children: "-" });
7544
+ return /* @__PURE__ */ jsx42(Text_default, { size: "sm", color: "text-text-500", children: "-" });
7391
7545
  }
7392
- return /* @__PURE__ */ jsx41(
7546
+ return /* @__PURE__ */ jsx42(
7393
7547
  Badge_default,
7394
7548
  {
7395
7549
  variant: "solid",
@@ -7404,7 +7558,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
7404
7558
  key: "completionPercentage",
7405
7559
  label: "Conclus\xE3o",
7406
7560
  sortable: true,
7407
- render: (value) => /* @__PURE__ */ jsx41(
7561
+ render: (value) => /* @__PURE__ */ jsx42(
7408
7562
  ProgressBar_default,
7409
7563
  {
7410
7564
  value: Number(value),
@@ -7431,19 +7585,19 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
7431
7585
  onEditGoal?.(row.id);
7432
7586
  };
7433
7587
  return /* @__PURE__ */ jsxs28("div", { className: "flex justify-center gap-2", children: [
7434
- /* @__PURE__ */ jsx41(
7588
+ /* @__PURE__ */ jsx42(
7435
7589
  IconButton_default,
7436
7590
  {
7437
- icon: /* @__PURE__ */ jsx41(Trash2, { size: 20 }),
7591
+ icon: /* @__PURE__ */ jsx42(Trash2, { size: 20 }),
7438
7592
  size: "sm",
7439
7593
  title: "Excluir",
7440
7594
  onClick: handleDelete
7441
7595
  }
7442
7596
  ),
7443
- /* @__PURE__ */ jsx41(
7597
+ /* @__PURE__ */ jsx42(
7444
7598
  IconButton_default,
7445
7599
  {
7446
- icon: /* @__PURE__ */ jsx41(PencilSimple2, { size: 20 }),
7600
+ icon: /* @__PURE__ */ jsx42(PencilSimple2, { size: 20 }),
7447
7601
  size: "sm",
7448
7602
  title: "Editar",
7449
7603
  onClick: handleEdit
@@ -7457,7 +7611,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
7457
7611
  label: "",
7458
7612
  sortable: false,
7459
7613
  className: "w-12",
7460
- render: () => /* @__PURE__ */ jsx41("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx41(CaretRight6, { size: 20, className: "text-text-600" }) })
7614
+ render: () => /* @__PURE__ */ jsx42("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx42(CaretRight6, { size: 20, className: "text-text-600" }) })
7461
7615
  }
7462
7616
  ];
7463
7617
  var RecommendedLessonsHistory = ({
@@ -7479,10 +7633,14 @@ var RecommendedLessonsHistory = ({
7479
7633
  onSendLesson,
7480
7634
  onEditModel,
7481
7635
  subjectsMap,
7636
+ fetchGoalDrafts,
7637
+ deleteGoalDraft,
7638
+ onSendDraft,
7639
+ onEditDraft,
7482
7640
  defaultTab,
7483
7641
  onTabChange
7484
7642
  }) => {
7485
- const [activeTab, setActiveTab] = useState16(
7643
+ const [activeTab, setActiveTab] = useState17(
7486
7644
  defaultTab ?? "history" /* HISTORY */
7487
7645
  );
7488
7646
  useEffect16(() => {
@@ -7490,7 +7648,7 @@ var RecommendedLessonsHistory = ({
7490
7648
  setActiveTab(defaultTab);
7491
7649
  }
7492
7650
  }, [defaultTab]);
7493
- const handleTabChange = useCallback6(
7651
+ const handleTabChange = useCallback7(
7494
7652
  (value) => {
7495
7653
  const newTab = value;
7496
7654
  setActiveTab(newTab);
@@ -7521,7 +7679,7 @@ var RecommendedLessonsHistory = ({
7521
7679
  () => createTableColumns(mapSubjectNameToEnum, onDeleteGoal, onEditGoal),
7522
7680
  [mapSubjectNameToEnum, onDeleteGoal, onEditGoal]
7523
7681
  );
7524
- const handleParamsChange = useCallback6(
7682
+ const handleParamsChange = useCallback7(
7525
7683
  (params) => {
7526
7684
  const filters = buildFiltersFromParams(params);
7527
7685
  fetchGoals(filters);
@@ -7534,10 +7692,10 @@ var RecommendedLessonsHistory = ({
7534
7692
  "data-testid": "recommended-lessons-history",
7535
7693
  className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
7536
7694
  children: [
7537
- /* @__PURE__ */ jsx41("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
7695
+ /* @__PURE__ */ jsx42("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
7538
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: [
7539
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: [
7540
- /* @__PURE__ */ jsx41(
7698
+ /* @__PURE__ */ jsx42(
7541
7699
  Text_default,
7542
7700
  {
7543
7701
  as: "h1",
@@ -7546,7 +7704,7 @@ var RecommendedLessonsHistory = ({
7546
7704
  children: title
7547
7705
  }
7548
7706
  ),
7549
- /* @__PURE__ */ jsx41("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ jsx41(
7707
+ /* @__PURE__ */ jsx42("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ jsx42(
7550
7708
  Menu,
7551
7709
  {
7552
7710
  defaultValue: "history" /* HISTORY */,
@@ -7560,7 +7718,7 @@ var RecommendedLessonsHistory = ({
7560
7718
  variant: "menu2",
7561
7719
  className: "w-full lg:w-auto max-w-full min-w-0",
7562
7720
  children: [
7563
- /* @__PURE__ */ jsx41(
7721
+ /* @__PURE__ */ jsx42(
7564
7722
  MenuItem,
7565
7723
  {
7566
7724
  variant: "menu2",
@@ -7570,7 +7728,7 @@ var RecommendedLessonsHistory = ({
7570
7728
  children: "Hist\xF3rico"
7571
7729
  }
7572
7730
  ),
7573
- /* @__PURE__ */ jsx41(
7731
+ /* @__PURE__ */ jsx42(
7574
7732
  MenuItem,
7575
7733
  {
7576
7734
  variant: "menu2",
@@ -7580,7 +7738,7 @@ var RecommendedLessonsHistory = ({
7580
7738
  children: "Rascunhos"
7581
7739
  }
7582
7740
  ),
7583
- /* @__PURE__ */ jsx41(
7741
+ /* @__PURE__ */ jsx42(
7584
7742
  MenuItem,
7585
7743
  {
7586
7744
  variant: "menu2",
@@ -7597,7 +7755,7 @@ var RecommendedLessonsHistory = ({
7597
7755
  ) })
7598
7756
  ] }),
7599
7757
  /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
7600
- activeTab === "history" /* HISTORY */ && /* @__PURE__ */ jsx41(Fragment9, { children: error ? /* @__PURE__ */ jsx41("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx41(Text_default, { size: "lg", color: "text-error-500", children: error }) }) : /* @__PURE__ */ jsx41("div", { className: "w-full", children: /* @__PURE__ */ jsx41(
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(
7601
7759
  TableProvider,
7602
7760
  {
7603
7761
  data: goals,
@@ -7622,14 +7780,14 @@ var RecommendedLessonsHistory = ({
7622
7780
  image: noSearchImage
7623
7781
  },
7624
7782
  emptyState: {
7625
- component: /* @__PURE__ */ jsx41(
7783
+ component: /* @__PURE__ */ jsx42(
7626
7784
  EmptyState_default,
7627
7785
  {
7628
7786
  image: emptyStateImage,
7629
7787
  title: "Crie uma nova aula",
7630
7788
  description: "Selecione um conjunto de aulas organizadas por tema e ajude seus alunos a estudarem de forma estruturada e eficiente!",
7631
7789
  buttonText: createButtonText,
7632
- buttonIcon: /* @__PURE__ */ jsx41(Plus2, { size: 18 }),
7790
+ buttonIcon: /* @__PURE__ */ jsx42(Plus2, { size: 18 }),
7633
7791
  buttonVariant: "outline",
7634
7792
  buttonAction: "primary",
7635
7793
  onButtonClick: onCreateLesson
@@ -7646,14 +7804,14 @@ var RecommendedLessonsHistory = ({
7646
7804
  } = renderProps;
7647
7805
  return /* @__PURE__ */ jsxs28("div", { className: "space-y-4", children: [
7648
7806
  /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between gap-4", children: [
7649
- /* @__PURE__ */ jsx41(
7807
+ /* @__PURE__ */ jsx42(
7650
7808
  Button_default,
7651
7809
  {
7652
7810
  variant: "solid",
7653
7811
  action: "primary",
7654
7812
  size: "medium",
7655
7813
  onClick: onCreateLesson,
7656
- iconLeft: /* @__PURE__ */ jsx41(Plus2, { size: 18, weight: "bold" }),
7814
+ iconLeft: /* @__PURE__ */ jsx42(Plus2, { size: 18, weight: "bold" }),
7657
7815
  children: createButtonText
7658
7816
  }
7659
7817
  ),
@@ -7667,8 +7825,22 @@ var RecommendedLessonsHistory = ({
7667
7825
  }
7668
7826
  }
7669
7827
  ) }) }),
7670
- activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */ jsx41("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx41(Text_default, { size: "lg", color: "text-text-600", children: "Rascunhos em desenvolvimento" }) }),
7671
- activeTab === "models" /* MODELS */ && fetchGoalModels && deleteGoalModel && onCreateModel && /* @__PURE__ */ jsx41(
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(
7672
7844
  GoalModelsTab,
7673
7845
  {
7674
7846
  fetchGoalModels,