l-min-components 1.7.1518 → 1.7.1520

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.
Files changed (134) hide show
  1. package/package.json +1 -1
  2. package/src/assets/svg/dashboard.jsx +54 -50
  3. package/src/components/AIAnalysis/grammer.jsx +56 -55
  4. package/src/components/AIAnalysis/relevant.jsx +22 -15
  5. package/src/components/AIAnalysis/responsePlayer.jsx +14 -17
  6. package/src/components/AIAnalysis/speech.jsx +141 -118
  7. package/src/components/AdminDashboard/admin-dashboard.jsx +89 -64
  8. package/src/components/AdminLogin/index.jsx +26 -20
  9. package/src/components/AdminNavbar/index.jsx +15 -13
  10. package/src/components/AdminNotification/index.jsx +12 -9
  11. package/src/components/AdminResetPassword/change-password.jsx +28 -21
  12. package/src/components/AdminResetPassword/index.jsx +24 -17
  13. package/src/components/AdminResetPassword/success-screen.jsx +17 -12
  14. package/src/components/AdminRolesPermission/create/admins.jsx +35 -32
  15. package/src/components/AdminRolesPermission/create/index.jsx +16 -14
  16. package/src/components/AdminRolesPermission/create/permissions.jsx +49 -35
  17. package/src/components/AdminRolesPermission/create/role-name.jsx +50 -31
  18. package/src/components/AdminRolesPermission/index.jsx +56 -42
  19. package/src/components/AdminRolesPermission/modals/preview-modal.jsx +36 -31
  20. package/src/components/AdminRolesPermission/preview-panels/admins-panel.jsx +29 -27
  21. package/src/components/AdminRolesPermission/preview-panels/assignees-panel.jsx +16 -17
  22. package/src/components/AdminRolesPermission/preview-panels/unassigned.jsx +14 -13
  23. package/src/components/AdminSecuritySettings/2fa/index.jsx +81 -52
  24. package/src/components/AdminSecuritySettings/index.jsx +25 -20
  25. package/src/components/AdminSecuritySettings/modals/opt-out-modal.jsx +47 -34
  26. package/src/components/AdminSecuritySettings/modals/otp-password-modal.jsx +45 -44
  27. package/src/components/AdminSecuritySettings/modals/security-question-modal.jsx +41 -37
  28. package/src/components/AdminSecuritySettings/modals/success-modal.jsx +32 -28
  29. package/src/components/AdminSecuritySettings/password/change-password.jsx +29 -26
  30. package/src/components/AdminSecuritySettings/password/index.jsx +16 -12
  31. package/src/components/AdminSidebar/index.jsx +25 -28
  32. package/src/components/ApiProgress/ApiConsumption/index.jsx +11 -12
  33. package/src/components/AppMainLayout/index.jsx +194 -216
  34. package/src/components/GraphMap/index.jsx +39 -31
  35. package/src/components/InputEmoji/index.jsx +742 -210
  36. package/src/components/TextEditor2/emojiModal.jsx +8 -8
  37. package/src/components/TextEditor2/tools.jsx +80 -49
  38. package/src/components/authentication/mainLayout.jsx +6 -5
  39. package/src/components/banner/developerBanner.jsx +49 -50
  40. package/src/components/banner/index.jsx +34 -32
  41. package/src/components/button/index.jsx +19 -20
  42. package/src/components/calender/input.jsx +40 -57
  43. package/src/components/course/coursecard/index.jsx +10 -12
  44. package/src/components/dashboardState/pendingDeleteState.jsx +18 -14
  45. package/src/components/datePicker/index.jsx +4 -4
  46. package/src/components/deactivated/index.jsx +74 -65
  47. package/src/components/deactivated/modal/subscription-expired-modal.jsx +55 -59
  48. package/src/components/developerAPIdocs/index.jsx +87 -55
  49. package/src/components/dropdown component/dropdown.jsx +97 -93
  50. package/src/components/dropdown component/index.jsx +16 -19
  51. package/src/components/errorPage/index.jsx +31 -29
  52. package/src/components/fileRightBar/components/progressBar/index.jsx +29 -32
  53. package/src/components/fileRightBar/components/progressBar/progress.jsx +29 -32
  54. package/src/components/fileRightBar/components/ugradeLock.jsx +30 -36
  55. package/src/components/fileRightBar/components/users.jsx +31 -36
  56. package/src/components/fileRightBar/enterpriseRightBar/index.jsx +33 -39
  57. package/src/components/fileRightBar/enterpriseRightBar/upgrade.jsx +31 -26
  58. package/src/components/fileRightBar/instructorRightBar.jsx +82 -87
  59. package/src/components/fileRightBar/instructorRightBar2/affiliateRightBar.jsx +32 -35
  60. package/src/components/fileRightBar/instructorRightBar2/index.jsx +36 -42
  61. package/src/components/fileRightBar/instructorRightBar2/personalRightBar.jsx +38 -38
  62. package/src/components/fileRightBar/instructorRightBar2/testModal.jsx +18 -13
  63. package/src/components/fileRightBar/instructorRightBar2/upgrade.jsx +30 -25
  64. package/src/components/fileRightBar/managerPageRight.jsx +65 -75
  65. package/src/components/fileRightBar/personalRightBar/index.jsx +117 -126
  66. package/src/components/fileRightBar/personalRightBar/upgrade.jsx +29 -35
  67. package/src/components/fileRightBar/upgrade.jsx +78 -88
  68. package/src/components/fileRightBar/uploadRight.jsx +27 -33
  69. package/src/components/fileRightBar/users.jsx +40 -45
  70. package/src/components/friendRequest/friendRequestCard/index.jsx +23 -14
  71. package/src/components/friendRequest/friendRequestList/index.jsx +11 -12
  72. package/src/components/getErrorFeatures/errorWrapper.jsx +33 -39
  73. package/src/components/getErrorFeatures/index.jsx +58 -45
  74. package/src/components/graph/graphData.jsx +115 -39
  75. package/src/components/graph/index.jsx +44 -37
  76. package/src/components/header/account-dropdown.jsx +86 -92
  77. package/src/components/header/index.jsx +135 -162
  78. package/src/components/header/languageDropdown.jsx +20 -26
  79. package/src/components/header/login-header.jsx +31 -34
  80. package/src/components/instructorAccountSwitcher/components/expiry modal/index.jsx +9 -15
  81. package/src/components/instructorAccountSwitcher/components/renew modal/index.jsx +8 -13
  82. package/src/components/instructorAccountSwitcher/index.jsx +46 -62
  83. package/src/components/messageAddon/InputSection/index.jsx +82 -84
  84. package/src/components/messageAddon/assets/svg/check_circle.jsx +39 -35
  85. package/src/components/messageAddon/messages/chatheader/index.jsx +25 -22
  86. package/src/components/messageAddon/messages/dropdown/chat-dropdown.jsx +10 -11
  87. package/src/components/messageAddon/messages/message-modals/deleteChat-modal.jsx +37 -36
  88. package/src/components/messageAddon/messages/message-modals/report-modal.jsx +74 -62
  89. package/src/components/messageAddon/messages/messages.jsx +78 -71
  90. package/src/components/mobileLayout/index.jsx +11 -10
  91. package/src/components/notificationThreshold/index.jsx +46 -39
  92. package/src/components/notificationThreshold/slider.jsx +10 -9
  93. package/src/components/reportsComponents/fullAnalysis/components/Evaluation.jsx +31 -26
  94. package/src/components/reportsComponents/fullAnalysis/components/EvalutionFeedback.jsx +21 -19
  95. package/src/components/reportsComponents/fullAnalysis/components/Grammar.jsx +90 -141
  96. package/src/components/reportsComponents/fullAnalysis/components/Grammar.v2.jsx +104 -96
  97. package/src/components/reportsComponents/fullAnalysis/components/InlineClampedText.jsx +7 -11
  98. package/src/components/reportsComponents/fullAnalysis/components/PlayButton.jsx +35 -31
  99. package/src/components/reportsComponents/fullAnalysis/components/SpeechAnalysis.jsx +163 -127
  100. package/src/components/reportsComponents/fullAnalysis/components/translateDropdown.jsx +8 -19
  101. package/src/components/reportsComponents/fullAnalysis/index.jsx +61 -58
  102. package/src/components/reportsComponents/reportQuestions/components/analysisButton.jsx +6 -5
  103. package/src/components/reportsComponents/reportQuestions/components/comment.jsx +90 -79
  104. package/src/components/reportsComponents/reportQuestions/components/modals/deleteModal.jsx +13 -16
  105. package/src/components/reportsComponents/reportQuestions/components/modals/gradingModal.jsx +35 -42
  106. package/src/components/reportsComponents/reportQuestions/components/modals/index.jsx +42 -45
  107. package/src/components/reportsComponents/reportQuestions/components/previewImage/index.jsx +17 -16
  108. package/src/components/reportsComponents/reportQuestions/components/previewImage.jsx +15 -16
  109. package/src/components/reportsComponents/reportQuestions/components/questionDropdown.jsx +12 -8
  110. package/src/components/reportsComponents/reportQuestions/components/response.jsx +20 -16
  111. package/src/components/reportsComponents/reportQuestions/components/responseAudio.v2.jsx +20 -19
  112. package/src/components/reportsComponents/reportQuestions/index.jsx +80 -92
  113. package/src/components/reportsComponents/reportQuestions/questions/dialogueScripted.jsx +21 -25
  114. package/src/components/reportsComponents/reportQuestions/questions/dialogueUnscripted.jsx +17 -23
  115. package/src/components/reportsComponents/reportQuestions/questions/essayScripted.jsx +14 -15
  116. package/src/components/reportsComponents/reportQuestions/questions/essayUnscripted.jsx +13 -14
  117. package/src/components/reportsComponents/reportQuestions/questions/essayWritten.jsx +11 -11
  118. package/src/components/reportsComponents/reportQuestions/questions/matchPair.jsx +28 -27
  119. package/src/components/reportsComponents/reportQuestions/questions/quizMultipleChoice.jsx +16 -13
  120. package/src/components/reportsComponents/reportQuestions/questions/quizScripted.jsx +16 -22
  121. package/src/components/reportsComponents/reportQuestions/questions/quizUnsripted.jsx +17 -21
  122. package/src/components/reportsComponents/reportQuestions/questions/reading.jsx +15 -17
  123. package/src/components/reportsComponents/reportQuestions/questions/soundPlay.jsx +13 -15
  124. package/src/components/reportsComponents/reportQuestions/questions/wordPlayMultipleChoice.jsx +17 -14
  125. package/src/components/reportsComponents/reportQuestions/questions/wordPlayText.jsx +11 -10
  126. package/src/components/sideBar/sideMenu/index.jsx +86 -86
  127. package/src/components/sideBar/userCard/index.jsx +25 -31
  128. package/src/components/sideNav/index.jsx +38 -38
  129. package/src/components/subscriptionPreview/index.jsx +31 -14
  130. package/src/components/successCard/index.jsx +16 -9
  131. package/src/components/textEditor/index.jsx +139 -108
  132. package/src/components/textEditor/test.jsx +14 -10
  133. package/src/components/video-player/index.jsx +48 -68
  134. package/src/hooks/recorder-kit/index.jsx +212 -196
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.7.1518",
3
+ "version": "1.7.1520",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -1,8 +1,10 @@
1
- import React from "react";
1
+ import React from 'react';
2
+ import { useTranslation } from 'l-min-components/src/components';
3
+ import wordStore from '../../mc/wordStore.json';
2
4
  export const DashboardIcon = ({ width, height, fill }) => (
3
5
  <svg
4
- width={width || "24"}
5
- height={height || "25"}
6
+ width={width || '24'}
7
+ height={height || '25'}
6
8
  viewBox="0 0 24 25"
7
9
  fill="none"
8
10
  xmlns="http://www.w3.org/2000/svg"
@@ -45,50 +47,52 @@ export const DashboardIcon = ({ width, height, fill }) => (
45
47
  />
46
48
  </svg>
47
49
  );
48
-
49
- export const DashboardIconActive = ({ width, height }) => (
50
- <svg
51
- width={width || "24"}
52
- height={height || "25"}
53
- viewBox="0 0 24 25"
54
- fill="none"
55
- xmlns="http://www.w3.org/2000/svg"
56
- >
57
- <path
58
- d="M5 10.1797H7C9 10.1797 10 9.17969 10 7.17969V5.17969C10 3.17969 9 2.17969 7 2.17969H5C3 2.17969 2 3.17969 2 5.17969V7.17969C2 9.17969 3 10.1797 5 10.1797Z"
59
- stroke="white"
60
- stroke-width="1.5"
61
- stroke-miterlimit="10"
62
- stroke-linecap="round"
63
- stroke-linejoin="round"
64
- fill={"#ffffff"}
65
- />
66
- <path
67
- d="M17 10.1797H19C21 10.1797 22 9.17969 22 7.17969V5.17969C22 3.17969 21 2.17969 19 2.17969H17C15 2.17969 14 3.17969 14 5.17969V7.17969C14 9.17969 15 10.1797 17 10.1797Z"
68
- stroke="white"
69
- stroke-width="1.5"
70
- stroke-miterlimit="10"
71
- stroke-linecap="round"
72
- stroke-linejoin="round"
73
- fill={"#ffffff"}
74
- />
75
- <path
76
- d="M17 22.1797H19C21 22.1797 22 21.1797 22 19.1797V17.1797C22 15.1797 21 14.1797 19 14.1797H17C15 14.1797 14 15.1797 14 17.1797V19.1797C14 21.1797 15 22.1797 17 22.1797Z"
77
- stroke="white"
78
- stroke-width="1.5"
79
- stroke-miterlimit="10"
80
- stroke-linecap="round"
81
- stroke-linejoin="round"
82
- fill={"#ffffff"}
83
- />
84
- <path
85
- d="M5 22.1797H7C9 22.1797 10 21.1797 10 19.1797V17.1797C10 15.1797 9 14.1797 7 14.1797H5C3 14.1797 2 15.1797 2 17.1797V19.1797C2 21.1797 3 22.1797 5 22.1797Z"
86
- stroke="white"
87
- stroke-width="1.5"
88
- stroke-miterlimit="10"
89
- stroke-linecap="round"
90
- stroke-linejoin="round"
91
- fill={"#ffffff"}
92
- />
93
- </svg>
94
- );
50
+ export const DashboardIconActive = ({ width, height }) => {
51
+ const { findText } = useTranslation(wordStore);
52
+ return (
53
+ <svg
54
+ width={width || '24'}
55
+ height={height || '25'}
56
+ viewBox="0 0 24 25"
57
+ fill="none"
58
+ xmlns="http://www.w3.org/2000/svg"
59
+ >
60
+ <path
61
+ d="M5 10.1797H7C9 10.1797 10 9.17969 10 7.17969V5.17969C10 3.17969 9 2.17969 7 2.17969H5C3 2.17969 2 3.17969 2 5.17969V7.17969C2 9.17969 3 10.1797 5 10.1797Z"
62
+ stroke="white"
63
+ stroke-width="1.5"
64
+ stroke-miterlimit="10"
65
+ stroke-linecap="round"
66
+ stroke-linejoin="round"
67
+ fill={findText('#ffffff')}
68
+ />
69
+ <path
70
+ d="M17 10.1797H19C21 10.1797 22 9.17969 22 7.17969V5.17969C22 3.17969 21 2.17969 19 2.17969H17C15 2.17969 14 3.17969 14 5.17969V7.17969C14 9.17969 15 10.1797 17 10.1797Z"
71
+ stroke="white"
72
+ stroke-width="1.5"
73
+ stroke-miterlimit="10"
74
+ stroke-linecap="round"
75
+ stroke-linejoin="round"
76
+ fill={findText('#ffffff')}
77
+ />
78
+ <path
79
+ d="M17 22.1797H19C21 22.1797 22 21.1797 22 19.1797V17.1797C22 15.1797 21 14.1797 19 14.1797H17C15 14.1797 14 15.1797 14 17.1797V19.1797C14 21.1797 15 22.1797 17 22.1797Z"
80
+ stroke="white"
81
+ stroke-width="1.5"
82
+ stroke-miterlimit="10"
83
+ stroke-linecap="round"
84
+ stroke-linejoin="round"
85
+ fill={findText('#ffffff')}
86
+ />
87
+ <path
88
+ d="M5 22.1797H7C9 22.1797 10 21.1797 10 19.1797V17.1797C10 15.1797 9 14.1797 7 14.1797H5C3 14.1797 2 15.1797 2 17.1797V19.1797C2 21.1797 3 22.1797 5 22.1797Z"
89
+ stroke="white"
90
+ stroke-width="1.5"
91
+ stroke-miterlimit="10"
92
+ stroke-linecap="round"
93
+ stroke-linejoin="round"
94
+ fill={findText('#ffffff')}
95
+ />
96
+ </svg>
97
+ );
98
+ };
@@ -1,18 +1,18 @@
1
- import React, { useState } from "react";
2
- import CursorClickIcon from "./assets/cursorClick";
3
- import styled from "styled-components";
4
- import { IoCloseOutline } from "react-icons/io5";
5
- import { FaCheck } from "react-icons/fa6";
6
- import ButtonComponent from "../button";
7
-
1
+ import React, { useState } from 'react';
2
+ import CursorClickIcon from './assets/cursorClick';
3
+ import styled from 'styled-components';
4
+ import { IoCloseOutline } from 'react-icons/io5';
5
+ import { FaCheck } from 'react-icons/fa6';
6
+ import ButtonComponent from '../button';
7
+ import { useTranslation } from 'l-min-components/src/components';
8
+ import wordStore from '../../mc/wordStore.json';
8
9
  const Grammer = ({ data, hideScore }) => {
10
+ const { findText } = useTranslation(wordStore);
9
11
  const [selected, setSelected] = useState(null);
10
12
  const [showVersion, setShowVersion] = useState(null);
11
-
12
- const feedbackCorrection = data["Correction Operations (Optional)"] || [];
13
- const originalText = data["Original Speech"] || "";
14
- const correctText = data["Grammatical Correct Version"] || "";
15
-
13
+ const feedbackCorrection = data['Correction Operations (Optional)'] || [];
14
+ const originalText = data['Original Speech'] || '';
15
+ const correctText = data['Grammatical Correct Version'] || '';
16
16
  const getFeekbackResult = () => {
17
17
  const result = [];
18
18
  let positionCounter = 1; // Tracks the word position in the text
@@ -23,16 +23,16 @@ const Grammer = ({ data, hideScore }) => {
23
23
  while (wordIndex <= words?.length) {
24
24
  const word = words[wordIndex];
25
25
  const correction = feedbackCorrection[correctionIndex];
26
-
27
26
  if (
28
27
  correction &&
29
- correction?.operation === "substituted" && // Handle substitution
28
+ correction?.operation === 'substituted' &&
29
+ // Handle substitution
30
30
  words
31
31
  .slice(
32
32
  wordIndex,
33
- wordIndex + correction?.original_word.split(" ").length
33
+ wordIndex + correction?.original_word.split(' ').length,
34
34
  )
35
- .join(" ") === correction?.original_word
35
+ .join(' ') === correction?.original_word
36
36
  ) {
37
37
  result.push({
38
38
  text: correction?.original_word,
@@ -40,13 +40,14 @@ const Grammer = ({ data, hideScore }) => {
40
40
  position: positionCounter,
41
41
  operation: correction?.operation,
42
42
  });
43
- wordIndex += correction?.original_word.split(" ").length || 0;
43
+ wordIndex += correction?.original_word.split(' ').length || 0;
44
44
  correctionIndex++;
45
45
  positionCounter++;
46
- } else if (correction && correction?.operation === "inserted") {
46
+ } else if (correction && correction?.operation === 'inserted') {
47
47
  result.push({
48
48
  text: correction?.word,
49
- correct: correction?.word, // Insert the new word
49
+ correct: correction?.word,
50
+ // Insert the new word
50
51
  position: positionCounter,
51
52
  operation: correction?.operation,
52
53
  });
@@ -54,12 +55,13 @@ const Grammer = ({ data, hideScore }) => {
54
55
  positionCounter++;
55
56
  } else {
56
57
  if (word !== undefined) {
57
- result.push({ text: word });
58
+ result.push({
59
+ text: word,
60
+ });
58
61
  }
59
62
  wordIndex++;
60
63
  }
61
64
  }
62
-
63
65
  return result;
64
66
  };
65
67
  const getCorrectResult = () => {
@@ -67,44 +69,42 @@ const Grammer = ({ data, hideScore }) => {
67
69
  let correctionIndex = 0;
68
70
  let words = correctText.split(/\s+/);
69
71
  let wordIndex = 0;
70
-
71
72
  while (wordIndex < words.length) {
72
73
  const word = words[wordIndex];
73
74
  const correction = feedbackCorrection[correctionIndex];
74
75
  if (
75
76
  correction &&
76
- correction?.operation === "substituted" &&
77
+ correction?.operation === 'substituted' &&
77
78
  words
78
79
  .slice(
79
80
  wordIndex,
80
- wordIndex + correction?.replacement_word.split(" ").length
81
+ wordIndex + correction?.replacement_word.split(' ').length,
81
82
  )
82
- .join(" ") === correction?.replacement_word
83
+ .join(' ') === correction?.replacement_word
83
84
  ) {
84
85
  result.push({
85
86
  text: correction?.replacement_word,
86
87
  highlight: true,
87
88
  });
88
- wordIndex += correction?.replacement_word.split(" ").length;
89
+ wordIndex += correction?.replacement_word.split(' ').length;
89
90
  correctionIndex++;
90
- } else if (correction && correction?.operation === "inserted") {
91
+ } else if (correction && correction?.operation === 'inserted') {
91
92
  result.push({
92
93
  text: correction?.word,
93
94
  highlight: true,
94
95
  });
95
96
  correctionIndex++;
96
97
  } else {
97
- result.push({ text: word });
98
+ result.push({
99
+ text: word,
100
+ });
98
101
  wordIndex++;
99
102
  }
100
103
  }
101
-
102
104
  return result;
103
105
  };
104
-
105
106
  const generateParagraph = (data) => {
106
- let paragraph = "<p>";
107
-
107
+ let paragraph = '<p>';
108
108
  data?.forEach((item) => {
109
109
  if (item?.highlight) {
110
110
  paragraph += `<span>${item?.text}</span> `;
@@ -112,12 +112,9 @@ const Grammer = ({ data, hideScore }) => {
112
112
  paragraph += `${item?.text} `;
113
113
  }
114
114
  });
115
-
116
- paragraph = paragraph?.trim() + "</p>";
117
-
115
+ paragraph = paragraph?.trim() + '</p>';
118
116
  return paragraph;
119
117
  };
120
-
121
118
  return (
122
119
  <Container>
123
120
  {showVersion && (
@@ -132,11 +129,16 @@ const Grammer = ({ data, hideScore }) => {
132
129
  <Header>
133
130
  <div className="info">
134
131
  <CursorClickIcon />
135
- <p>Click on the words/sentences highlighted in red to see feedback</p>
132
+ <p>
133
+ {findText(
134
+ 'Click on the words/sentences highlighted in red to see feedback',
135
+ )}
136
+ </p>
136
137
  </div>
137
138
  {!hideScore && (
138
139
  <p>
139
- Points: <span>{data?.["Grammar Score"] || 0}</span>
140
+ {findText('Points:')}
141
+ <span>{data?.['Grammar Score'] || 0}</span>
140
142
  </p>
141
143
  )}
142
144
  </Header>
@@ -148,18 +150,18 @@ const Grammer = ({ data, hideScore }) => {
148
150
  onClick={() => {
149
151
  if (value?.position) setSelected(value);
150
152
  }}
151
- className={`${value?.position ? "error" : ""}`}
153
+ className={`${value?.position ? 'error' : ''}`}
152
154
  >
153
- {" "}
155
+ {' '}
154
156
  {value?.position && <span>{value?.position}</span>} {value?.text}
155
157
  </span>
156
158
  ))}
157
159
  </div>
158
160
  {selected && (
159
161
  <div className="feedback_content">
160
- <h3>Feedback:</h3>
162
+ <h3>{findText('Feedback:')}</h3>
161
163
  <div className="reply">
162
- {selected?.operation !== "inserted" && (
164
+ {selected?.operation !== 'inserted' && (
163
165
  <div className="row red">
164
166
  <IoCloseOutline color="#F95454" />
165
167
  <p className="red">
@@ -185,7 +187,7 @@ const Grammer = ({ data, hideScore }) => {
185
187
  });
186
188
  }}
187
189
  >
188
- <ButtonComponent text="View script" type="secondary" />
190
+ <ButtonComponent text={findText('View script')} type="secondary" />
189
191
  </span>
190
192
  <span
191
193
  onClick={() => {
@@ -197,16 +199,18 @@ const Grammer = ({ data, hideScore }) => {
197
199
  });
198
200
  }}
199
201
  >
200
- <ButtonComponent text="View corrected version" type="secondary" />
202
+ <ButtonComponent
203
+ text={findText('View corrected version')}
204
+ type="secondary"
205
+ />
201
206
  </span>
202
207
  </ButtonWrapper>
203
208
  </Container>
204
209
  );
205
210
  };
206
-
207
211
  export default Grammer;
208
-
209
212
  const WordsModal = ({ onClose, isCorrect, value }) => {
213
+ const { findText } = useTranslation(wordStore);
210
214
  return (
211
215
  <ModalWrapper isOpen>
212
216
  <ModalComntainer>
@@ -216,20 +220,21 @@ const WordsModal = ({ onClose, isCorrect, value }) => {
216
220
  <div className="word_wrapper">
217
221
  {isCorrect && (
218
222
  <div className="header">
219
- <h4>Corrected version</h4>
220
- <p>Introduced words are highlighted in green</p>
223
+ <h4>{findText('Corrected version')}</h4>
224
+ <p>{findText('Introduced words are highlighted in green')}</p>
221
225
  </div>
222
226
  )}
223
227
  <div
224
228
  className="content"
225
- dangerouslySetInnerHTML={{ __html: value }}
229
+ dangerouslySetInnerHTML={{
230
+ __html: value,
231
+ }}
226
232
  ></div>
227
233
  </div>
228
234
  </ModalComntainer>
229
235
  </ModalWrapper>
230
236
  );
231
237
  };
232
-
233
238
  const ModalComntainer = styled.div`
234
239
  width: 610px;
235
240
  display: flex;
@@ -290,14 +295,12 @@ const ModalComntainer = styled.div`
290
295
  }
291
296
  }
292
297
  `;
293
-
294
298
  const Container = styled.div`
295
299
  width: 100%;
296
300
  display: flex;
297
301
  flex-direction: column;
298
302
  gap: 20px;
299
303
  `;
300
-
301
304
  const Header = styled.div`
302
305
  display: flex;
303
306
  align-items: center;
@@ -329,7 +332,6 @@ const Header = styled.div`
329
332
  }
330
333
  }
331
334
  `;
332
-
333
335
  const Content = styled.div`
334
336
  border-radius: 20px;
335
337
  background: #f9f9f9;
@@ -409,7 +411,6 @@ const Content = styled.div`
409
411
  }
410
412
  }
411
413
  `;
412
-
413
414
  const ButtonWrapper = styled.div`
414
415
  display: flex;
415
416
  align-items: center;
@@ -426,7 +427,7 @@ const ModalWrapper = styled.div`
426
427
  left: 0;
427
428
  bottom: 0;
428
429
  right: 0;
429
- display: ${({ isOpen }) => (isOpen ? "flex" : "none")};
430
+ display: ${({ isOpen }) => (isOpen ? 'flex' : 'none')};
430
431
  align-items: center;
431
432
  justify-content: center;
432
433
  background-color: rgba(0, 0, 0, 0.6);
@@ -1,38 +1,48 @@
1
- import React, { useState } from "react";
2
- import styled from "styled-components";
3
- import ArrowDown from "./assets/arrowDown";
4
-
1
+ import React, { useState } from 'react';
2
+ import styled from 'styled-components';
3
+ import ArrowDown from './assets/arrowDown';
4
+ import { useTranslation } from 'l-min-components/src/components';
5
+ import wordStore from '../../mc/wordStore.json';
5
6
  const Relevant = ({ data, student_text, hideScore }) => {
7
+ const { findText } = useTranslation(wordStore);
6
8
  return (
7
9
  <Container>
8
10
  <Header>
9
- <h2 className={data?.Evaluation === "Not Relevant" ? "error" : ""}>
11
+ <h2 className={data?.Evaluation === 'Not Relevant' ? 'error' : ''}>
10
12
  {data?.Evaluation}
11
13
  </h2>
12
14
  {!hideScore && (
13
15
  <p>
14
- Points: <span>{data?.Point || 0}</span>
16
+ {findText('Points:')}
17
+ <span>{data?.Point || 0}</span>
15
18
  </p>
16
19
  )}
17
20
  </Header>
18
- <Dropdown label="Feedback" isFeedback text={data?.Feedback} />
19
- {student_text && <Dropdown label="Student essay" text={student_text} />}
21
+ <Dropdown label={findText('Feedback')} isFeedback text={data?.Feedback} />
22
+ {student_text && (
23
+ <Dropdown label={findText('Student essay')} text={student_text} />
24
+ )}
20
25
  </Container>
21
26
  );
22
27
  };
23
-
24
28
  export default Relevant;
25
-
26
29
  const Dropdown = ({ isFeedback, text, label }) => {
30
+ const { findText } = useTranslation(wordStore);
27
31
  const [toggle, setToggle] = useState(true);
28
32
  return (
29
33
  <DropdownContainer
30
- className={`${isFeedback ? "feedback" : undefined}`}
34
+ className={findText('{arg1}', {
35
+ arg1: isFeedback ? 'feedback' : undefined,
36
+ })}
31
37
  onClick={() => {
32
38
  text && setToggle(!toggle);
33
39
  }}
34
40
  >
35
- <div className={`dd_header ${toggle ? "toggle" : ""}`}>
41
+ <div
42
+ className={findText('dd_header {arg1}', {
43
+ arg1: toggle ? 'toggle' : '',
44
+ })}
45
+ >
36
46
  <p>{label}</p> <ArrowDown />
37
47
  </div>
38
48
  {toggle && text && (
@@ -43,14 +53,12 @@ const Dropdown = ({ isFeedback, text, label }) => {
43
53
  </DropdownContainer>
44
54
  );
45
55
  };
46
-
47
56
  const Container = styled.div`
48
57
  width: 100%;
49
58
  display: flex;
50
59
  flex-direction: column;
51
60
  gap: 20px;
52
61
  `;
53
-
54
62
  const Header = styled.div`
55
63
  display: flex;
56
64
  align-items: center;
@@ -81,7 +89,6 @@ const Header = styled.div`
81
89
  }
82
90
  }
83
91
  `;
84
-
85
92
  const DropdownContainer = styled.div`
86
93
  &.feedback {
87
94
  .dd_header {
@@ -1,9 +1,11 @@
1
- import React, { useState } from "react";
2
- import styled from "styled-components";
3
- import { useSpeechSynthesis } from "react-speech-kit";
4
- import useAudioPlayer from "../useAudioPlayer";
5
-
6
- const ResponsePlayer = ({ text, audio, small, Label = "You say" }) => {
1
+ import React, { useState } from 'react';
2
+ import styled from 'styled-components';
3
+ import { useSpeechSynthesis } from 'react-speech-kit';
4
+ import useAudioPlayer from '../useAudioPlayer';
5
+ import { useTranslation } from 'l-min-components/src/components';
6
+ import wordStore from '../../mc/wordStore.json';
7
+ const ResponsePlayer = ({ text, audio, small, Label = 'You say' }) => {
8
+ const { findText } = useTranslation(wordStore);
7
9
  const [isPlaying, setIsPlaying] = useState(false);
8
10
  const {
9
11
  isPlaying: audioIsPlaying,
@@ -14,21 +16,21 @@ const ResponsePlayer = ({ text, audio, small, Label = "You say" }) => {
14
16
  streamSrc: audio?.url,
15
17
  src: audio?.uploaded_media_url,
16
18
  });
17
-
18
19
  const { speak, cancel } = useSpeechSynthesis({
19
20
  onEnd: () => {
20
21
  setIsPlaying(false);
21
22
  },
22
23
  });
23
-
24
24
  return (
25
25
  <Container>
26
26
  {text && (
27
27
  <Button
28
- className={small ? "small" : ""}
28
+ className={small ? 'small' : ''}
29
29
  onClick={() => {
30
30
  if (!isPlaying) {
31
- speak({ text });
31
+ speak({
32
+ text,
33
+ });
32
34
  setIsPlaying(true);
33
35
  } else {
34
36
  cancel();
@@ -37,12 +39,12 @@ const ResponsePlayer = ({ text, audio, small, Label = "You say" }) => {
37
39
  }}
38
40
  >
39
41
  {isPlaying ? <StopIcon /> : <EarIcon />}
40
- <span>Correct response</span>
42
+ <span>{findText('Correct response')}</span>
41
43
  </Button>
42
44
  )}
43
45
  {audio && isReady && (
44
46
  <Button
45
- className={small ? "small" : ""}
47
+ className={small ? 'small' : ''}
46
48
  onClick={() => {
47
49
  if (!audioIsPlaying) {
48
50
  play();
@@ -58,11 +60,9 @@ const ResponsePlayer = ({ text, audio, small, Label = "You say" }) => {
58
60
  </Container>
59
61
  );
60
62
  };
61
-
62
63
  const Container = styled.div`
63
64
  width: fit-content;
64
65
  `;
65
-
66
66
  const Button = styled.button`
67
67
  display: flex;
68
68
  align-items: center;
@@ -90,9 +90,7 @@ const Button = styled.button`
90
90
  }
91
91
  }
92
92
  `;
93
-
94
93
  export default ResponsePlayer;
95
-
96
94
  export const StopIcon = () => (
97
95
  <svg
98
96
  width="43"
@@ -161,7 +159,6 @@ const SpeakerIcon = () => (
161
159
  </defs>
162
160
  </svg>
163
161
  );
164
-
165
162
  const EarIcon = () => (
166
163
  <svg
167
164
  width="43"