analytica-frontend-lib 1.2.28 → 1.2.30
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/ActivityCardQuestionBanks/index.css +19293 -0
- package/dist/ActivityCardQuestionBanks/index.css.map +1 -0
- package/dist/ActivityCardQuestionBanks/index.d.ts +21 -0
- package/dist/ActivityCardQuestionBanks/index.d.ts.map +1 -0
- package/dist/ActivityCardQuestionBanks/index.js +1717 -0
- package/dist/ActivityCardQuestionBanks/index.js.map +1 -0
- package/dist/ActivityCardQuestionBanks/index.mjs +1701 -0
- package/dist/ActivityCardQuestionBanks/index.mjs.map +1 -0
- package/dist/ActivityDetails/index.js +33 -3
- package/dist/ActivityDetails/index.js.map +1 -1
- package/dist/ActivityDetails/index.mjs +33 -3
- package/dist/ActivityDetails/index.mjs.map +1 -1
- package/dist/ActivityFilters/index.js +33 -3
- package/dist/ActivityFilters/index.js.map +1 -1
- package/dist/ActivityFilters/index.mjs +33 -3
- package/dist/ActivityFilters/index.mjs.map +1 -1
- package/dist/AlertManager/index.js +33 -3
- package/dist/AlertManager/index.js.map +1 -1
- package/dist/AlertManager/index.mjs +33 -3
- package/dist/AlertManager/index.mjs.map +1 -1
- package/dist/TableProvider/index.js +33 -3
- package/dist/TableProvider/index.js.map +1 -1
- package/dist/TableProvider/index.mjs +33 -3
- package/dist/TableProvider/index.mjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +479 -267
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +434 -223
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ var src_exports = {};
|
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
ANSWER_STATUS: () => ANSWER_STATUS,
|
|
34
34
|
AccordionGroup: () => AccordionGroup,
|
|
35
|
+
ActivityCardQuestionBanks: () => ActivityCardQuestionBanks,
|
|
35
36
|
ActivityDetails: () => ActivityDetails,
|
|
36
37
|
ActivityFilters: () => ActivityFilters,
|
|
37
38
|
ActivityFiltersPopover: () => ActivityFiltersPopover,
|
|
@@ -1405,7 +1406,10 @@ var import_react7 = require("react");
|
|
|
1405
1406
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1406
1407
|
var CheckboxGroup = ({
|
|
1407
1408
|
categories,
|
|
1408
|
-
onCategoriesChange
|
|
1409
|
+
onCategoriesChange,
|
|
1410
|
+
compactSingleItem = true,
|
|
1411
|
+
showDivider = true,
|
|
1412
|
+
showSingleItem = false
|
|
1409
1413
|
}) => {
|
|
1410
1414
|
const [openAccordion, setOpenAccordion] = (0, import_react7.useState)("");
|
|
1411
1415
|
const autoSelectionAppliedRef = (0, import_react7.useRef)(false);
|
|
@@ -1764,16 +1768,43 @@ var CheckboxGroup = ({
|
|
|
1764
1768
|
return `${selectedVisibleCount} de ${totalVisible} ${selectedVisibleCount === 1 ? "selecionado" : "selecionados"}`;
|
|
1765
1769
|
})() })
|
|
1766
1770
|
] });
|
|
1771
|
+
const renderCompactSingleItem = (category) => {
|
|
1772
|
+
const formattedItems = getFormattedItems(category.key);
|
|
1773
|
+
const allItems = formattedItems.flatMap((group) => group.itens || []);
|
|
1774
|
+
if (allItems.length !== 1) {
|
|
1775
|
+
return null;
|
|
1776
|
+
}
|
|
1777
|
+
const singleItem = allItems[0];
|
|
1778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1779
|
+
"div",
|
|
1780
|
+
{
|
|
1781
|
+
className: "flex items-center justify-between w-full px-3 py-2",
|
|
1782
|
+
children: [
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-800", children: category.label }),
|
|
1784
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { size: "sm", className: "text-text-950", children: singleItem.name })
|
|
1785
|
+
]
|
|
1786
|
+
},
|
|
1787
|
+
category.key
|
|
1788
|
+
);
|
|
1789
|
+
};
|
|
1767
1790
|
const renderCategoryAccordion = (category) => {
|
|
1768
1791
|
const isEnabled = !category.dependsOn || category.dependsOn.every((depKey) => {
|
|
1769
1792
|
const depCat = categories.find((c) => c.key === depKey);
|
|
1770
1793
|
return depCat?.selectedIds && depCat.selectedIds.length > 0;
|
|
1771
1794
|
});
|
|
1772
1795
|
const hasOnlyOneItem = category.itens?.length === 1;
|
|
1773
|
-
if (hasOnlyOneItem) {
|
|
1796
|
+
if (hasOnlyOneItem && !compactSingleItem && !showSingleItem) {
|
|
1774
1797
|
return null;
|
|
1775
1798
|
}
|
|
1776
1799
|
const formattedItems = getFormattedItems(category.key);
|
|
1800
|
+
const allItems = formattedItems.flatMap((group) => group.itens || []);
|
|
1801
|
+
const hasOnlyOneAvailableItem = allItems.length === 1;
|
|
1802
|
+
if (compactSingleItem && hasOnlyOneAvailableItem && isEnabled) {
|
|
1803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
1804
|
+
renderCompactSingleItem(category),
|
|
1805
|
+
showDivider && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Divider_default, {})
|
|
1806
|
+
] }, category.key);
|
|
1807
|
+
}
|
|
1777
1808
|
const hasNoItems = formattedItems.every(
|
|
1778
1809
|
(group) => !group.itens || group.itens.length === 0
|
|
1779
1810
|
);
|
|
@@ -1793,7 +1824,7 @@ var CheckboxGroup = ({
|
|
|
1793
1824
|
) })
|
|
1794
1825
|
}
|
|
1795
1826
|
),
|
|
1796
|
-
openAccordion !== category.key && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Divider_default, {})
|
|
1827
|
+
openAccordion !== category.key && showDivider && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Divider_default, {})
|
|
1797
1828
|
] }, category.key);
|
|
1798
1829
|
};
|
|
1799
1830
|
(0, import_react7.useEffect)(() => {
|
|
@@ -16981,6 +17012,186 @@ function useAppContent(config) {
|
|
|
16981
17012
|
};
|
|
16982
17013
|
}
|
|
16983
17014
|
|
|
17015
|
+
// src/components/ActivityCardQuestionBanks/ActivityCardQuestionBanks.tsx
|
|
17016
|
+
var import_phosphor_react37 = require("phosphor-react");
|
|
17017
|
+
var import_react55 = require("react");
|
|
17018
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
17019
|
+
var ActivityCardQuestionBanks = ({
|
|
17020
|
+
question,
|
|
17021
|
+
questionType,
|
|
17022
|
+
iconName = "BookOpen",
|
|
17023
|
+
subjectColor = "#000000",
|
|
17024
|
+
isDark = false,
|
|
17025
|
+
onAddToActivity,
|
|
17026
|
+
assunto,
|
|
17027
|
+
enunciado
|
|
17028
|
+
} = {}) => {
|
|
17029
|
+
const alternatives = (0, import_react55.useMemo)(() => {
|
|
17030
|
+
if (!question?.options || questionType !== "ALTERNATIVA" /* ALTERNATIVA */)
|
|
17031
|
+
return [];
|
|
17032
|
+
const correctOptionIds2 = question.correctOptionIds || [];
|
|
17033
|
+
return question.options.map((option) => {
|
|
17034
|
+
const isCorrect = correctOptionIds2.includes(option.id);
|
|
17035
|
+
return {
|
|
17036
|
+
value: option.id,
|
|
17037
|
+
label: option.option,
|
|
17038
|
+
status: isCorrect ? "correct" : void 0,
|
|
17039
|
+
disabled: !isCorrect
|
|
17040
|
+
};
|
|
17041
|
+
});
|
|
17042
|
+
}, [question, questionType]);
|
|
17043
|
+
const correctOptionId = (0, import_react55.useMemo)(() => {
|
|
17044
|
+
if (!question?.correctOptionIds || question.correctOptionIds.length === 0) {
|
|
17045
|
+
return void 0;
|
|
17046
|
+
}
|
|
17047
|
+
return question.correctOptionIds[0];
|
|
17048
|
+
}, [question]);
|
|
17049
|
+
const multipleChoices = (0, import_react55.useMemo)(() => {
|
|
17050
|
+
if (!question?.options || questionType !== "MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */)
|
|
17051
|
+
return [];
|
|
17052
|
+
const correctOptionIds2 = question.correctOptionIds || [];
|
|
17053
|
+
return question.options.map((option) => {
|
|
17054
|
+
const isCorrect = correctOptionIds2.includes(option.id);
|
|
17055
|
+
return {
|
|
17056
|
+
value: option.id,
|
|
17057
|
+
label: option.option,
|
|
17058
|
+
status: isCorrect ? "correct" : void 0,
|
|
17059
|
+
disabled: !isCorrect
|
|
17060
|
+
};
|
|
17061
|
+
});
|
|
17062
|
+
}, [question, questionType]);
|
|
17063
|
+
const correctOptionIds = (0, import_react55.useMemo)(() => {
|
|
17064
|
+
return question?.correctOptionIds || [];
|
|
17065
|
+
}, [question]);
|
|
17066
|
+
const getStatusBadge2 = (status) => {
|
|
17067
|
+
switch (status) {
|
|
17068
|
+
case "correct":
|
|
17069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_phosphor_react37.CheckCircle, {}), children: "Resposta correta" });
|
|
17070
|
+
case "incorrect":
|
|
17071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_phosphor_react37.XCircle, {}), children: "Resposta incorreta" });
|
|
17072
|
+
}
|
|
17073
|
+
};
|
|
17074
|
+
const getStatusStyles2 = (status) => {
|
|
17075
|
+
switch (status) {
|
|
17076
|
+
case "correct":
|
|
17077
|
+
return "bg-success-background border-success-300";
|
|
17078
|
+
case "incorrect":
|
|
17079
|
+
return "bg-error-background border-error-300";
|
|
17080
|
+
}
|
|
17081
|
+
};
|
|
17082
|
+
const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
|
|
17083
|
+
const renderAlternative = () => {
|
|
17084
|
+
if (!question || alternatives.length === 0) return null;
|
|
17085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
17086
|
+
AlternativesList,
|
|
17087
|
+
{
|
|
17088
|
+
alternatives,
|
|
17089
|
+
mode: "readonly",
|
|
17090
|
+
layout: "compact",
|
|
17091
|
+
selectedValue: correctOptionId,
|
|
17092
|
+
name: "teacher-question-view"
|
|
17093
|
+
}
|
|
17094
|
+
) });
|
|
17095
|
+
};
|
|
17096
|
+
const renderMultipleChoice = () => {
|
|
17097
|
+
if (!question || multipleChoices.length === 0) return null;
|
|
17098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
17099
|
+
MultipleChoiceList,
|
|
17100
|
+
{
|
|
17101
|
+
choices: multipleChoices,
|
|
17102
|
+
mode: "readonly",
|
|
17103
|
+
selectedValues: correctOptionIds,
|
|
17104
|
+
name: "teacher-question-view-multiple"
|
|
17105
|
+
}
|
|
17106
|
+
) });
|
|
17107
|
+
};
|
|
17108
|
+
const renderDissertative = () => {
|
|
17109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "mt-4 px-2 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text_default, { size: "sm", className: "text-text-600 italic", children: "Resposta do aluno" }) });
|
|
17110
|
+
};
|
|
17111
|
+
const renderTrueOrFalse = () => {
|
|
17112
|
+
if (!question || question.options.length === 0) return null;
|
|
17113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex flex-col gap-3.5", children: question.options.map((option, index) => {
|
|
17114
|
+
const isCorrect = correctOptionIds.includes(option.id);
|
|
17115
|
+
const correctAnswer = isCorrect ? "Verdadeiro" : "Falso";
|
|
17116
|
+
const variantCorrect = "correct";
|
|
17117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("section", { className: "flex flex-col gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
17118
|
+
"div",
|
|
17119
|
+
{
|
|
17120
|
+
className: cn(
|
|
17121
|
+
"flex flex-row justify-between items-center gap-2 p-2 rounded-md border",
|
|
17122
|
+
getStatusStyles2(variantCorrect)
|
|
17123
|
+
),
|
|
17124
|
+
children: [
|
|
17125
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text_default, { size: "sm", className: "text-text-900", children: getLetterByIndex(index).concat(") ").concat(option.option) }),
|
|
17126
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex flex-row items-center gap-2 flex-shrink-0", children: [
|
|
17127
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Text_default, { size: "sm", className: "text-text-700", children: [
|
|
17128
|
+
"Resposta correta: ",
|
|
17129
|
+
correctAnswer
|
|
17130
|
+
] }),
|
|
17131
|
+
getStatusBadge2(variantCorrect)
|
|
17132
|
+
] })
|
|
17133
|
+
]
|
|
17134
|
+
}
|
|
17135
|
+
) }, option.id);
|
|
17136
|
+
}) }) });
|
|
17137
|
+
};
|
|
17138
|
+
const renderConnectDots = () => {
|
|
17139
|
+
return null;
|
|
17140
|
+
};
|
|
17141
|
+
const renderFill = () => {
|
|
17142
|
+
return null;
|
|
17143
|
+
};
|
|
17144
|
+
const renderImage = () => {
|
|
17145
|
+
return null;
|
|
17146
|
+
};
|
|
17147
|
+
const questionRenderers = {
|
|
17148
|
+
["ALTERNATIVA" /* ALTERNATIVA */]: renderAlternative,
|
|
17149
|
+
["MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */]: renderMultipleChoice,
|
|
17150
|
+
["DISSERTATIVA" /* DISSERTATIVA */]: renderDissertative,
|
|
17151
|
+
["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: renderTrueOrFalse,
|
|
17152
|
+
["LIGAR_PONTOS" /* LIGAR_PONTOS */]: renderConnectDots,
|
|
17153
|
+
["PREENCHER" /* PREENCHER */]: renderFill,
|
|
17154
|
+
["IMAGEM" /* IMAGEM */]: renderImage
|
|
17155
|
+
};
|
|
17156
|
+
const renderQuestionContent = () => {
|
|
17157
|
+
if (!questionType) return null;
|
|
17158
|
+
const renderer = questionRenderers[questionType];
|
|
17159
|
+
return renderer ? renderer() : null;
|
|
17160
|
+
};
|
|
17161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "w-full flex flex-col gap-2 px-4 py-6", children: [
|
|
17162
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("section", { className: "flex flex-row gap-2 text-text-650", children: [
|
|
17163
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "py-1 px-2 flex flex-row items-center gap-1", children: [
|
|
17164
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
17165
|
+
"span",
|
|
17166
|
+
{
|
|
17167
|
+
className: "size-4 rounded-sm flex items-center justify-center shrink-0 text-text-950",
|
|
17168
|
+
style: {
|
|
17169
|
+
backgroundColor: getSubjectColorWithOpacity(subjectColor, isDark)
|
|
17170
|
+
},
|
|
17171
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(IconRender_default, { iconName, size: 14, color: "currentColor" })
|
|
17172
|
+
}
|
|
17173
|
+
),
|
|
17174
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text_default, { size: "sm", children: assunto || "Assunto n\xE3o informado" })
|
|
17175
|
+
] }),
|
|
17176
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "py-1 px-2 flex flex-row items-center gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text_default, { size: "sm", className: "", children: questionType ? questionTypeLabels[questionType] : "Tipo de quest\xE3o" }) })
|
|
17177
|
+
] }),
|
|
17178
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("section", { className: "flex flex-col gap-1", children: [
|
|
17179
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text_default, { size: "md", weight: "medium", className: "text-text-950 text-md", children: enunciado || "Enunciado n\xE3o informado" }),
|
|
17180
|
+
renderQuestionContent()
|
|
17181
|
+
] }),
|
|
17182
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("section", { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
17183
|
+
Button_default,
|
|
17184
|
+
{
|
|
17185
|
+
size: "small",
|
|
17186
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_phosphor_react37.Plus, {}),
|
|
17187
|
+
className: "w-full",
|
|
17188
|
+
onClick: onAddToActivity,
|
|
17189
|
+
children: "Adicionar \xE0 atividade"
|
|
17190
|
+
}
|
|
17191
|
+
) })
|
|
17192
|
+
] });
|
|
17193
|
+
};
|
|
17194
|
+
|
|
16984
17195
|
// src/types/activityDetails.ts
|
|
16985
17196
|
var STUDENT_ACTIVITY_STATUS = {
|
|
16986
17197
|
CONCLUIDO: "CONCLUIDO",
|
|
@@ -17032,9 +17243,9 @@ var formatDateToBrazilian = (dateString) => {
|
|
|
17032
17243
|
};
|
|
17033
17244
|
|
|
17034
17245
|
// src/components/ActivityDetails/ActivityDetails.tsx
|
|
17035
|
-
var
|
|
17036
|
-
var
|
|
17037
|
-
var
|
|
17246
|
+
var import_react56 = require("react");
|
|
17247
|
+
var import_phosphor_react38 = require("phosphor-react");
|
|
17248
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
17038
17249
|
var createTableColumns = (onCorrectActivity) => [
|
|
17039
17250
|
{
|
|
17040
17251
|
key: "studentName",
|
|
@@ -17042,9 +17253,9 @@ var createTableColumns = (onCorrectActivity) => [
|
|
|
17042
17253
|
sortable: true,
|
|
17043
17254
|
render: (value) => {
|
|
17044
17255
|
const name = typeof value === "string" ? value : "";
|
|
17045
|
-
return /* @__PURE__ */ (0,
|
|
17046
|
-
/* @__PURE__ */ (0,
|
|
17047
|
-
/* @__PURE__ */ (0,
|
|
17256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
17257
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "w-6 h-6 bg-blue-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-xs font-semibold text-primary-700", children: name.charAt(0).toUpperCase() }) }),
|
|
17258
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm font-normal text-text-950", children: name })
|
|
17048
17259
|
] });
|
|
17049
17260
|
}
|
|
17050
17261
|
},
|
|
@@ -17054,7 +17265,7 @@ var createTableColumns = (onCorrectActivity) => [
|
|
|
17054
17265
|
sortable: false,
|
|
17055
17266
|
render: (value) => {
|
|
17056
17267
|
const config = getStatusBadgeConfig(value);
|
|
17057
|
-
return /* @__PURE__ */ (0,
|
|
17268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17058
17269
|
Badge_default,
|
|
17059
17270
|
{
|
|
17060
17271
|
className: `${config.bgColor} ${config.textColor} text-xs px-2 py-1`,
|
|
@@ -17069,22 +17280,22 @@ var createTableColumns = (onCorrectActivity) => [
|
|
|
17069
17280
|
sortable: true,
|
|
17070
17281
|
render: (value) => {
|
|
17071
17282
|
if (!value || typeof value !== "string") {
|
|
17072
|
-
return /* @__PURE__ */ (0,
|
|
17283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm text-text-400", children: "-" });
|
|
17073
17284
|
}
|
|
17074
|
-
return /* @__PURE__ */ (0,
|
|
17285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm text-text-700", children: formatDateToBrazilian(value) });
|
|
17075
17286
|
}
|
|
17076
17287
|
},
|
|
17077
17288
|
{
|
|
17078
17289
|
key: "timeSpent",
|
|
17079
17290
|
label: "Dura\xE7\xE3o",
|
|
17080
17291
|
sortable: false,
|
|
17081
|
-
render: (value) => Number(value) > 0 ? /* @__PURE__ */ (0,
|
|
17292
|
+
render: (value) => Number(value) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm text-text-700", children: formatTimeSpent(Number(value)) }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm text-text-400", children: "-" })
|
|
17082
17293
|
},
|
|
17083
17294
|
{
|
|
17084
17295
|
key: "score",
|
|
17085
17296
|
label: "Nota",
|
|
17086
17297
|
sortable: true,
|
|
17087
|
-
render: (value) => value === null ? /* @__PURE__ */ (0,
|
|
17298
|
+
render: (value) => value === null ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm text-text-400", children: "-" }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm font-semibold text-text-950", children: Number(value).toFixed(1) })
|
|
17088
17299
|
},
|
|
17089
17300
|
{
|
|
17090
17301
|
key: "actions",
|
|
@@ -17092,7 +17303,7 @@ var createTableColumns = (onCorrectActivity) => [
|
|
|
17092
17303
|
sortable: false,
|
|
17093
17304
|
render: (_value, row) => {
|
|
17094
17305
|
if (row.status === STUDENT_ACTIVITY_STATUS.AGUARDANDO_CORRECAO) {
|
|
17095
|
-
return /* @__PURE__ */ (0,
|
|
17306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17096
17307
|
Button_default,
|
|
17097
17308
|
{
|
|
17098
17309
|
variant: "outline",
|
|
@@ -17104,7 +17315,7 @@ var createTableColumns = (onCorrectActivity) => [
|
|
|
17104
17315
|
);
|
|
17105
17316
|
}
|
|
17106
17317
|
if (row.status === STUDENT_ACTIVITY_STATUS.CONCLUIDO || row.status === STUDENT_ACTIVITY_STATUS.NAO_ENTREGUE) {
|
|
17107
|
-
return /* @__PURE__ */ (0,
|
|
17318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17108
17319
|
Button_default,
|
|
17109
17320
|
{
|
|
17110
17321
|
variant: "link",
|
|
@@ -17130,20 +17341,20 @@ var ActivityDetails = ({
|
|
|
17130
17341
|
mapSubjectNameToEnum
|
|
17131
17342
|
}) => {
|
|
17132
17343
|
const { isMobile } = useMobile();
|
|
17133
|
-
const [page, setPage] = (0,
|
|
17134
|
-
const [limit, setLimit] = (0,
|
|
17135
|
-
const [sortBy, setSortBy] = (0,
|
|
17136
|
-
const [sortOrder, setSortOrder] = (0,
|
|
17344
|
+
const [page, setPage] = (0, import_react56.useState)(1);
|
|
17345
|
+
const [limit, setLimit] = (0, import_react56.useState)(10);
|
|
17346
|
+
const [sortBy, setSortBy] = (0, import_react56.useState)(void 0);
|
|
17347
|
+
const [sortOrder, setSortOrder] = (0, import_react56.useState)(
|
|
17137
17348
|
void 0
|
|
17138
17349
|
);
|
|
17139
|
-
const [data, setData] = (0,
|
|
17140
|
-
const [correctionData, setCorrectionData] = (0,
|
|
17141
|
-
const [loading, setLoading] = (0,
|
|
17142
|
-
const [error, setError] = (0,
|
|
17143
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
17144
|
-
const [isViewOnlyModal, setIsViewOnlyModal] = (0,
|
|
17145
|
-
const [correctionError, setCorrectionError] = (0,
|
|
17146
|
-
(0,
|
|
17350
|
+
const [data, setData] = (0, import_react56.useState)(null);
|
|
17351
|
+
const [correctionData, setCorrectionData] = (0, import_react56.useState)(null);
|
|
17352
|
+
const [loading, setLoading] = (0, import_react56.useState)(true);
|
|
17353
|
+
const [error, setError] = (0, import_react56.useState)(null);
|
|
17354
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react56.useState)(false);
|
|
17355
|
+
const [isViewOnlyModal, setIsViewOnlyModal] = (0, import_react56.useState)(false);
|
|
17356
|
+
const [correctionError, setCorrectionError] = (0, import_react56.useState)(null);
|
|
17357
|
+
(0, import_react56.useEffect)(() => {
|
|
17147
17358
|
const loadData = async () => {
|
|
17148
17359
|
if (!activityId) return;
|
|
17149
17360
|
setLoading(true);
|
|
@@ -17166,7 +17377,7 @@ var ActivityDetails = ({
|
|
|
17166
17377
|
};
|
|
17167
17378
|
loadData();
|
|
17168
17379
|
}, [activityId, page, limit, sortBy, sortOrder, fetchActivityDetails]);
|
|
17169
|
-
const handleCorrectActivity = (0,
|
|
17380
|
+
const handleCorrectActivity = (0, import_react56.useCallback)(
|
|
17170
17381
|
async (studentId) => {
|
|
17171
17382
|
const student = data?.students.find((s) => s.studentId === studentId);
|
|
17172
17383
|
if (!student || !activityId) return;
|
|
@@ -17186,10 +17397,10 @@ var ActivityDetails = ({
|
|
|
17186
17397
|
},
|
|
17187
17398
|
[data?.students, activityId, fetchStudentCorrection]
|
|
17188
17399
|
);
|
|
17189
|
-
const handleCloseModal = (0,
|
|
17400
|
+
const handleCloseModal = (0, import_react56.useCallback)(() => {
|
|
17190
17401
|
setIsModalOpen(false);
|
|
17191
17402
|
}, []);
|
|
17192
|
-
const handleObservationSubmit = (0,
|
|
17403
|
+
const handleObservationSubmit = (0, import_react56.useCallback)(
|
|
17193
17404
|
async (observation, files) => {
|
|
17194
17405
|
if (!activityId || !correctionData?.studentId) return;
|
|
17195
17406
|
try {
|
|
@@ -17206,7 +17417,7 @@ var ActivityDetails = ({
|
|
|
17206
17417
|
},
|
|
17207
17418
|
[activityId, correctionData?.studentId, submitObservation]
|
|
17208
17419
|
);
|
|
17209
|
-
const tableData = (0,
|
|
17420
|
+
const tableData = (0, import_react56.useMemo)(() => {
|
|
17210
17421
|
if (!data?.students) return [];
|
|
17211
17422
|
return data.students.map((student) => ({
|
|
17212
17423
|
id: student.studentId,
|
|
@@ -17218,7 +17429,7 @@ var ActivityDetails = ({
|
|
|
17218
17429
|
score: student.score
|
|
17219
17430
|
}));
|
|
17220
17431
|
}, [data?.students]);
|
|
17221
|
-
const columns = (0,
|
|
17432
|
+
const columns = (0, import_react56.useMemo)(
|
|
17222
17433
|
() => createTableColumns(handleCorrectActivity),
|
|
17223
17434
|
[handleCorrectActivity]
|
|
17224
17435
|
);
|
|
@@ -17250,10 +17461,10 @@ var ActivityDetails = ({
|
|
|
17250
17461
|
const subjectEnum = data?.activity.subjectName && mapSubjectNameToEnum ? mapSubjectNameToEnum(data.activity.subjectName) : null;
|
|
17251
17462
|
const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
|
|
17252
17463
|
if (loading && !data) {
|
|
17253
|
-
return /* @__PURE__ */ (0,
|
|
17254
|
-
/* @__PURE__ */ (0,
|
|
17255
|
-
/* @__PURE__ */ (0,
|
|
17256
|
-
/* @__PURE__ */ (0,
|
|
17464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex flex-col w-full h-full max-w-[1150px] mx-auto z-10 lg:px-0 px-4 pt-4 gap-4", children: [
|
|
17465
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex items-center gap-2 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(SkeletonText, { width: 100, height: 14 }) }),
|
|
17466
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(SkeletonRounded, { className: "w-full h-[120px]" }),
|
|
17467
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17257
17468
|
"div",
|
|
17258
17469
|
{
|
|
17259
17470
|
className: cn(
|
|
@@ -17266,14 +17477,14 @@ var ActivityDetails = ({
|
|
|
17266
17477
|
"pending",
|
|
17267
17478
|
"avg-score",
|
|
17268
17479
|
"avg-time"
|
|
17269
|
-
].map((id) => /* @__PURE__ */ (0,
|
|
17480
|
+
].map((id) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(SkeletonRounded, { className: "w-full h-[150px]" }, id))
|
|
17270
17481
|
}
|
|
17271
17482
|
),
|
|
17272
|
-
/* @__PURE__ */ (0,
|
|
17483
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "w-full bg-background rounded-xl p-6", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(SkeletonTable, { rows: 5, columns: 6, showHeader: true }) })
|
|
17273
17484
|
] }) });
|
|
17274
17485
|
}
|
|
17275
17486
|
if (error || !data) {
|
|
17276
|
-
return /* @__PURE__ */ (0,
|
|
17487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex flex-col w-full h-auto relative justify-center items-center mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex flex-col w-full h-full max-w-[1150px] mx-auto z-10 lg:px-0 px-4 pt-4", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17277
17488
|
EmptyState_default,
|
|
17278
17489
|
{
|
|
17279
17490
|
image: emptyStateImage,
|
|
@@ -17282,10 +17493,10 @@ var ActivityDetails = ({
|
|
|
17282
17493
|
}
|
|
17283
17494
|
) }) });
|
|
17284
17495
|
}
|
|
17285
|
-
return /* @__PURE__ */ (0,
|
|
17286
|
-
/* @__PURE__ */ (0,
|
|
17287
|
-
/* @__PURE__ */ (0,
|
|
17288
|
-
/* @__PURE__ */ (0,
|
|
17496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden", children: [
|
|
17497
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex flex-col w-full h-full max-w-[1150px] mx-auto z-10 lg:px-0 px-4 pt-4 gap-4", children: [
|
|
17498
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center gap-2 py-4", children: [
|
|
17499
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17289
17500
|
"button",
|
|
17290
17501
|
{
|
|
17291
17502
|
onClick: handleBack,
|
|
@@ -17293,31 +17504,31 @@ var ActivityDetails = ({
|
|
|
17293
17504
|
children: "Atividades"
|
|
17294
17505
|
}
|
|
17295
17506
|
),
|
|
17296
|
-
/* @__PURE__ */ (0,
|
|
17297
|
-
/* @__PURE__ */ (0,
|
|
17507
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_phosphor_react38.CaretRight, { size: 16, className: "text-text-500" }),
|
|
17508
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-text-950 text-sm font-bold", children: data.activity.title })
|
|
17298
17509
|
] }),
|
|
17299
|
-
/* @__PURE__ */ (0,
|
|
17300
|
-
/* @__PURE__ */ (0,
|
|
17301
|
-
/* @__PURE__ */ (0,
|
|
17302
|
-
/* @__PURE__ */ (0,
|
|
17303
|
-
/* @__PURE__ */ (0,
|
|
17510
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-background rounded-xl p-4 flex flex-col gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex justify-between items-start", children: [
|
|
17511
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
17512
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-2xl font-bold text-text-950", children: data.activity.title }),
|
|
17513
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
17514
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Text_default, { className: "text-sm text-text-500", children: [
|
|
17304
17515
|
"In\xEDcio",
|
|
17305
17516
|
" ",
|
|
17306
17517
|
data.activity.startDate ? formatDateToBrazilian(data.activity.startDate) : "00/00/0000"
|
|
17307
17518
|
] }),
|
|
17308
|
-
/* @__PURE__ */ (0,
|
|
17309
|
-
/* @__PURE__ */ (0,
|
|
17519
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "w-1 h-1 rounded-full bg-text-500" }),
|
|
17520
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Text_default, { className: "text-sm text-text-500", children: [
|
|
17310
17521
|
"Prazo final",
|
|
17311
17522
|
" ",
|
|
17312
17523
|
data.activity.finalDate ? formatDateToBrazilian(data.activity.finalDate) : "00/00/0000"
|
|
17313
17524
|
] }),
|
|
17314
|
-
/* @__PURE__ */ (0,
|
|
17315
|
-
/* @__PURE__ */ (0,
|
|
17316
|
-
/* @__PURE__ */ (0,
|
|
17317
|
-
/* @__PURE__ */ (0,
|
|
17318
|
-
/* @__PURE__ */ (0,
|
|
17319
|
-
subjectInfo ? /* @__PURE__ */ (0,
|
|
17320
|
-
/* @__PURE__ */ (0,
|
|
17525
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "w-1 h-1 rounded-full bg-text-500" }),
|
|
17526
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm text-text-500", children: data.activity.schoolName }),
|
|
17527
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "w-1 h-1 rounded-full bg-text-500" }),
|
|
17528
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm text-text-500", children: data.activity.year }),
|
|
17529
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "w-1 h-1 rounded-full bg-text-500" }),
|
|
17530
|
+
subjectInfo ? /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
17531
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17321
17532
|
"span",
|
|
17322
17533
|
{
|
|
17323
17534
|
className: cn(
|
|
@@ -17327,33 +17538,33 @@ var ActivityDetails = ({
|
|
|
17327
17538
|
children: subjectInfo.icon
|
|
17328
17539
|
}
|
|
17329
17540
|
),
|
|
17330
|
-
/* @__PURE__ */ (0,
|
|
17331
|
-
] }) : /* @__PURE__ */ (0,
|
|
17332
|
-
/* @__PURE__ */ (0,
|
|
17333
|
-
/* @__PURE__ */ (0,
|
|
17541
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm text-text-500", children: data.activity.subjectName })
|
|
17542
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm text-text-500", children: data.activity.subjectName }),
|
|
17543
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "w-1 h-1 rounded-full bg-text-500" }),
|
|
17544
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-sm text-text-500", children: data.activity.className })
|
|
17334
17545
|
] })
|
|
17335
17546
|
] }),
|
|
17336
|
-
/* @__PURE__ */ (0,
|
|
17547
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
17337
17548
|
Button_default,
|
|
17338
17549
|
{
|
|
17339
17550
|
size: "small",
|
|
17340
17551
|
onClick: handleViewActivity,
|
|
17341
17552
|
className: "bg-primary-950 text-text gap-2",
|
|
17342
17553
|
children: [
|
|
17343
|
-
/* @__PURE__ */ (0,
|
|
17554
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_phosphor_react38.File, { size: 16 }),
|
|
17344
17555
|
"Ver atividade"
|
|
17345
17556
|
]
|
|
17346
17557
|
}
|
|
17347
17558
|
)
|
|
17348
17559
|
] }) }),
|
|
17349
|
-
/* @__PURE__ */ (0,
|
|
17560
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
17350
17561
|
"div",
|
|
17351
17562
|
{
|
|
17352
17563
|
className: cn("grid gap-5", isMobile ? "grid-cols-2" : "grid-cols-5"),
|
|
17353
17564
|
children: [
|
|
17354
|
-
/* @__PURE__ */ (0,
|
|
17355
|
-
/* @__PURE__ */ (0,
|
|
17356
|
-
/* @__PURE__ */ (0,
|
|
17565
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "border border-border-50 rounded-xl py-4 px-0 flex flex-col items-center justify-center gap-2 bg-primary-50", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "relative w-[90px] h-[90px]", children: [
|
|
17566
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("svg", { className: "w-full h-full transform -rotate-90", children: [
|
|
17567
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17357
17568
|
"circle",
|
|
17358
17569
|
{
|
|
17359
17570
|
cx: "45",
|
|
@@ -17364,7 +17575,7 @@ var ActivityDetails = ({
|
|
|
17364
17575
|
fill: "none"
|
|
17365
17576
|
}
|
|
17366
17577
|
),
|
|
17367
|
-
/* @__PURE__ */ (0,
|
|
17578
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17368
17579
|
"circle",
|
|
17369
17580
|
{
|
|
17370
17581
|
cx: "45",
|
|
@@ -17378,56 +17589,56 @@ var ActivityDetails = ({
|
|
|
17378
17589
|
}
|
|
17379
17590
|
)
|
|
17380
17591
|
] }),
|
|
17381
|
-
/* @__PURE__ */ (0,
|
|
17382
|
-
/* @__PURE__ */ (0,
|
|
17592
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
17593
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Text_default, { className: "text-xl font-medium text-primary-600", children: [
|
|
17383
17594
|
Math.round(data.generalStats.completionPercentage),
|
|
17384
17595
|
"%"
|
|
17385
17596
|
] }),
|
|
17386
|
-
/* @__PURE__ */ (0,
|
|
17597
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-2xs font-bold text-text-600 uppercase", children: "Conclu\xEDdo" })
|
|
17387
17598
|
] })
|
|
17388
17599
|
] }) }),
|
|
17389
|
-
/* @__PURE__ */ (0,
|
|
17390
|
-
/* @__PURE__ */ (0,
|
|
17391
|
-
/* @__PURE__ */ (0,
|
|
17392
|
-
/* @__PURE__ */ (0,
|
|
17600
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "border border-border-50 rounded-xl py-4 px-3 flex flex-col items-center justify-center gap-1 bg-warning-background", children: [
|
|
17601
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "w-[30px] h-[30px] rounded-2xl flex items-center justify-center bg-warning-300", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_phosphor_react38.Star, { size: 16, className: "text-white", weight: "regular" }) }),
|
|
17602
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-2xs font-bold uppercase text-center text-warning-600", children: "M\xE9dia da Turma" }),
|
|
17603
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-xl font-bold text-warning-600", children: data.generalStats.averageScore.toFixed(1) })
|
|
17393
17604
|
] }),
|
|
17394
|
-
/* @__PURE__ */ (0,
|
|
17395
|
-
/* @__PURE__ */ (0,
|
|
17396
|
-
/* @__PURE__ */ (0,
|
|
17397
|
-
/* @__PURE__ */ (0,
|
|
17605
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "border border-border-50 rounded-xl py-2 px-3 flex flex-col items-center justify-center gap-1 bg-success-200", children: [
|
|
17606
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "w-[30px] h-[30px] rounded-2xl flex items-center justify-center bg-indicator-positive", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_phosphor_react38.Medal, { size: 16, className: "text-text-950", weight: "regular" }) }),
|
|
17607
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-2xs font-bold uppercase text-center text-success-700", children: "Quest\xF5es com mais acertos" }),
|
|
17608
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-xl font-bold text-success-700", children: formatQuestionNumbers(data.questionStats.mostCorrect) })
|
|
17398
17609
|
] }),
|
|
17399
|
-
/* @__PURE__ */ (0,
|
|
17400
|
-
/* @__PURE__ */ (0,
|
|
17401
|
-
|
|
17610
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "border border-border-50 rounded-xl py-2 px-3 flex flex-col items-center justify-center gap-1 bg-error-100", children: [
|
|
17611
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "w-[30px] h-[30px] rounded-2xl flex items-center justify-center bg-indicator-negative", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17612
|
+
import_phosphor_react38.WarningCircle,
|
|
17402
17613
|
{
|
|
17403
17614
|
size: 16,
|
|
17404
17615
|
className: "text-white",
|
|
17405
17616
|
weight: "regular"
|
|
17406
17617
|
}
|
|
17407
17618
|
) }),
|
|
17408
|
-
/* @__PURE__ */ (0,
|
|
17409
|
-
/* @__PURE__ */ (0,
|
|
17619
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-2xs font-bold uppercase text-center text-error-700", children: "Quest\xF5es com mais erros" }),
|
|
17620
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-xl font-bold text-error-700", children: formatQuestionNumbers(data.questionStats.mostIncorrect) })
|
|
17410
17621
|
] }),
|
|
17411
|
-
/* @__PURE__ */ (0,
|
|
17412
|
-
/* @__PURE__ */ (0,
|
|
17413
|
-
|
|
17622
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "border border-border-50 rounded-xl py-2 px-3 flex flex-col items-center justify-center gap-1 bg-info-background", children: [
|
|
17623
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "w-[30px] h-[30px] rounded-2xl flex items-center justify-center bg-info-500", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17624
|
+
import_phosphor_react38.WarningCircle,
|
|
17414
17625
|
{
|
|
17415
17626
|
size: 16,
|
|
17416
17627
|
className: "text-white",
|
|
17417
17628
|
weight: "regular"
|
|
17418
17629
|
}
|
|
17419
17630
|
) }),
|
|
17420
|
-
/* @__PURE__ */ (0,
|
|
17421
|
-
/* @__PURE__ */ (0,
|
|
17631
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-2xs font-bold uppercase text-center text-info-700", children: "Quest\xF5es n\xE3o respondidas" }),
|
|
17632
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-xl font-bold text-info-700", children: formatQuestionNumbers(data.questionStats.notAnswered) })
|
|
17422
17633
|
] })
|
|
17423
17634
|
]
|
|
17424
17635
|
}
|
|
17425
17636
|
),
|
|
17426
|
-
correctionError && /* @__PURE__ */ (0,
|
|
17427
|
-
/* @__PURE__ */ (0,
|
|
17428
|
-
/* @__PURE__ */ (0,
|
|
17637
|
+
correctionError && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "w-full bg-error-50 border border-error-200 rounded-xl p-4 flex items-center gap-3", children: [
|
|
17638
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_phosphor_react38.WarningCircle, { size: 20, className: "text-error-600", weight: "fill" }),
|
|
17639
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text_default, { className: "text-error-700 text-sm", children: correctionError })
|
|
17429
17640
|
] }),
|
|
17430
|
-
/* @__PURE__ */ (0,
|
|
17641
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "w-full bg-background rounded-xl p-6 space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17431
17642
|
TableProvider,
|
|
17432
17643
|
{
|
|
17433
17644
|
data: tableData,
|
|
@@ -17444,7 +17655,7 @@ var ActivityDetails = ({
|
|
|
17444
17655
|
totalPages: data.pagination.totalPages
|
|
17445
17656
|
},
|
|
17446
17657
|
emptyState: {
|
|
17447
|
-
component: /* @__PURE__ */ (0,
|
|
17658
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17448
17659
|
EmptyState_default,
|
|
17449
17660
|
{
|
|
17450
17661
|
image: emptyStateImage,
|
|
@@ -17454,14 +17665,14 @@ var ActivityDetails = ({
|
|
|
17454
17665
|
)
|
|
17455
17666
|
},
|
|
17456
17667
|
onParamsChange: handleTableParamsChange,
|
|
17457
|
-
children: ({ table, pagination }) => /* @__PURE__ */ (0,
|
|
17668
|
+
children: ({ table, pagination }) => /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
17458
17669
|
table,
|
|
17459
17670
|
pagination
|
|
17460
17671
|
] })
|
|
17461
17672
|
}
|
|
17462
17673
|
) })
|
|
17463
17674
|
] }),
|
|
17464
|
-
/* @__PURE__ */ (0,
|
|
17675
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
17465
17676
|
CorrectActivityModal_default,
|
|
17466
17677
|
{
|
|
17467
17678
|
isOpen: isModalOpen,
|
|
@@ -17475,10 +17686,10 @@ var ActivityDetails = ({
|
|
|
17475
17686
|
};
|
|
17476
17687
|
|
|
17477
17688
|
// src/components/Support/Support.tsx
|
|
17478
|
-
var
|
|
17689
|
+
var import_react59 = require("react");
|
|
17479
17690
|
var import_react_hook_form = require("react-hook-form");
|
|
17480
17691
|
var import_zod2 = require("@hookform/resolvers/zod");
|
|
17481
|
-
var
|
|
17692
|
+
var import_react60 = require("@phosphor-icons/react");
|
|
17482
17693
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
17483
17694
|
|
|
17484
17695
|
// src/components/Support/schema/index.ts
|
|
@@ -17501,7 +17712,7 @@ var supportSchema = import_zod.z.object({
|
|
|
17501
17712
|
});
|
|
17502
17713
|
|
|
17503
17714
|
// src/components/Support/components/TicketModal.tsx
|
|
17504
|
-
var
|
|
17715
|
+
var import_react58 = require("react");
|
|
17505
17716
|
var import_dayjs = __toESM(require("dayjs"));
|
|
17506
17717
|
var import_pt_br = require("dayjs/locale/pt-br");
|
|
17507
17718
|
|
|
@@ -17581,37 +17792,37 @@ var mapInternalStatusToApi = (internalStatus) => {
|
|
|
17581
17792
|
};
|
|
17582
17793
|
|
|
17583
17794
|
// src/components/Support/utils/supportUtils.tsx
|
|
17584
|
-
var
|
|
17585
|
-
var
|
|
17795
|
+
var import_react57 = require("@phosphor-icons/react");
|
|
17796
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
17586
17797
|
var getCategoryIcon = (category, size = 16) => {
|
|
17587
17798
|
if (!category) return null;
|
|
17588
17799
|
switch (category) {
|
|
17589
17800
|
case "acesso" /* ACESSO */:
|
|
17590
|
-
return /* @__PURE__ */ (0,
|
|
17801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react57.KeyIcon, { size });
|
|
17591
17802
|
case "tecnico" /* TECNICO */:
|
|
17592
|
-
return /* @__PURE__ */ (0,
|
|
17803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react57.BugIcon, { size });
|
|
17593
17804
|
case "outros" /* OUTROS */:
|
|
17594
|
-
return /* @__PURE__ */ (0,
|
|
17805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react57.InfoIcon, { size });
|
|
17595
17806
|
default:
|
|
17596
|
-
return /* @__PURE__ */ (0,
|
|
17807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react57.InfoIcon, { size });
|
|
17597
17808
|
}
|
|
17598
17809
|
};
|
|
17599
17810
|
|
|
17600
17811
|
// src/components/Support/components/TicketModal.tsx
|
|
17601
|
-
var
|
|
17812
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
17602
17813
|
import_dayjs.default.locale("pt-br");
|
|
17603
|
-
var AnswerSkeleton = () => /* @__PURE__ */ (0,
|
|
17604
|
-
/* @__PURE__ */ (0,
|
|
17605
|
-
/* @__PURE__ */ (0,
|
|
17606
|
-
/* @__PURE__ */ (0,
|
|
17814
|
+
var AnswerSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "bg-background p-4 space-y-6 rounded-xl", children: [
|
|
17815
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-center space-x-6", children: [
|
|
17816
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SkeletonText, { width: "80px", height: 16 }),
|
|
17817
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SkeletonText, { width: "200px", height: 16 })
|
|
17607
17818
|
] }),
|
|
17608
|
-
/* @__PURE__ */ (0,
|
|
17609
|
-
/* @__PURE__ */ (0,
|
|
17610
|
-
/* @__PURE__ */ (0,
|
|
17611
|
-
/* @__PURE__ */ (0,
|
|
17612
|
-
/* @__PURE__ */ (0,
|
|
17613
|
-
/* @__PURE__ */ (0,
|
|
17614
|
-
/* @__PURE__ */ (0,
|
|
17819
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Divider_default, {}),
|
|
17820
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-start space-x-6", children: [
|
|
17821
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SkeletonText, { width: "80px", height: 16 }),
|
|
17822
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
17823
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SkeletonText, { width: "100%", height: 16 }),
|
|
17824
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SkeletonText, { width: "80%", height: 16 }),
|
|
17825
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SkeletonText, { width: "60%", height: 16 })
|
|
17615
17826
|
] })
|
|
17616
17827
|
] })
|
|
17617
17828
|
] });
|
|
@@ -17623,17 +17834,17 @@ var TicketModal = ({
|
|
|
17623
17834
|
apiClient,
|
|
17624
17835
|
userId
|
|
17625
17836
|
}) => {
|
|
17626
|
-
const [showCloseConfirmation, setShowCloseConfirmation] = (0,
|
|
17627
|
-
const [responseText, setResponseText] = (0,
|
|
17628
|
-
const [answers, setAnswers] = (0,
|
|
17629
|
-
const [isSubmittingAnswer, setIsSubmittingAnswer] = (0,
|
|
17630
|
-
const [isLoadingAnswers, setIsLoadingAnswers] = (0,
|
|
17837
|
+
const [showCloseConfirmation, setShowCloseConfirmation] = (0, import_react58.useState)(false);
|
|
17838
|
+
const [responseText, setResponseText] = (0, import_react58.useState)("");
|
|
17839
|
+
const [answers, setAnswers] = (0, import_react58.useState)([]);
|
|
17840
|
+
const [isSubmittingAnswer, setIsSubmittingAnswer] = (0, import_react58.useState)(false);
|
|
17841
|
+
const [isLoadingAnswers, setIsLoadingAnswers] = (0, import_react58.useState)(false);
|
|
17631
17842
|
const handleCloseTicket = () => {
|
|
17632
17843
|
onTicketClose?.(ticket.id);
|
|
17633
17844
|
setShowCloseConfirmation(false);
|
|
17634
17845
|
onClose();
|
|
17635
17846
|
};
|
|
17636
|
-
const fetchAnswers = (0,
|
|
17847
|
+
const fetchAnswers = (0, import_react58.useCallback)(async () => {
|
|
17637
17848
|
if (!ticket.id || ticket.status !== "respondido" /* RESPONDIDO */) return;
|
|
17638
17849
|
setIsLoadingAnswers(true);
|
|
17639
17850
|
try {
|
|
@@ -17672,7 +17883,7 @@ var TicketModal = ({
|
|
|
17672
17883
|
}
|
|
17673
17884
|
};
|
|
17674
17885
|
const canCloseTicket = ticket.status !== "encerrado" /* ENCERRADO */;
|
|
17675
|
-
(0,
|
|
17886
|
+
(0, import_react58.useEffect)(() => {
|
|
17676
17887
|
if (isOpen) {
|
|
17677
17888
|
setResponseText("");
|
|
17678
17889
|
(async () => {
|
|
@@ -17684,8 +17895,8 @@ var TicketModal = ({
|
|
|
17684
17895
|
setAnswers([]);
|
|
17685
17896
|
}
|
|
17686
17897
|
}, [isOpen, fetchAnswers]);
|
|
17687
|
-
return /* @__PURE__ */ (0,
|
|
17688
|
-
/* @__PURE__ */ (0,
|
|
17898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
17899
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17689
17900
|
Modal_default,
|
|
17690
17901
|
{
|
|
17691
17902
|
isOpen,
|
|
@@ -17695,10 +17906,10 @@ var TicketModal = ({
|
|
|
17695
17906
|
hideCloseButton: false,
|
|
17696
17907
|
closeOnEscape: true,
|
|
17697
17908
|
"data-testid": "ticket-modal",
|
|
17698
|
-
children: /* @__PURE__ */ (0,
|
|
17699
|
-
/* @__PURE__ */ (0,
|
|
17700
|
-
/* @__PURE__ */ (0,
|
|
17701
|
-
canCloseTicket && /* @__PURE__ */ (0,
|
|
17909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex flex-col h-full max-h-[80vh]", children: [
|
|
17910
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex justify-between items-center mb-3", children: [
|
|
17911
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text_default, { size: "md", weight: "bold", className: "text-text-950", children: "Detalhes" }),
|
|
17912
|
+
canCloseTicket && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17702
17913
|
Button_default,
|
|
17703
17914
|
{
|
|
17704
17915
|
variant: "outline",
|
|
@@ -17709,10 +17920,10 @@ var TicketModal = ({
|
|
|
17709
17920
|
}
|
|
17710
17921
|
)
|
|
17711
17922
|
] }),
|
|
17712
|
-
/* @__PURE__ */ (0,
|
|
17713
|
-
/* @__PURE__ */ (0,
|
|
17714
|
-
/* @__PURE__ */ (0,
|
|
17715
|
-
/* @__PURE__ */ (0,
|
|
17923
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex-1 overflow-y-auto pr-2 space-y-6", children: [
|
|
17924
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "bg-background p-4 space-y-6 rounded-xl", children: [
|
|
17925
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-center space-x-6", children: [
|
|
17926
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17716
17927
|
Text_default,
|
|
17717
17928
|
{
|
|
17718
17929
|
size: "md",
|
|
@@ -17721,10 +17932,10 @@ var TicketModal = ({
|
|
|
17721
17932
|
children: "ID"
|
|
17722
17933
|
}
|
|
17723
17934
|
),
|
|
17724
|
-
/* @__PURE__ */ (0,
|
|
17935
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text_default, { size: "md", weight: "normal", className: "text-text-600", children: ticket.id })
|
|
17725
17936
|
] }),
|
|
17726
|
-
/* @__PURE__ */ (0,
|
|
17727
|
-
/* @__PURE__ */ (0,
|
|
17937
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-center space-x-6", children: [
|
|
17938
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17728
17939
|
Text_default,
|
|
17729
17940
|
{
|
|
17730
17941
|
size: "md",
|
|
@@ -17733,10 +17944,10 @@ var TicketModal = ({
|
|
|
17733
17944
|
children: "Aberto em"
|
|
17734
17945
|
}
|
|
17735
17946
|
),
|
|
17736
|
-
/* @__PURE__ */ (0,
|
|
17947
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text_default, { size: "md", weight: "normal", className: "text-text-600", children: (0, import_dayjs.default)(ticket.createdAt).format("DD MMMM YYYY, [\xE0s] HH[h]") })
|
|
17737
17948
|
] }),
|
|
17738
|
-
/* @__PURE__ */ (0,
|
|
17739
|
-
/* @__PURE__ */ (0,
|
|
17949
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-center space-x-6", children: [
|
|
17950
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17740
17951
|
Text_default,
|
|
17741
17952
|
{
|
|
17742
17953
|
size: "md",
|
|
@@ -17745,7 +17956,7 @@ var TicketModal = ({
|
|
|
17745
17956
|
children: "Status"
|
|
17746
17957
|
}
|
|
17747
17958
|
),
|
|
17748
|
-
/* @__PURE__ */ (0,
|
|
17959
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17749
17960
|
Badge_default,
|
|
17750
17961
|
{
|
|
17751
17962
|
variant: "solid",
|
|
@@ -17756,8 +17967,8 @@ var TicketModal = ({
|
|
|
17756
17967
|
}
|
|
17757
17968
|
)
|
|
17758
17969
|
] }),
|
|
17759
|
-
/* @__PURE__ */ (0,
|
|
17760
|
-
/* @__PURE__ */ (0,
|
|
17970
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-center space-x-6", children: [
|
|
17971
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17761
17972
|
Text_default,
|
|
17762
17973
|
{
|
|
17763
17974
|
size: "md",
|
|
@@ -17766,7 +17977,7 @@ var TicketModal = ({
|
|
|
17766
17977
|
children: "Tipo"
|
|
17767
17978
|
}
|
|
17768
17979
|
),
|
|
17769
|
-
/* @__PURE__ */ (0,
|
|
17980
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
17770
17981
|
Badge_default,
|
|
17771
17982
|
{
|
|
17772
17983
|
variant: "solid",
|
|
@@ -17780,9 +17991,9 @@ var TicketModal = ({
|
|
|
17780
17991
|
}
|
|
17781
17992
|
)
|
|
17782
17993
|
] }),
|
|
17783
|
-
/* @__PURE__ */ (0,
|
|
17784
|
-
/* @__PURE__ */ (0,
|
|
17785
|
-
/* @__PURE__ */ (0,
|
|
17994
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Divider_default, {}),
|
|
17995
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-start space-x-6", children: [
|
|
17996
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17786
17997
|
Text_default,
|
|
17787
17998
|
{
|
|
17788
17999
|
size: "md",
|
|
@@ -17791,24 +18002,24 @@ var TicketModal = ({
|
|
|
17791
18002
|
children: "Descri\xE7\xE3o"
|
|
17792
18003
|
}
|
|
17793
18004
|
),
|
|
17794
|
-
ticket.description && /* @__PURE__ */ (0,
|
|
18005
|
+
ticket.description && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text_default, { size: "md", weight: "normal", className: "text-text-600", children: ticket.description })
|
|
17795
18006
|
] })
|
|
17796
18007
|
] }),
|
|
17797
|
-
ticket.status === "respondido" /* RESPONDIDO */ && isLoadingAnswers && /* @__PURE__ */ (0,
|
|
17798
|
-
/* @__PURE__ */ (0,
|
|
17799
|
-
/* @__PURE__ */ (0,
|
|
18008
|
+
ticket.status === "respondido" /* RESPONDIDO */ && isLoadingAnswers && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
18009
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text_default, { size: "md", weight: "bold", className: "text-text-950 my-6", children: "Resposta de Suporte T\xE9cnico" }),
|
|
18010
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(AnswerSkeleton, {})
|
|
17800
18011
|
] }),
|
|
17801
|
-
!isLoadingAnswers && answers.some((answer) => answer.userId !== userId) && /* @__PURE__ */ (0,
|
|
17802
|
-
/* @__PURE__ */ (0,
|
|
18012
|
+
!isLoadingAnswers && answers.some((answer) => answer.userId !== userId) && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
18013
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text_default, { size: "md", weight: "bold", className: "text-text-950 my-6", children: "Resposta de Suporte T\xE9cnico" }),
|
|
17803
18014
|
answers.filter((answer) => answer.userId !== userId).sort(
|
|
17804
18015
|
(a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
|
|
17805
|
-
).slice(0, 1).map((answer) => /* @__PURE__ */ (0,
|
|
18016
|
+
).slice(0, 1).map((answer) => /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
17806
18017
|
"div",
|
|
17807
18018
|
{
|
|
17808
18019
|
className: "bg-background p-4 space-y-6 rounded-xl",
|
|
17809
18020
|
children: [
|
|
17810
|
-
/* @__PURE__ */ (0,
|
|
17811
|
-
/* @__PURE__ */ (0,
|
|
18021
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-center space-x-6", children: [
|
|
18022
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17812
18023
|
Text_default,
|
|
17813
18024
|
{
|
|
17814
18025
|
size: "md",
|
|
@@ -17817,7 +18028,7 @@ var TicketModal = ({
|
|
|
17817
18028
|
children: "Recebido"
|
|
17818
18029
|
}
|
|
17819
18030
|
),
|
|
17820
|
-
/* @__PURE__ */ (0,
|
|
18031
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17821
18032
|
Text_default,
|
|
17822
18033
|
{
|
|
17823
18034
|
size: "md",
|
|
@@ -17829,9 +18040,9 @@ var TicketModal = ({
|
|
|
17829
18040
|
}
|
|
17830
18041
|
)
|
|
17831
18042
|
] }),
|
|
17832
|
-
/* @__PURE__ */ (0,
|
|
17833
|
-
/* @__PURE__ */ (0,
|
|
17834
|
-
/* @__PURE__ */ (0,
|
|
18043
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Divider_default, {}),
|
|
18044
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-start space-x-6", children: [
|
|
18045
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17835
18046
|
Text_default,
|
|
17836
18047
|
{
|
|
17837
18048
|
size: "md",
|
|
@@ -17840,7 +18051,7 @@ var TicketModal = ({
|
|
|
17840
18051
|
children: "Resposta"
|
|
17841
18052
|
}
|
|
17842
18053
|
),
|
|
17843
|
-
/* @__PURE__ */ (0,
|
|
18054
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17844
18055
|
Text_default,
|
|
17845
18056
|
{
|
|
17846
18057
|
size: "md",
|
|
@@ -17855,17 +18066,17 @@ var TicketModal = ({
|
|
|
17855
18066
|
answer.id
|
|
17856
18067
|
))
|
|
17857
18068
|
] }),
|
|
17858
|
-
!isLoadingAnswers && answers.some((answer) => answer.userId === userId) && /* @__PURE__ */ (0,
|
|
17859
|
-
/* @__PURE__ */ (0,
|
|
18069
|
+
!isLoadingAnswers && answers.some((answer) => answer.userId === userId) && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
18070
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text_default, { size: "md", weight: "bold", className: "text-text-950 my-6", children: "Resposta enviada" }),
|
|
17860
18071
|
answers.filter((answer) => answer.userId === userId).sort(
|
|
17861
18072
|
(a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
|
|
17862
|
-
).slice(0, 1).map((answer) => /* @__PURE__ */ (0,
|
|
18073
|
+
).slice(0, 1).map((answer) => /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
17863
18074
|
"div",
|
|
17864
18075
|
{
|
|
17865
18076
|
className: "bg-background p-4 space-y-6 rounded-xl",
|
|
17866
18077
|
children: [
|
|
17867
|
-
/* @__PURE__ */ (0,
|
|
17868
|
-
/* @__PURE__ */ (0,
|
|
18078
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-center space-x-6", children: [
|
|
18079
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17869
18080
|
Text_default,
|
|
17870
18081
|
{
|
|
17871
18082
|
size: "md",
|
|
@@ -17874,7 +18085,7 @@ var TicketModal = ({
|
|
|
17874
18085
|
children: "Enviada"
|
|
17875
18086
|
}
|
|
17876
18087
|
),
|
|
17877
|
-
/* @__PURE__ */ (0,
|
|
18088
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17878
18089
|
Text_default,
|
|
17879
18090
|
{
|
|
17880
18091
|
size: "md",
|
|
@@ -17886,9 +18097,9 @@ var TicketModal = ({
|
|
|
17886
18097
|
}
|
|
17887
18098
|
)
|
|
17888
18099
|
] }),
|
|
17889
|
-
/* @__PURE__ */ (0,
|
|
17890
|
-
/* @__PURE__ */ (0,
|
|
17891
|
-
/* @__PURE__ */ (0,
|
|
18100
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Divider_default, {}),
|
|
18101
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex items-start space-x-6", children: [
|
|
18102
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17892
18103
|
Text_default,
|
|
17893
18104
|
{
|
|
17894
18105
|
size: "md",
|
|
@@ -17897,7 +18108,7 @@ var TicketModal = ({
|
|
|
17897
18108
|
children: "Resposta"
|
|
17898
18109
|
}
|
|
17899
18110
|
),
|
|
17900
|
-
/* @__PURE__ */ (0,
|
|
18111
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17901
18112
|
Text_default,
|
|
17902
18113
|
{
|
|
17903
18114
|
size: "md",
|
|
@@ -17912,10 +18123,10 @@ var TicketModal = ({
|
|
|
17912
18123
|
answer.id
|
|
17913
18124
|
))
|
|
17914
18125
|
] }),
|
|
17915
|
-
!isLoadingAnswers && answers.some((answer) => answer.userId !== userId) && /* @__PURE__ */ (0,
|
|
17916
|
-
/* @__PURE__ */ (0,
|
|
17917
|
-
/* @__PURE__ */ (0,
|
|
17918
|
-
/* @__PURE__ */ (0,
|
|
18126
|
+
!isLoadingAnswers && answers.some((answer) => answer.userId !== userId) && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
18127
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-950 my-6", children: "Responder" }),
|
|
18128
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "space-y-4", children: [
|
|
18129
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17919
18130
|
TextArea_default,
|
|
17920
18131
|
{
|
|
17921
18132
|
placeholder: "Detalhe o problema aqui.",
|
|
@@ -17925,7 +18136,7 @@ var TicketModal = ({
|
|
|
17925
18136
|
onChange: (e) => setResponseText(e.target.value)
|
|
17926
18137
|
}
|
|
17927
18138
|
),
|
|
17928
|
-
responseText.trim().length > 0 && /* @__PURE__ */ (0,
|
|
18139
|
+
responseText.trim().length > 0 && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17929
18140
|
Button_default,
|
|
17930
18141
|
{
|
|
17931
18142
|
variant: "solid",
|
|
@@ -17941,7 +18152,7 @@ var TicketModal = ({
|
|
|
17941
18152
|
] })
|
|
17942
18153
|
}
|
|
17943
18154
|
),
|
|
17944
|
-
/* @__PURE__ */ (0,
|
|
18155
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17945
18156
|
Modal_default,
|
|
17946
18157
|
{
|
|
17947
18158
|
isOpen: showCloseConfirmation,
|
|
@@ -17951,10 +18162,10 @@ var TicketModal = ({
|
|
|
17951
18162
|
hideCloseButton: false,
|
|
17952
18163
|
closeOnEscape: true,
|
|
17953
18164
|
"data-testid": "close-ticket-modal",
|
|
17954
|
-
children: /* @__PURE__ */ (0,
|
|
17955
|
-
/* @__PURE__ */ (0,
|
|
17956
|
-
/* @__PURE__ */ (0,
|
|
17957
|
-
/* @__PURE__ */ (0,
|
|
18165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "space-y-6", children: [
|
|
18166
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text_default, { size: "sm", weight: "normal", className: "text-text-700", children: "Ao encerrar este pedido, ele ser\xE1 fechado e n\xE3o poder\xE1 mais ser atualizado." }),
|
|
18167
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex gap-3 justify-end", children: [
|
|
18168
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17958
18169
|
Button_default,
|
|
17959
18170
|
{
|
|
17960
18171
|
variant: "outline",
|
|
@@ -17963,7 +18174,7 @@ var TicketModal = ({
|
|
|
17963
18174
|
children: "Cancelar"
|
|
17964
18175
|
}
|
|
17965
18176
|
),
|
|
17966
|
-
/* @__PURE__ */ (0,
|
|
18177
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17967
18178
|
Button_default,
|
|
17968
18179
|
{
|
|
17969
18180
|
variant: "solid",
|
|
@@ -17984,20 +18195,20 @@ var TicketModal = ({
|
|
|
17984
18195
|
var suporthistory_default = "./suporthistory-W5LBGAUP.png";
|
|
17985
18196
|
|
|
17986
18197
|
// src/components/Support/Support.tsx
|
|
17987
|
-
var
|
|
18198
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
17988
18199
|
var TicketCard = ({
|
|
17989
18200
|
ticket,
|
|
17990
18201
|
onTicketClick
|
|
17991
|
-
}) => /* @__PURE__ */ (0,
|
|
18202
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
17992
18203
|
"button",
|
|
17993
18204
|
{
|
|
17994
18205
|
type: "button",
|
|
17995
18206
|
className: "flex items-center justify-between p-4 bg-background rounded-xl cursor-pointer w-full text-left hover:bg-background-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",
|
|
17996
18207
|
onClick: () => onTicketClick(ticket),
|
|
17997
18208
|
children: [
|
|
17998
|
-
/* @__PURE__ */ (0,
|
|
17999
|
-
/* @__PURE__ */ (0,
|
|
18000
|
-
/* @__PURE__ */ (0,
|
|
18209
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text_default, { size: "xs", weight: "bold", className: "text-text-900", children: ticket.title }) }),
|
|
18210
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
18211
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18001
18212
|
Badge_default,
|
|
18002
18213
|
{
|
|
18003
18214
|
variant: "solid",
|
|
@@ -18006,11 +18217,11 @@ var TicketCard = ({
|
|
|
18006
18217
|
children: getStatusText(ticket.status)
|
|
18007
18218
|
}
|
|
18008
18219
|
),
|
|
18009
|
-
/* @__PURE__ */ (0,
|
|
18220
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Badge_default, { variant: "solid", className: "flex items-center gap-1", action: "muted", children: [
|
|
18010
18221
|
getCategoryIcon(ticket.category, 18),
|
|
18011
18222
|
getCategoryText(ticket.category)
|
|
18012
18223
|
] }),
|
|
18013
|
-
/* @__PURE__ */ (0,
|
|
18224
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react60.CaretRightIcon, { size: 24, className: "text-text-800" })
|
|
18014
18225
|
] })
|
|
18015
18226
|
]
|
|
18016
18227
|
},
|
|
@@ -18020,9 +18231,9 @@ var TicketGroup = ({
|
|
|
18020
18231
|
date,
|
|
18021
18232
|
tickets,
|
|
18022
18233
|
onTicketClick
|
|
18023
|
-
}) => /* @__PURE__ */ (0,
|
|
18024
|
-
/* @__PURE__ */ (0,
|
|
18025
|
-
/* @__PURE__ */ (0,
|
|
18234
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "space-y-4", children: [
|
|
18235
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text_default, { size: "md", weight: "bold", className: "text-text-900", children: (0, import_dayjs2.default)(date).format("DD MMM YYYY") }),
|
|
18236
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "space-y-3", children: tickets.map((ticket) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18026
18237
|
TicketCard,
|
|
18027
18238
|
{
|
|
18028
18239
|
ticket,
|
|
@@ -18031,13 +18242,13 @@ var TicketGroup = ({
|
|
|
18031
18242
|
ticket.id
|
|
18032
18243
|
)) })
|
|
18033
18244
|
] }, date);
|
|
18034
|
-
var EmptyState2 = ({ imageSrc }) => /* @__PURE__ */ (0,
|
|
18035
|
-
imageSrc && /* @__PURE__ */ (0,
|
|
18036
|
-
/* @__PURE__ */ (0,
|
|
18245
|
+
var EmptyState2 = ({ imageSrc }) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex flex-row justify-center items-center mt-48", children: [
|
|
18246
|
+
imageSrc && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("img", { src: imageSrc, alt: "Imagem de suporte" }),
|
|
18247
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text_default, { size: "3xl", weight: "semibold", children: "Nenhum pedido encontrado." })
|
|
18037
18248
|
] });
|
|
18038
|
-
var TicketSkeleton = () => /* @__PURE__ */ (0,
|
|
18039
|
-
/* @__PURE__ */ (0,
|
|
18040
|
-
/* @__PURE__ */ (0,
|
|
18249
|
+
var TicketSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "space-y-6", children: [0, 1].map((groupIndex) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "space-y-4", children: [
|
|
18250
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SkeletonText, { width: "150px", height: 20 }),
|
|
18251
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "space-y-3", children: [0, 1].map((ticketIndex) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18041
18252
|
SkeletonRounded,
|
|
18042
18253
|
{
|
|
18043
18254
|
width: "100%",
|
|
@@ -18055,21 +18266,21 @@ var Support = ({
|
|
|
18055
18266
|
onTicketCreated,
|
|
18056
18267
|
onTicketClosed
|
|
18057
18268
|
}) => {
|
|
18058
|
-
const [activeTab, setActiveTab] = (0,
|
|
18059
|
-
const [selectedProblem, setSelectedProblem] = (0,
|
|
18060
|
-
const [statusFilter, setStatusFilter] = (0,
|
|
18061
|
-
const [categoryFilter, setCategoryFilter] = (0,
|
|
18062
|
-
const [selectedTicket, setSelectedTicket] = (0,
|
|
18269
|
+
const [activeTab, setActiveTab] = (0, import_react59.useState)("criar-pedido");
|
|
18270
|
+
const [selectedProblem, setSelectedProblem] = (0, import_react59.useState)(null);
|
|
18271
|
+
const [statusFilter, setStatusFilter] = (0, import_react59.useState)("todos");
|
|
18272
|
+
const [categoryFilter, setCategoryFilter] = (0, import_react59.useState)("todos");
|
|
18273
|
+
const [selectedTicket, setSelectedTicket] = (0, import_react59.useState)(
|
|
18063
18274
|
null
|
|
18064
18275
|
);
|
|
18065
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
18066
|
-
const [submitError, setSubmitError] = (0,
|
|
18067
|
-
const [showSuccessToast, setShowSuccessToast] = (0,
|
|
18068
|
-
const [showCloseSuccessToast, setShowCloseSuccessToast] = (0,
|
|
18069
|
-
const [showCloseErrorToast, setShowCloseErrorToast] = (0,
|
|
18070
|
-
const [allTickets, setAllTickets] = (0,
|
|
18071
|
-
const [loadingTickets, setLoadingTickets] = (0,
|
|
18072
|
-
const [currentPage, setCurrentPage] = (0,
|
|
18276
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react59.useState)(false);
|
|
18277
|
+
const [submitError, setSubmitError] = (0, import_react59.useState)(null);
|
|
18278
|
+
const [showSuccessToast, setShowSuccessToast] = (0, import_react59.useState)(false);
|
|
18279
|
+
const [showCloseSuccessToast, setShowCloseSuccessToast] = (0, import_react59.useState)(false);
|
|
18280
|
+
const [showCloseErrorToast, setShowCloseErrorToast] = (0, import_react59.useState)(false);
|
|
18281
|
+
const [allTickets, setAllTickets] = (0, import_react59.useState)([]);
|
|
18282
|
+
const [loadingTickets, setLoadingTickets] = (0, import_react59.useState)(false);
|
|
18283
|
+
const [currentPage, setCurrentPage] = (0, import_react59.useState)(1);
|
|
18073
18284
|
const ITEMS_PER_PAGE = 10;
|
|
18074
18285
|
const handlePrevPage = () => {
|
|
18075
18286
|
if (currentPage > 1) {
|
|
@@ -18082,13 +18293,13 @@ var Support = ({
|
|
|
18082
18293
|
setCurrentPage(currentPage + 1);
|
|
18083
18294
|
}
|
|
18084
18295
|
};
|
|
18085
|
-
(0,
|
|
18296
|
+
(0, import_react59.useEffect)(() => {
|
|
18086
18297
|
if (activeTab === "historico") {
|
|
18087
18298
|
fetchTickets(statusFilter);
|
|
18088
18299
|
setCurrentPage(1);
|
|
18089
18300
|
}
|
|
18090
18301
|
}, [activeTab, statusFilter]);
|
|
18091
|
-
(0,
|
|
18302
|
+
(0, import_react59.useEffect)(() => {
|
|
18092
18303
|
setCurrentPage(1);
|
|
18093
18304
|
}, [categoryFilter]);
|
|
18094
18305
|
const convertApiTicketToComponent = (apiTicket) => {
|
|
@@ -18218,25 +18429,25 @@ var Support = ({
|
|
|
18218
18429
|
{
|
|
18219
18430
|
id: "tecnico" /* TECNICO */,
|
|
18220
18431
|
title: "T\xE9cnico",
|
|
18221
|
-
icon: /* @__PURE__ */ (0,
|
|
18432
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react60.BugIcon, { size: 24 })
|
|
18222
18433
|
},
|
|
18223
18434
|
{
|
|
18224
18435
|
id: "acesso" /* ACESSO */,
|
|
18225
18436
|
title: "Acesso",
|
|
18226
|
-
icon: /* @__PURE__ */ (0,
|
|
18437
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react60.KeyIcon, { size: 24 })
|
|
18227
18438
|
},
|
|
18228
18439
|
{
|
|
18229
18440
|
id: "outros" /* OUTROS */,
|
|
18230
18441
|
title: "Outros",
|
|
18231
|
-
icon: /* @__PURE__ */ (0,
|
|
18442
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react60.InfoIcon, { size: 24 })
|
|
18232
18443
|
}
|
|
18233
18444
|
];
|
|
18234
18445
|
const emptyImage = emptyStateImage || suporthistory_default;
|
|
18235
|
-
return /* @__PURE__ */ (0,
|
|
18236
|
-
/* @__PURE__ */ (0,
|
|
18237
|
-
/* @__PURE__ */ (0,
|
|
18238
|
-
/* @__PURE__ */ (0,
|
|
18239
|
-
/* @__PURE__ */ (0,
|
|
18446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex flex-col w-full h-full relative justify-start items-center mb-5 overflow-y-auto", children: [
|
|
18447
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex flex-col w-full h-full max-w-[992px] z-10 lg:px-0 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "space-y-4", children: [
|
|
18448
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex w-full mb-4 flex-row items-center justify-between not-lg:gap-4 lg:gap-6", children: [
|
|
18449
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("h1", { className: "font-bold leading-[28px] tracking-[0.2px] text-text-950 text-xl mt-4 sm:text-2xl sm:flex-1 sm:self-end sm:mt-0", children: title }),
|
|
18450
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "sm:flex-shrink-0 sm:self-end", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18240
18451
|
Menu_default,
|
|
18241
18452
|
{
|
|
18242
18453
|
value: activeTab,
|
|
@@ -18244,8 +18455,8 @@ var Support = ({
|
|
|
18244
18455
|
variant: "menu2",
|
|
18245
18456
|
onValueChange: (value) => setActiveTab(value),
|
|
18246
18457
|
className: "bg-transparent shadow-none px-0",
|
|
18247
|
-
children: /* @__PURE__ */ (0,
|
|
18248
|
-
/* @__PURE__ */ (0,
|
|
18458
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(MenuContent, { variant: "menu2", children: [
|
|
18459
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18249
18460
|
MenuItem,
|
|
18250
18461
|
{
|
|
18251
18462
|
variant: "menu2",
|
|
@@ -18254,7 +18465,7 @@ var Support = ({
|
|
|
18254
18465
|
children: "Criar Pedido"
|
|
18255
18466
|
}
|
|
18256
18467
|
),
|
|
18257
|
-
/* @__PURE__ */ (0,
|
|
18468
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18258
18469
|
MenuItem,
|
|
18259
18470
|
{
|
|
18260
18471
|
variant: "menu2",
|
|
@@ -18267,9 +18478,9 @@ var Support = ({
|
|
|
18267
18478
|
}
|
|
18268
18479
|
) })
|
|
18269
18480
|
] }),
|
|
18270
|
-
activeTab === "criar-pedido" && /* @__PURE__ */ (0,
|
|
18271
|
-
/* @__PURE__ */ (0,
|
|
18272
|
-
/* @__PURE__ */ (0,
|
|
18481
|
+
activeTab === "criar-pedido" && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "space-y-2", children: [
|
|
18482
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text_default, { as: "h2", size: "md", weight: "bold", className: "text-text-900", children: "Selecione o tipo de problema" }),
|
|
18483
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex flex-col sm:flex-row gap-2 sm:gap-4", children: problemTypes.map((type) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18273
18484
|
SelectionButton_default,
|
|
18274
18485
|
{
|
|
18275
18486
|
icon: type.icon,
|
|
@@ -18280,10 +18491,10 @@ var Support = ({
|
|
|
18280
18491
|
},
|
|
18281
18492
|
type.id
|
|
18282
18493
|
)) }),
|
|
18283
|
-
errors.problemType && /* @__PURE__ */ (0,
|
|
18494
|
+
errors.problemType && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text_default, { size: "sm", className: "text-red-500 mt-1", children: errors.problemType.message })
|
|
18284
18495
|
] }),
|
|
18285
|
-
selectedProblem && activeTab === "criar-pedido" && /* @__PURE__ */ (0,
|
|
18286
|
-
/* @__PURE__ */ (0,
|
|
18496
|
+
selectedProblem && activeTab === "criar-pedido" && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
18497
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18287
18498
|
Input_default,
|
|
18288
18499
|
{
|
|
18289
18500
|
size: "large",
|
|
@@ -18294,7 +18505,7 @@ var Support = ({
|
|
|
18294
18505
|
errorMessage: errors.title?.message
|
|
18295
18506
|
}
|
|
18296
18507
|
) }),
|
|
18297
|
-
/* @__PURE__ */ (0,
|
|
18508
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18298
18509
|
TextArea_default,
|
|
18299
18510
|
{
|
|
18300
18511
|
size: "large",
|
|
@@ -18304,7 +18515,7 @@ var Support = ({
|
|
|
18304
18515
|
errorMessage: errors.description?.message
|
|
18305
18516
|
}
|
|
18306
18517
|
) }),
|
|
18307
|
-
/* @__PURE__ */ (0,
|
|
18518
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18308
18519
|
Button_default,
|
|
18309
18520
|
{
|
|
18310
18521
|
size: "large",
|
|
@@ -18314,11 +18525,11 @@ var Support = ({
|
|
|
18314
18525
|
children: isSubmitting ? "Enviando..." : "Enviar Pedido"
|
|
18315
18526
|
}
|
|
18316
18527
|
),
|
|
18317
|
-
submitError && /* @__PURE__ */ (0,
|
|
18528
|
+
submitError && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "mt-4 p-4 bg-red-100 border border-red-400 text-red-700 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text_default, { size: "sm", className: "text-red-700", children: submitError }) })
|
|
18318
18529
|
] }),
|
|
18319
|
-
activeTab === "historico" && /* @__PURE__ */ (0,
|
|
18320
|
-
/* @__PURE__ */ (0,
|
|
18321
|
-
/* @__PURE__ */ (0,
|
|
18530
|
+
activeTab === "historico" && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "space-y-6", children: [
|
|
18531
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex gap-4", children: [
|
|
18532
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex flex-col flex-1/2 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
18322
18533
|
Select_default,
|
|
18323
18534
|
{
|
|
18324
18535
|
label: "Status",
|
|
@@ -18326,17 +18537,17 @@ var Support = ({
|
|
|
18326
18537
|
value: statusFilter,
|
|
18327
18538
|
onValueChange: setStatusFilter,
|
|
18328
18539
|
children: [
|
|
18329
|
-
/* @__PURE__ */ (0,
|
|
18330
|
-
/* @__PURE__ */ (0,
|
|
18331
|
-
/* @__PURE__ */ (0,
|
|
18332
|
-
/* @__PURE__ */ (0,
|
|
18333
|
-
/* @__PURE__ */ (0,
|
|
18334
|
-
/* @__PURE__ */ (0,
|
|
18540
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectTrigger, { variant: "rounded", className: "", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectValue, { placeholder: "Todos" }) }),
|
|
18541
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(SelectContent, { children: [
|
|
18542
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectItem, { value: "todos", children: "Todos" }),
|
|
18543
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectItem, { value: "aberto" /* ABERTO */, children: "Aberto" }),
|
|
18544
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectItem, { value: "respondido" /* RESPONDIDO */, children: "Respondido" }),
|
|
18545
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectItem, { value: "encerrado" /* ENCERRADO */, children: "Encerrado" })
|
|
18335
18546
|
] })
|
|
18336
18547
|
]
|
|
18337
18548
|
}
|
|
18338
18549
|
) }),
|
|
18339
|
-
/* @__PURE__ */ (0,
|
|
18550
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex flex-col flex-1/2 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
18340
18551
|
Select_default,
|
|
18341
18552
|
{
|
|
18342
18553
|
label: "Tipo",
|
|
@@ -18344,19 +18555,19 @@ var Support = ({
|
|
|
18344
18555
|
value: categoryFilter,
|
|
18345
18556
|
onValueChange: setCategoryFilter,
|
|
18346
18557
|
children: [
|
|
18347
|
-
/* @__PURE__ */ (0,
|
|
18348
|
-
/* @__PURE__ */ (0,
|
|
18349
|
-
/* @__PURE__ */ (0,
|
|
18350
|
-
/* @__PURE__ */ (0,
|
|
18351
|
-
/* @__PURE__ */ (0,
|
|
18558
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectTrigger, { variant: "rounded", className: "", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectValue, { placeholder: "Todos" }) }),
|
|
18559
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(SelectContent, { children: [
|
|
18560
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectItem, { value: "todos", children: "Todos" }),
|
|
18561
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(SelectItem, { value: "tecnico" /* TECNICO */, children: [
|
|
18562
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react60.BugIcon, { size: 16 }),
|
|
18352
18563
|
" T\xE9cnico"
|
|
18353
18564
|
] }),
|
|
18354
|
-
/* @__PURE__ */ (0,
|
|
18355
|
-
/* @__PURE__ */ (0,
|
|
18565
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(SelectItem, { value: "acesso" /* ACESSO */, children: [
|
|
18566
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react60.KeyIcon, { size: 16 }),
|
|
18356
18567
|
" Acesso"
|
|
18357
18568
|
] }),
|
|
18358
|
-
/* @__PURE__ */ (0,
|
|
18359
|
-
/* @__PURE__ */ (0,
|
|
18569
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(SelectItem, { value: "outros" /* OUTROS */, children: [
|
|
18570
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react60.InfoIcon, { size: 16 }),
|
|
18360
18571
|
" Outros"
|
|
18361
18572
|
] })
|
|
18362
18573
|
] })
|
|
@@ -18366,14 +18577,14 @@ var Support = ({
|
|
|
18366
18577
|
] }),
|
|
18367
18578
|
(() => {
|
|
18368
18579
|
if (loadingTickets) {
|
|
18369
|
-
return /* @__PURE__ */ (0,
|
|
18580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(TicketSkeleton, {});
|
|
18370
18581
|
}
|
|
18371
18582
|
if (Object.keys(groupedTickets).length === 0) {
|
|
18372
|
-
return /* @__PURE__ */ (0,
|
|
18583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EmptyState2, { imageSrc: emptyImage });
|
|
18373
18584
|
}
|
|
18374
|
-
return /* @__PURE__ */ (0,
|
|
18585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "space-y-6", children: Object.entries(groupedTickets).sort(
|
|
18375
18586
|
([a], [b]) => new Date(b).getTime() - new Date(a).getTime()
|
|
18376
|
-
).map(([date, tickets]) => /* @__PURE__ */ (0,
|
|
18587
|
+
).map(([date, tickets]) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18377
18588
|
TicketGroup,
|
|
18378
18589
|
{
|
|
18379
18590
|
date,
|
|
@@ -18383,8 +18594,8 @@ var Support = ({
|
|
|
18383
18594
|
date
|
|
18384
18595
|
)) });
|
|
18385
18596
|
})(),
|
|
18386
|
-
!loadingTickets && totalPages > 1 && /* @__PURE__ */ (0,
|
|
18387
|
-
/* @__PURE__ */ (0,
|
|
18597
|
+
!loadingTickets && totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex justify-center items-center gap-4 mt-6", children: [
|
|
18598
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18388
18599
|
Button_default,
|
|
18389
18600
|
{
|
|
18390
18601
|
variant: "outline",
|
|
@@ -18394,13 +18605,13 @@ var Support = ({
|
|
|
18394
18605
|
children: "Anterior"
|
|
18395
18606
|
}
|
|
18396
18607
|
),
|
|
18397
|
-
/* @__PURE__ */ (0,
|
|
18608
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Text_default, { size: "sm", className: "text-text-600", children: [
|
|
18398
18609
|
"P\xE1gina ",
|
|
18399
18610
|
currentPage,
|
|
18400
18611
|
" de ",
|
|
18401
18612
|
totalPages
|
|
18402
18613
|
] }),
|
|
18403
|
-
/* @__PURE__ */ (0,
|
|
18614
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18404
18615
|
Button_default,
|
|
18405
18616
|
{
|
|
18406
18617
|
variant: "outline",
|
|
@@ -18413,7 +18624,7 @@ var Support = ({
|
|
|
18413
18624
|
] })
|
|
18414
18625
|
] })
|
|
18415
18626
|
] }) }),
|
|
18416
|
-
selectedTicket && /* @__PURE__ */ (0,
|
|
18627
|
+
selectedTicket && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18417
18628
|
TicketModal,
|
|
18418
18629
|
{
|
|
18419
18630
|
ticket: selectedTicket,
|
|
@@ -18424,7 +18635,7 @@ var Support = ({
|
|
|
18424
18635
|
userId
|
|
18425
18636
|
}
|
|
18426
18637
|
),
|
|
18427
|
-
showSuccessToast && /* @__PURE__ */ (0,
|
|
18638
|
+
showSuccessToast && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "fixed top-4 left-1/2 transform -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18428
18639
|
Toast_default,
|
|
18429
18640
|
{
|
|
18430
18641
|
title: "Pedido enviado!",
|
|
@@ -18433,7 +18644,7 @@ var Support = ({
|
|
|
18433
18644
|
onClose: () => setShowSuccessToast(false)
|
|
18434
18645
|
}
|
|
18435
18646
|
) }),
|
|
18436
|
-
showCloseSuccessToast && /* @__PURE__ */ (0,
|
|
18647
|
+
showCloseSuccessToast && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "fixed top-4 left-1/2 transform -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18437
18648
|
Toast_default,
|
|
18438
18649
|
{
|
|
18439
18650
|
title: "Pedido encerrado!",
|
|
@@ -18442,7 +18653,7 @@ var Support = ({
|
|
|
18442
18653
|
onClose: () => setShowCloseSuccessToast(false)
|
|
18443
18654
|
}
|
|
18444
18655
|
) }),
|
|
18445
|
-
showCloseErrorToast && /* @__PURE__ */ (0,
|
|
18656
|
+
showCloseErrorToast && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "fixed top-4 left-1/2 transform -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
18446
18657
|
Toast_default,
|
|
18447
18658
|
{
|
|
18448
18659
|
title: "Erro ao encerrar pedido",
|
|
@@ -18459,6 +18670,7 @@ var Support_default = Support;
|
|
|
18459
18670
|
0 && (module.exports = {
|
|
18460
18671
|
ANSWER_STATUS,
|
|
18461
18672
|
AccordionGroup,
|
|
18673
|
+
ActivityCardQuestionBanks,
|
|
18462
18674
|
ActivityDetails,
|
|
18463
18675
|
ActivityFilters,
|
|
18464
18676
|
ActivityFiltersPopover,
|