@cuemath/leap 3.5.29-as2 → 3.5.29-as3
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/features/timeline/monthly-report/api/use-monthly-report-get.js +5 -4
- package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js +9 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js +28 -27
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js.map +1 -1
- package/dist/features/timeline/monthly-report/monthly-report.js +35 -32
- package/dist/features/timeline/monthly-report/monthly-report.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { createGetAPI as r, createPatchAPI as o } from "@cuemath/rest-api";
|
|
2
2
|
import { BASE_URL_V1 as e } from "../../../../constants/api.js";
|
|
3
|
-
const { useGet:
|
|
3
|
+
const { useGet: p, invalidate: a } = r({
|
|
4
4
|
getURL: (t) => `${e}/monthly-progress-reports/${t}`
|
|
5
|
-
}), { usePatch:
|
|
5
|
+
}), { usePatch: h } = o({
|
|
6
6
|
getURL: (t) => `${e}/monthly-progress-reports/${t}`
|
|
7
7
|
});
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
p as useMonthlyReportGet,
|
|
10
|
+
a as useMonthlyReportInvalidate,
|
|
11
|
+
h as useMonthlyReportPatch
|
|
11
12
|
};
|
|
12
13
|
//# sourceMappingURL=use-monthly-report-get.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-monthly-report-get.js","sources":["../../../../../src/features/timeline/monthly-report/api/use-monthly-report-get.ts"],"sourcesContent":["import { createGetAPI, createPatchAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\nimport { type IMonthlyReportResponse } from '../monthly-report-types';\n\nconst { useGet: useMonthlyReportGet }
|
|
1
|
+
{"version":3,"file":"use-monthly-report-get.js","sources":["../../../../../src/features/timeline/monthly-report/api/use-monthly-report-get.ts"],"sourcesContent":["import { createGetAPI, createPatchAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\nimport { type IMonthlyReportResponse } from '../monthly-report-types';\n\nconst { useGet: useMonthlyReportGet, invalidate: useMonthlyReportInvalidate } =\n createGetAPI<IMonthlyReportResponse>({\n getURL: (reportId: string) => {\n return `${BASE_URL_V1}/monthly-progress-reports/${reportId}`;\n },\n });\n\nconst { usePatch: useMonthlyReportPatch } = createPatchAPI<\n IMonthlyReportResponse,\n { feedback: string }\n>({\n getURL: (reportId: string) => {\n return `${BASE_URL_V1}/monthly-progress-reports/${reportId}`;\n },\n});\n\nexport { useMonthlyReportGet, useMonthlyReportPatch, useMonthlyReportInvalidate };\n"],"names":["useMonthlyReportGet","useMonthlyReportInvalidate","createGetAPI","reportId","BASE_URL_V1","useMonthlyReportPatch","createPatchAPI"],"mappings":";;AAKA,MAAM,EAAE,QAAQA,GAAqB,YAAYC,EAAA,IAC/CC,EAAqC;AAAA,EACnC,QAAQ,CAACC,MACA,GAAGC,CAAW,6BAA6BD,CAAQ;AAE9D,CAAC,GAEG,EAAE,UAAUE,EAAsB,IAAIC,EAG1C;AAAA,EACA,QAAQ,CAACH,MACA,GAAGC,CAAW,6BAA6BD,CAAQ;AAE9D,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-styled.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/feedback/feedback-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport const FeedbackContainer = styled(FlexView)`\n margin: 0 -16px;\n`;\n"],"names":["FeedbackContainer","styled","FlexView"],"mappings":";;AAGa,MAAAA,IAAoBC,EAAOC,CAAQ;AAAA;AAAA;"}
|
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
2
|
+
import { memo as X, useCallback as i } from "react";
|
|
3
|
+
import s from "../../../../ui/layout/flex-view.js";
|
|
4
4
|
import { ILLUSTRATIONS as p } from "../../../../../assets/illustrations/illustrations.js";
|
|
5
5
|
import g from "../../../../ui/image/image.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useMonthlyReportInvalidate as w, useMonthlyReportPatch as y } from "../../api/use-monthly-report-get.js";
|
|
7
7
|
import $ from "../../../../ui/separator/separator.js";
|
|
8
|
-
import
|
|
8
|
+
import P from "../../../../ui/text/text.js";
|
|
9
9
|
import f from "../../../../ui/buttons/clickable/clickable.js";
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import { FeedbackContainer as x } from "./feedback-styled.js";
|
|
11
|
+
const R = ({
|
|
12
|
+
reportId: n,
|
|
12
13
|
studentName: b,
|
|
13
14
|
onFeedback: l,
|
|
14
|
-
studentCourseId:
|
|
15
|
-
showSnackbar:
|
|
15
|
+
studentCourseId: a,
|
|
16
|
+
showSnackbar: h
|
|
16
17
|
}) => {
|
|
17
|
-
const
|
|
18
|
+
const u = i(
|
|
18
19
|
(r, o) => {
|
|
19
|
-
r &&
|
|
20
|
+
r && h && h({
|
|
20
21
|
type: "error",
|
|
21
22
|
message: "Something went wrong. Please try again.",
|
|
22
23
|
bgColor: "red"
|
|
23
|
-
}), !r && l && (o != null && o.feedback) && l(o.feedback,
|
|
24
|
+
}), !r && l && (o != null && o.feedback) && (w(n), l(o.feedback, a));
|
|
24
25
|
},
|
|
25
|
-
[l,
|
|
26
|
-
), { patch: m, isProcessing: d } =
|
|
27
|
-
onComplete:
|
|
26
|
+
[l, a]
|
|
27
|
+
), { patch: m, isProcessing: d } = y({
|
|
28
|
+
onComplete: u
|
|
28
29
|
}), t = i(
|
|
29
30
|
(r) => {
|
|
30
|
-
m(
|
|
31
|
+
m(n, { feedback: r });
|
|
31
32
|
},
|
|
32
|
-
[
|
|
33
|
-
),
|
|
33
|
+
[n, m]
|
|
34
|
+
), C = i(() => {
|
|
34
35
|
t("positive");
|
|
35
|
-
}, [t]),
|
|
36
|
+
}, [t]), k = i(() => {
|
|
36
37
|
t("negative");
|
|
37
38
|
}, [t]);
|
|
38
|
-
return /* @__PURE__ */ c(
|
|
39
|
-
/* @__PURE__ */ c(
|
|
39
|
+
return /* @__PURE__ */ c(x, { $gapX: 1.25, $background: "WHITE_3", children: [
|
|
40
|
+
/* @__PURE__ */ c(P, { $renderAs: "ab2-black", $color: "BLACK_1", $align: "center", children: [
|
|
40
41
|
"Are you happy with ",
|
|
41
42
|
b ?? "her",
|
|
42
43
|
" progress?"
|
|
43
44
|
] }),
|
|
44
45
|
/* @__PURE__ */ e($, { heightX: 1.5 }),
|
|
45
|
-
/* @__PURE__ */ c(
|
|
46
|
+
/* @__PURE__ */ c(s, { $flexDirection: "row", $flexGapX: 3, $alignItems: "center", $justifyContent: "center", children: [
|
|
46
47
|
/* @__PURE__ */ e(
|
|
47
48
|
f,
|
|
48
49
|
{
|
|
49
50
|
label: "Report thumps up",
|
|
50
51
|
disabled: d,
|
|
51
|
-
onClick:
|
|
52
|
+
onClick: C,
|
|
52
53
|
children: /* @__PURE__ */ e(
|
|
53
|
-
|
|
54
|
+
s,
|
|
54
55
|
{
|
|
55
56
|
$widthX: 5,
|
|
56
57
|
$heightX: 5,
|
|
@@ -68,9 +69,9 @@ const P = ({
|
|
|
68
69
|
{
|
|
69
70
|
label: "Report thumps down",
|
|
70
71
|
disabled: d,
|
|
71
|
-
onClick:
|
|
72
|
+
onClick: k,
|
|
72
73
|
children: /* @__PURE__ */ e(
|
|
73
|
-
|
|
74
|
+
s,
|
|
74
75
|
{
|
|
75
76
|
$widthX: 5,
|
|
76
77
|
$heightX: 5,
|
|
@@ -86,8 +87,8 @@ const P = ({
|
|
|
86
87
|
] }),
|
|
87
88
|
/* @__PURE__ */ e($, { heightX: 1.5 })
|
|
88
89
|
] });
|
|
89
|
-
},
|
|
90
|
+
}, U = X(R);
|
|
90
91
|
export {
|
|
91
|
-
|
|
92
|
+
U as default
|
|
92
93
|
};
|
|
93
94
|
//# sourceMappingURL=feedback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/feedback/feedback.tsx"],"sourcesContent":["import { memo, useCallback } from 'react';\n\nimport type { IMonthlyReportResponse, TFeedback } from '../../monthly-report-types';\nimport type { IFeedbackTypesProps } from './feedback-types';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport Image from '../../../../ui/image/image';\nimport {
|
|
1
|
+
{"version":3,"file":"feedback.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/feedback/feedback.tsx"],"sourcesContent":["import { memo, useCallback } from 'react';\n\nimport type { IMonthlyReportResponse, TFeedback } from '../../monthly-report-types';\nimport type { IFeedbackTypesProps } from './feedback-types';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport Image from '../../../../ui/image/image';\nimport {\n useMonthlyReportInvalidate,\n useMonthlyReportPatch,\n} from '../../api/use-monthly-report-get';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\n\nimport * as Styled from './feedback-styled';\n\nconst Feedback = ({\n reportId,\n studentName,\n onFeedback,\n studentCourseId,\n showSnackbar,\n}: IFeedbackTypesProps) => {\n const onComplete = useCallback(\n (err: string | null, data?: IMonthlyReportResponse) => {\n if (err && showSnackbar) {\n showSnackbar({\n type: 'error',\n message: 'Something went wrong. Please try again.',\n bgColor: 'red',\n });\n }\n\n if (!err && onFeedback && data?.feedback) {\n useMonthlyReportInvalidate(reportId);\n onFeedback(data.feedback, studentCourseId);\n }\n },\n [onFeedback, studentCourseId],\n );\n\n const { patch: updateMilestone, isProcessing } = useMonthlyReportPatch({\n onComplete,\n });\n\n const handleFeedback = useCallback(\n (feedback: TFeedback) => {\n updateMilestone(reportId, { feedback });\n },\n [reportId, updateMilestone],\n );\n\n const handlePositiveFeedback = useCallback(() => {\n handleFeedback('positive');\n }, [handleFeedback]);\n\n const handleNegativeFeedback = useCallback(() => {\n handleFeedback('negative');\n }, [handleFeedback]);\n\n return (\n <Styled.FeedbackContainer $gapX={1.25} $background=\"WHITE_3\">\n <Text $renderAs=\"ab2-black\" $color=\"BLACK_1\" $align=\"center\">\n Are you happy with {studentName ?? 'her'} progress?\n </Text>\n <Separator heightX={1.5} />\n <FlexView $flexDirection=\"row\" $flexGapX={3} $alignItems=\"center\" $justifyContent=\"center\">\n <Clickable\n label=\"Report thumps up\"\n disabled={isProcessing}\n onClick={handlePositiveFeedback}\n >\n <FlexView\n $widthX={5}\n $heightX={5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2.5}\n $borderColor=\"BLACK_5\"\n >\n <Image src={ILLUSTRATIONS.THUMPS_UP} alt=\"UP\" width={32} height={32} />\n </FlexView>\n </Clickable>\n <Clickable\n label=\"Report thumps down\"\n disabled={isProcessing}\n onClick={handleNegativeFeedback}\n >\n <FlexView\n $widthX={5}\n $heightX={5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderColor=\"BLACK_5\"\n $borderRadiusX={2.5}\n >\n <Image src={ILLUSTRATIONS.THUMPS_DOWN} alt=\"DOWN\" width={32} height={32} />\n </FlexView>\n </Clickable>\n </FlexView>\n <Separator heightX={1.5} />\n </Styled.FeedbackContainer>\n );\n};\n\nexport default memo(Feedback);\n"],"names":["Feedback","reportId","studentName","onFeedback","studentCourseId","showSnackbar","onComplete","useCallback","err","data","useMonthlyReportInvalidate","updateMilestone","isProcessing","useMonthlyReportPatch","handleFeedback","feedback","handlePositiveFeedback","handleNegativeFeedback","Styled.FeedbackContainer","jsxs","Text","jsx","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AW,GAAG,aAAY,UAAS,iBAAgB,UAChF,UAAA;AAAA,MAAA,gBAAAF;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,UAAUZ;AAAA,UACV,SAASI;AAAA,UAET,UAAA,gBAAAK;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,SAAS;AAAA,cACT,UAAU;AAAA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,gBAAgB;AAAA,cAChB,cAAa;AAAA,cAEb,UAAA,gBAAAF,EAACI,GAAM,EAAA,KAAKC,EAAc,WAAW,KAAI,MAAK,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,YAAA;AAAA,UACvE;AAAA,QAAA;AAAA,MACF;AAAA,MACA,gBAAAL;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,UAAUZ;AAAA,UACV,SAASK;AAAA,UAET,UAAA,gBAAAI;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,SAAS;AAAA,cACT,UAAU;AAAA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,cAAa;AAAA,cACb,gBAAgB;AAAA,cAEhB,UAAA,gBAAAF,EAACI,GAAM,EAAA,KAAKC,EAAc,aAAa,KAAI,QAAO,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,YAAA;AAAA,UAC3E;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAL,EAACC,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,EAC3B,EAAA,CAAA;AAEJ,GAEeK,IAAAC,EAAK5B,CAAQ;"}
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useMonthlyReportGet as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { MonthlyReportContainer as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { memo as _, useCallback as h, useEffect as m } from "react";
|
|
3
|
+
import { useMonthlyReportGet as g } from "./api/use-monthly-report-get.js";
|
|
4
|
+
import y from "../../ui/loader/app-loader/app-loader.js";
|
|
5
|
+
import v from "../../ui/error/error.js";
|
|
6
|
+
import { MonthlyReportContainer as x } from "./monthly-report-styled.js";
|
|
7
|
+
import R from "./comps/goals/goals.js";
|
|
8
|
+
import A from "./comps/activities/activities.js";
|
|
9
|
+
import c from "../../ui/layout/flex-view.js";
|
|
10
|
+
import C from "./comps/attendance/attendance.js";
|
|
11
|
+
import $ from "./comps/feedback/feedback.js";
|
|
12
|
+
import j from "./comps/achievements/achievements.js";
|
|
12
13
|
import { IS_APP_RUNNING_IN_RN as D } from "../../../constants/app-config.js";
|
|
13
|
-
|
|
14
|
-
const N = ({
|
|
14
|
+
const I = ({
|
|
15
15
|
studentName: i,
|
|
16
|
-
reportId:
|
|
17
|
-
onPuzzleClick:
|
|
16
|
+
reportId: o,
|
|
17
|
+
onPuzzleClick: p,
|
|
18
18
|
showSnackbar: s,
|
|
19
|
-
onFeedback:
|
|
19
|
+
onFeedback: f
|
|
20
20
|
}) => {
|
|
21
21
|
const {
|
|
22
22
|
get: n,
|
|
23
23
|
data: e,
|
|
24
|
-
isProcessing:
|
|
25
|
-
isProcessingFailed:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
isProcessing: a,
|
|
25
|
+
isProcessingFailed: l,
|
|
26
|
+
isStale: d
|
|
27
|
+
} = g(), r = h(() => {
|
|
28
|
+
n(o);
|
|
29
|
+
}, [n, o]);
|
|
30
|
+
return m(() => {
|
|
31
|
+
r();
|
|
32
|
+
}, [r]), m(() => {
|
|
33
|
+
d && !a && r();
|
|
34
|
+
}, []), a || !e ? /* @__PURE__ */ t(c, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ t(y, { height: "100dvh" }) }) : l ? /* @__PURE__ */ t(c, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ t(v, { onTryAgain: r }) }) : e ? /* @__PURE__ */ u(x, { children: [
|
|
35
|
+
/* @__PURE__ */ t(R, { milestones: e.progress_data.user_milestones, isExpended: !0 }),
|
|
36
|
+
/* @__PURE__ */ t(A, { activities: e.progress_data.activities, onPuzzleClick: p }),
|
|
34
37
|
/* @__PURE__ */ t(
|
|
35
|
-
|
|
38
|
+
j,
|
|
36
39
|
{
|
|
37
40
|
achievements: e.progress_data.user_achievements,
|
|
38
41
|
studentName: i
|
|
39
42
|
}
|
|
40
43
|
),
|
|
41
44
|
/* @__PURE__ */ t(
|
|
42
|
-
|
|
45
|
+
C,
|
|
43
46
|
{
|
|
44
47
|
calendarData: e.calendar_data,
|
|
45
48
|
reportMonth: e.report_month,
|
|
@@ -48,17 +51,17 @@ const N = ({
|
|
|
48
51
|
}
|
|
49
52
|
),
|
|
50
53
|
D && !e.feedback && e.student_course_ids[0] && /* @__PURE__ */ t(
|
|
51
|
-
|
|
54
|
+
$,
|
|
52
55
|
{
|
|
53
|
-
reportId:
|
|
56
|
+
reportId: o,
|
|
54
57
|
studentName: i,
|
|
55
|
-
onFeedback:
|
|
58
|
+
onFeedback: f,
|
|
56
59
|
studentCourseId: e.student_course_ids[0],
|
|
57
60
|
showSnackbar: s
|
|
58
61
|
}
|
|
59
62
|
)
|
|
60
63
|
] }) : null;
|
|
61
|
-
}, Y =
|
|
64
|
+
}, Y = _(I);
|
|
62
65
|
export {
|
|
63
66
|
Y as default
|
|
64
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-report.js","sources":["../../../../src/features/timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { useMonthlyReportGet } from './api/use-monthly-report-get';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-report-styled';\nimport Goals from './comps/goals/goals';\nimport Activities from './comps/activities/activities';\nimport FlexView from '../../ui/layout/flex-view';\nimport Attendance from './comps/attendance/attendance';\nimport Feedback from './comps/feedback/feedback';\nimport { IS_APP_RUNNING_IN_RN } from '../../../constants/app-config';\
|
|
1
|
+
{"version":3,"file":"monthly-report.js","sources":["../../../../src/features/timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { useMonthlyReportGet } from './api/use-monthly-report-get';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-report-styled';\nimport Goals from './comps/goals/goals';\nimport Activities from './comps/activities/activities';\nimport FlexView from '../../ui/layout/flex-view';\nimport Attendance from './comps/attendance/attendance';\nimport Feedback from './comps/feedback/feedback';\nimport Achievements from './comps/achievements/achievements';\nimport { IS_APP_RUNNING_IN_RN } from '../../../constants/app-config';\n\nconst MonthlyReport: FC<IMonthlyReportProps> = ({\n studentName,\n reportId,\n onPuzzleClick,\n showSnackbar,\n onFeedback,\n}) => {\n const {\n get: getReport,\n data: reportData,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useMonthlyReportGet();\n\n const fetchData = useCallback(() => {\n getReport(reportId);\n }, [getReport, reportId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isStale && !isProcessing) {\n fetchData();\n }\n }, []);\n\n if (isProcessing || !reportData) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <AppLoader height=\"100dvh\" />\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n if (!reportData) {\n return null;\n }\n\n return (\n <Styled.MonthlyReportContainer>\n <Goals milestones={reportData.progress_data.user_milestones} isExpended={true} />\n <Activities activities={reportData.progress_data.activities} onPuzzleClick={onPuzzleClick} />\n <Achievements\n achievements={reportData.progress_data.user_achievements}\n studentName={studentName}\n />\n <Attendance\n calendarData={reportData.calendar_data}\n reportMonth={reportData.report_month}\n reportYear={reportData.report_year}\n onDateClick={showSnackbar}\n />\n {IS_APP_RUNNING_IN_RN && !reportData.feedback && reportData.student_course_ids[0] && (\n <Feedback\n reportId={reportId}\n studentName={studentName}\n onFeedback={onFeedback}\n studentCourseId={reportData.student_course_ids[0]}\n showSnackbar={showSnackbar}\n />\n )}\n </Styled.MonthlyReportContainer>\n );\n};\n\nexport default memo(MonthlyReport);\n"],"names":["MonthlyReport","studentName","reportId","onPuzzleClick","showSnackbar","onFeedback","getReport","reportData","isProcessing","isProcessingFailed","isStale","useMonthlyReportGet","fetchData","useCallback","useEffect","jsx","FlexView","AppLoader","Error","jsxs","Styled.MonthlyReportContainer","Goals","Activities","Achievements","Attendance","IS_APP_RUNNING_IN_RN","Feedback","monthlyReport","memo"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,IAAyC,CAAC;AAAA,EAC9C,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,MACEC,EAAoB,GAElBC,IAAYC,EAAY,MAAM;AAClC,IAAAP,EAAUJ,CAAQ;AAAA,EAAA,GACjB,CAACI,GAAWJ,CAAQ,CAAC;AAYpB,SAVJY,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEdE,EAAU,MAAM;AACV,IAAAJ,KAAW,CAACF,KACJI;EAEd,GAAG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