l-min-components 1.7.1410 → 1.7.1412

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.7.1410",
3
+ "version": "1.7.1412",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -50,6 +50,7 @@ const Container = styled.button`
50
50
  text-align: left;
51
51
  color: #636666;
52
52
  font-size: 14px;
53
+ white-space: nowrap;
53
54
  }
54
55
  &.ai-mode {
55
56
  background: #00c2c21a;
@@ -8,6 +8,7 @@ import {
8
8
  SpeechAnalysisContentWordScore,
9
9
  SpeechAnalysisContentWordSection,
10
10
  SpeechAnalysisHeader,
11
+ SpeechTitle,
11
12
  } from "../style";
12
13
  import HandIcon from "../icons/hand";
13
14
  import classNames from "classnames";
@@ -21,8 +22,9 @@ import Table from "./Table";
21
22
  import { Progress } from "rsuite";
22
23
  import ClarityItem from "./ClarityItem";
23
24
  import InlineClampedText from "./InlineClampedText";
25
+ import PlayButton from "./PlayButton";
24
26
 
25
- const SpeechAnalysis = ({ Aidata }) => {
27
+ const SpeechAnalysis = ({ Aidata, isPersonal }) => {
26
28
  const [selectedWord, setSelectedWord] = useState(1);
27
29
  const [selectedSection, setSelectedSection] = useState(null);
28
30
 
@@ -60,15 +62,24 @@ const SpeechAnalysis = ({ Aidata }) => {
60
62
  const selectionSelectionValue = sectionList?.find(
61
63
  (item) => item?.id === selectedSection
62
64
  );
63
- console.log(selectionSelectionValue);
65
+
64
66
  return (
65
67
  <ModelComtainer>
66
68
  <ModelContent>
67
69
  <SpeechAnalysisHeader>
68
- <div className="label">
69
- <HandIcon />
70
- <p>Click on the words to see detailed feedback</p>
71
- </div>
70
+ <SpeechTitle>
71
+ <div className="label">
72
+ <HandIcon />
73
+ <p>Click on the words to see detailed feedback</p>
74
+ </div>
75
+ {isPersonal && (
76
+ <div className="">
77
+ <PlayButton audio={Aidata?.audioData} />
78
+ <PlayButton type="ai" refernceText={Aidata?.data?.Reference} />
79
+ </div>
80
+ )}
81
+ </SpeechTitle>
82
+
72
83
  <div className="transcript-wrapper">
73
84
  {words.map((word) => (
74
85
  <span>
@@ -172,7 +172,10 @@ const FullAnalysis = ({ data, onClose, accountType }) => {
172
172
  <Evaluation Aidata={selectedModel} />
173
173
  )}
174
174
  {selectedModel?.id === "speech_analysis" && (
175
- <SpeechAnalysis Aidata={selectedModel} />
175
+ <SpeechAnalysis
176
+ Aidata={selectedModel}
177
+ isPersonal={accountType === "personal"}
178
+ />
176
179
  )}
177
180
  {selectedModel?.id === "gammar" && <Grammar />}
178
181
  </MainSection>
@@ -226,19 +226,6 @@ export const EvaluationCharactersItem = styled.div`
226
226
  `;
227
227
 
228
228
  export const SpeechAnalysisHeader = styled.div`
229
- .label {
230
- display: flex;
231
- align-items: center;
232
- padding: 0 20px;
233
- gap: 10px;
234
- margin-bottom: 10px;
235
-
236
- p {
237
- font-size: 14px;
238
- line-height: 24px;
239
- color: #7c8080;
240
- }
241
- }
242
229
  .capitalise {
243
230
  text-transform: capitalize;
244
231
  }
@@ -278,6 +265,36 @@ export const SpeechAnalysisHeader = styled.div`
278
265
  }
279
266
  `;
280
267
 
268
+ export const SpeechTitle = styled.div`
269
+ display: flex;
270
+ align-items: center;
271
+ justify-content: space-between;
272
+ width: 100%;
273
+
274
+ margin-bottom: 10px;
275
+ .label {
276
+ display: flex;
277
+ align-items: center;
278
+ padding: 0 20px;
279
+ gap: 10px;
280
+
281
+ p {
282
+ font-size: 14px;
283
+ line-height: 24px;
284
+ color: #7c8080;
285
+ }
286
+ }
287
+ > div {
288
+ display: flex;
289
+ align-items: center;
290
+ gap: 12px;
291
+ button {
292
+ width: 170px;
293
+ height: 40px;
294
+ }
295
+ }
296
+ `;
297
+
281
298
  export const SelectedWord = styled.p`
282
299
  color: #636666;
283
300
  font-size: 16px;
@@ -4,13 +4,9 @@ import styled from "styled-components";
4
4
  import Radio from "../radio";
5
5
  import ButtonComponent from "../../../../button";
6
6
 
7
- const GradingModal = ({ aiValue, onClose, setScore }) => {
7
+ const GradingModal = ({ aiValue, onClose, setScore, noAi, defaultScore }) => {
8
8
  const [selected, setSelected] = useState("manually");
9
- const [value, setValue] = useState("");
10
-
11
- useEffect(() => {
12
- setValue("");
13
- }, [selected]);
9
+ const [value, setValue] = useState(defaultScore || "");
14
10
 
15
11
  const numberValue = Number(value || 0);
16
12
  const disable = selected === "manually" && (numberValue > 100 || !value);
@@ -34,7 +30,7 @@ const GradingModal = ({ aiValue, onClose, setScore }) => {
34
30
  <TopSection>
35
31
  <h3>Instructor’s grading</h3>
36
32
  <ul className="check_wrapper">
37
- {isNumbter && (
33
+ {isNumbter && !noAi && (
38
34
  <li
39
35
  onClick={() => {
40
36
  setSelected("ai");
@@ -143,8 +139,9 @@ const TopSection = styled.div`
143
139
  display: grid;
144
140
  grid-template-columns: 1fr 1fr;
145
141
  padding-bottom: 15px;
146
- border: 1px solid #dfe5e5;
142
+ border-bottom: 1px solid #dfe5e5;
147
143
  margin-bottom: 15px;
144
+
148
145
  li {
149
146
  display: flex;
150
147
  align-items: center;
@@ -109,14 +109,21 @@ const ReportQuestions = ({
109
109
  />
110
110
  );
111
111
  }
112
-
112
+ const noAi =
113
+ questionType === "match-pair" ||
114
+ questionType === "quiz-multiple-choice" ||
115
+ questionType === "word-play-text" ||
116
+ questionType === "word-play-multiple-choice" ||
117
+ questionType === "essay-written";
113
118
  return (
114
119
  <Container>
115
120
  {gradeQuestionData?.loading && <FullPageLoader fixed hasBackground />}
116
121
  {toggleGrade && (
117
122
  <GradingModal
118
123
  aiValue={data?.ai_score}
124
+ noAi={noAi}
119
125
  setScore={handleScore}
126
+ defaultScore={intructorScore}
120
127
  onClose={() => {
121
128
  setToggleGrade(false);
122
129
  }}
@@ -141,12 +148,7 @@ const ReportQuestions = ({
141
148
  <ScoreBadge
142
149
  ai
143
150
  className={classNames({
144
- hidden:
145
- questionType === "match-pair" ||
146
- questionType === "quiz-multiple-choice" ||
147
- questionType === "word-play-text" ||
148
- questionType === "word-play-multiple-choice" ||
149
- questionType === "essay-written",
151
+ hidden: noAi,
150
152
  })}
151
153
  >
152
154
  AI score: <span>{parseInt(data?.ai_score || 0)}%</span>