@omniumretail/component-library 1.0.37 → 1.0.38

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 (32) hide show
  1. package/dist/bundle.js +3 -3
  2. package/dist/types/components/AnalyticsBar/AnalyticsBar.stories.d.ts +5 -0
  3. package/dist/types/components/AnalyticsBar/helpers/codeMutation.d.ts +4 -0
  4. package/dist/types/components/AnalyticsBar/index.d.ts +3 -0
  5. package/dist/types/components/AnalyticsBar/interfaces/analyticsBar.d.ts +12 -0
  6. package/dist/types/components/CategoryResponse/CategoryResponse.stories.d.ts +4 -0
  7. package/dist/types/components/CategoryResponse/evaluationOptions.d.ts +10 -0
  8. package/dist/types/components/CategoryResponse/index.d.ts +9 -0
  9. package/dist/types/components/Menu/Menu.stories.d.ts +5 -0
  10. package/dist/types/components/Menu/helpers/codeMutation.d.ts +4 -0
  11. package/dist/types/components/Menu/index.d.ts +3 -0
  12. package/dist/types/constants/translationHelper.d.ts +2 -0
  13. package/package.json +1 -1
  14. package/src/components/AnalyticsBar/AnalyticsBar.stories.tsx +180 -0
  15. package/src/components/AnalyticsBar/helpers/codeMutation.tsx +19 -0
  16. package/src/components/AnalyticsBar/index.tsx +76 -0
  17. package/src/components/AnalyticsBar/interfaces/analyticsBar.tsx +13 -0
  18. package/src/components/AnalyticsBar/styles.module.scss +108 -0
  19. package/src/components/Category/Category.stories.tsx +64 -37
  20. package/src/components/Category/CategoryContent/index.tsx +9 -9
  21. package/src/components/CategoryResponse/CategoryResponse.stories.tsx +261 -0
  22. package/src/components/CategoryResponse/evaluationOptions.tsx +81 -0
  23. package/src/components/CategoryResponse/index.tsx +280 -0
  24. package/src/components/CategoryResponse/styles.module.scss +135 -0
  25. package/src/components/Menu/Menu.stories.tsx +178 -0
  26. package/src/components/Menu/helpers/codeMutation.tsx +19 -0
  27. package/src/components/Menu/index.tsx +23 -0
  28. package/src/components/Menu/styles.module.scss +0 -0
  29. package/src/constants/translationHelper.ts +7 -0
  30. package/src/locales/en.json +3 -0
  31. package/src/locales/es.json +3 -0
  32. package/src/locales/pt.json +3 -0
@@ -0,0 +1,261 @@
1
+ import { Meta, Story } from "@storybook/react";
2
+ import { Button } from "components/Button";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { CategoryResponse } from '.';
5
+
6
+ export default {
7
+ title: 'CategoryResponse',
8
+ component: CategoryResponse,
9
+ } as Meta;
10
+
11
+ const Template: Story<any> = (args) => {
12
+ const [serverData, setServerData] = useState<any>();
13
+ const categoryResponseRef = useRef(null);
14
+ const [hasNext, setHasNext] = useState(true);
15
+ const [hasPrevious, setHasPrevious] = useState(false);
16
+
17
+ const handleNextCategoryAvailabilityChange = (hasNext: boolean) => {
18
+ setHasNext(hasNext);
19
+ };
20
+
21
+ const handlePreviousCategoryAvailabilityChange = (hasPrevious: boolean) => {
22
+ setHasPrevious(hasPrevious);
23
+ };
24
+
25
+ const handleNextClickOutside = () => {
26
+ (categoryResponseRef.current as any).handleNextClick();
27
+ }
28
+
29
+ const handlePreviousClickOutside = () => {
30
+ (categoryResponseRef.current as any).handlePreviousClick();
31
+ }
32
+
33
+ useEffect(() => {
34
+ console.log(serverData);
35
+ }, [serverData])
36
+
37
+ return (
38
+ <div style={{ height: '600px' }}>
39
+ <div>
40
+ <CategoryResponse
41
+ {...args}
42
+ serverReadyData={setServerData}
43
+ ref={categoryResponseRef}
44
+ onNextCategoryAvailabilityChange={handleNextCategoryAvailabilityChange}
45
+ onPreviousCategoryAvailabilityChange={handlePreviousCategoryAvailabilityChange}
46
+ >
47
+ </CategoryResponse>
48
+ </div>
49
+ <div>
50
+
51
+ {hasPrevious && (
52
+ <Button onClick={handlePreviousClickOutside}>Previous on Parent</Button>
53
+ )}
54
+
55
+ {hasNext && (
56
+ <Button onClick={handleNextClickOutside}>Next on Parent</Button>
57
+ )}
58
+ </div>
59
+ </div>
60
+ )
61
+ };
62
+
63
+ export const Primary = Template.bind({});
64
+ Primary.args = {
65
+ data: {
66
+ "_id": "E985B66B-5EA4-4A6F-81B9-0B12CAA99343",
67
+ "evaluationCycleId": "A3FE0C73-E771-40BB-B87D-1E40597841A6",
68
+ "questionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
69
+ "userId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
70
+ "targetUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
71
+ "startDate": 1678707055,
72
+ "endDate": 1679707055,
73
+ "state": "Draft",
74
+ "score": "0.000",
75
+ "categoryAnswers": [
76
+ {
77
+ "title": "Competências",
78
+ "key": "1",
79
+ "data": {
80
+ "_id": "57A06838-67F9-4726-BC36-719A0C797484",
81
+ "category_id": "CATEGORYID1",
82
+ "categoryName": "Competências",
83
+ "openAnswer": false,
84
+ "generalEvaluationLevel": "2",
85
+ "grade": "0",
86
+ "description": "Inserir resposta numa escala numérica entre 1 e 5, sendo que 1 corresponde a “Mau” e 5 corresponde a “Excelente”",
87
+ "score": "0.000",
88
+ "questions": [
89
+ {
90
+ "_id": "65562A64-A24B-425A-A345-560238CA2468",
91
+ "questionId": "7D17A8A5-E299-47D3-AB49-684135DB23A3",
92
+ "subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit",
93
+ "description": "This is a description",
94
+ "grade": "0",
95
+ "numberAnswer": null,
96
+ "answer": null
97
+ },
98
+ {
99
+ "_id": "85562A64-A24B-425A-A345-560238CA2468",
100
+ "questionId": "8D17A8A5-E299-47D3-AB49-684135DB23A3",
101
+ "subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elitLorem ipsum dolor sit amet, consectetur adipiscing elit",
102
+ "description": "This is a description ",
103
+ "grade": "0",
104
+ "numberAnswer": null,
105
+ "answer": null
106
+ }
107
+ ]
108
+ }
109
+ },
110
+ {
111
+ "title": "Category 2",
112
+ "key": "2",
113
+ "data": {
114
+ "_id": "57A06838-67F9-4726-BC36-719A0C797484",
115
+ "category_id": "CATEGORYID2",
116
+ "categoryName": "Category 2",
117
+ "openAnswer": false,
118
+ "generalEvaluationLevel": "0",
119
+ "grade": "100",
120
+ "description": "This is a description",
121
+ "score": "0.000",
122
+ "questions": []
123
+ },
124
+ "children": [
125
+ {
126
+ "title": "Category 2.1",
127
+ "key": "2.1",
128
+ "data": {
129
+ "_id": "57A06838-67F9-4726-BC36-719A0C797484",
130
+ "category_id": "1CDED10D-0984-46D4-A9B3-7EC518D74A63",
131
+ "categoryName": "Category 2.1",
132
+ "openAnswer": false,
133
+ "generalEvaluationLevel": "0",
134
+ "grade": "50",
135
+ "description": "This is a description",
136
+ "score": "0.000",
137
+ "questions": []
138
+ },
139
+ "children": [
140
+ {
141
+ "title": "Category 2.1.1",
142
+ "key": "2.1.1",
143
+ "data": {
144
+ "_id": "37A06838-67F9-4726-BC36-719A0C797484",
145
+ "category_id": "3CDED10D-0984-46D4-A9B3-7EC518D74A63",
146
+ "categoryName": "Category 2.1.1",
147
+ "openAnswer": false,
148
+ "generalEvaluationLevel": "0",
149
+ "grade": "50",
150
+ "description": "This is a description",
151
+ "score": "0.000",
152
+ "questions": [
153
+ {
154
+ "_id": "365562A64-A24B-425A-A345-560238CA2468",
155
+ "questionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
156
+ "subject": "This is a subject",
157
+ "description": "This is a description",
158
+ "grade": "50",
159
+ "numberAnswer": 4,
160
+ "answer": null
161
+ },
162
+ {
163
+ "_id": "35562A64-A24B-425A-A345-560238CA2468",
164
+ "questionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
165
+ "subject": "This is a subject",
166
+ "description": "This is a description",
167
+ "grade": "25",
168
+ "numberAnswer": 4,
169
+ "answer": null
170
+ },
171
+ {
172
+ "_id": "35562A64-A24B-425A-A345-560238CA2468",
173
+ "questionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
174
+ "subject": "This is a subject",
175
+ "description": "This is a description",
176
+ "grade": "25",
177
+ "numberAnswer": 3,
178
+ "answer": null
179
+ }
180
+ ]
181
+ }
182
+ }
183
+ ]
184
+ },
185
+ {
186
+ "title": "Category 2.2",
187
+ "key": "2.2",
188
+ "data": {
189
+ "_id": "57A06838-67F9-4726-BC36-719A0C797484",
190
+ "category_id": "PCDED10D-0984-46D4-A9B3-7EC518D74A63",
191
+ "categoryName": "Category 2.2",
192
+ "openAnswer": false,
193
+ "generalEvaluationLevel": "0",
194
+ "grade": "50",
195
+ "description": "This is a description",
196
+ "score": "0.000",
197
+ "questions": [
198
+ {
199
+ "_id": "P5562A64-A24B-425A-A345-560238CA2468",
200
+ "questionId": "PD17A8A5-E299-47D3-AB49-684135DB23A3",
201
+ "subject": "This is a subject",
202
+ "description": "This is a description",
203
+ "grade": "50",
204
+ "numberAnswer": 4,
205
+ "answer": "2"
206
+ },
207
+ {
208
+ "_id": "P5562A64-A24B-425A-A345-560238CA2468",
209
+ "questionId": "PD17A8A5-E299-47D3-AB49-684135DB23A3",
210
+ "subject": "This is a subject",
211
+ "description": "This is a description",
212
+ "grade": "50",
213
+ "numberAnswer": 2,
214
+ "answer": "5"
215
+ }
216
+ ]
217
+ },
218
+ "children": []
219
+ }
220
+ ]
221
+ },
222
+ {
223
+ "title": "Category 3",
224
+ "key": "3",
225
+ "data": {
226
+ "_id": "97A06838-67F9-4726-BC36-719A0C797484",
227
+ "category_id": "CATEGORYID3",
228
+ "categoryName": "Category 3",
229
+ "openAnswer": true,
230
+ "generalEvaluationLevel": "0",
231
+ "grade": "0",
232
+ "description": "This is a description",
233
+ "score": "0.000",
234
+ "questions": [
235
+ {
236
+ "_id": "95562A64-A24B-425A-A345-560238CA2468",
237
+ "questionId": "9D17A8A5-E299-47D3-AB49-684135DB23A3",
238
+ "subject": "This is a subject",
239
+ "description": "This is a description",
240
+ "grade": "0",
241
+ "numberAnswer": null,
242
+ "answer": null
243
+ },
244
+ {
245
+ "_id": "93862A64-A24B-425A-A345-560238CA2468",
246
+ "questionId": "9D38A8A5-E299-47D3-AB49-684135DB23A3",
247
+ "subject": "This is a subject",
248
+ "description": "This is a description",
249
+ "grade": "0",
250
+ "numberAnswer": null,
251
+ "answer": null
252
+ }
253
+ ]
254
+ }
255
+ },
256
+ ]
257
+ }
258
+ };
259
+
260
+
261
+
@@ -0,0 +1,81 @@
1
+ import translate from '../../constants/translationHelper';
2
+
3
+ export type EvaluationOption = {
4
+ value: string;
5
+ label: string;
6
+ };
7
+
8
+ export type EvaluationOptions = {
9
+ scale_0: EvaluationOption[];
10
+ scale_1: EvaluationOption[];
11
+ scale_2: EvaluationOption[];
12
+ };
13
+
14
+ export const evaluationOptions: EvaluationOptions = {
15
+ scale_0: [
16
+ {
17
+ value: '1',
18
+ label: '1',
19
+ },
20
+ {
21
+ value: '2',
22
+ label: '2',
23
+ },
24
+ {
25
+ value: '3',
26
+ label: '3',
27
+ },
28
+ {
29
+ value: '4',
30
+ label: '4',
31
+ },
32
+ {
33
+ value: '5',
34
+ label: '5',
35
+ }
36
+ ],
37
+ scale_1: [
38
+ {
39
+ value: '1',
40
+ label: '1',
41
+ },
42
+ {
43
+ value: '2',
44
+ label: '2',
45
+ },
46
+ {
47
+ value: '3',
48
+ label: '3',
49
+ },
50
+ {
51
+ value: '4',
52
+ label: '4',
53
+ },
54
+ ],
55
+ scale_2: [
56
+ {
57
+ value: '1',
58
+ label: '1',
59
+ },
60
+ {
61
+ value: '2',
62
+ label: '2',
63
+ },
64
+ {
65
+ value: '3',
66
+ label: '3',
67
+ },
68
+ {
69
+ value: '4',
70
+ label: '4',
71
+ },
72
+ {
73
+ value: '5',
74
+ label: '5',
75
+ },
76
+ {
77
+ value: 'na',
78
+ label: translate('components.categoryResponse.notApplicable')
79
+ }
80
+ ]
81
+ }
@@ -0,0 +1,280 @@
1
+ import styles from './styles.module.scss';
2
+ import { useEffect, useImperativeHandle, useState } from 'react';
3
+ import { Form } from 'antd';
4
+ import { useForm } from 'antd/es/form/Form';
5
+ import { InputField } from 'components/Input';
6
+ import { Button } from 'components/Button';
7
+ import classNames from 'classnames';
8
+ import TextArea from 'antd/es/input/TextArea';
9
+ import { Select } from 'components/Select';
10
+ import { EvaluationOptions, evaluationOptions } from './evaluationOptions';
11
+ import React from 'react';
12
+
13
+ interface CategoryResponse {
14
+ data: any;
15
+ serverReadyData: any;
16
+ onNextCategoryAvailabilityChange: (hasNext: boolean) => void;
17
+ onPreviousCategoryAvailabilityChange: (hasPrevious: boolean) => void;
18
+ };
19
+
20
+ type Category = {
21
+ title: string;
22
+ key: string;
23
+ data: any;
24
+ children?: Category[];
25
+ };
26
+
27
+ const updateCategoryAnswers = (categoryAnswers: any[], categoryToUpdate: any, updatedQuestions: any) => {
28
+ categoryAnswers.forEach((category: any) => {
29
+ if (category.data.category_id === categoryToUpdate.category_id) {
30
+ category.data.questions = category.data.questions.map((question: any, index: any) => {
31
+ return {
32
+ ...question,
33
+ answer: updatedQuestions[index].answer
34
+ };
35
+ });
36
+ }
37
+ else if (category.children && category.children.length > 0) {
38
+ updateCategoryAnswers(category.children, categoryToUpdate, updatedQuestions);
39
+ }
40
+ });
41
+ return categoryAnswers;
42
+ };
43
+
44
+ const findCategoryWithQuestions = (currentKey: string, categories: Category[], direction: 'next' | 'prev'): Category | null => {
45
+ let foundCurrent = false;
46
+
47
+ const searchCategories = (categoryList: Category[], direction: 'next' | 'prev'): Category | null => {
48
+ const iterable = direction === 'next' ? categoryList : [...categoryList].reverse();
49
+
50
+ for (const category of iterable) {
51
+ if (foundCurrent) {
52
+ if (category.data.questions.length > 0) {
53
+ return category;
54
+ }
55
+ } else if (category.key === currentKey) {
56
+ foundCurrent = true;
57
+ }
58
+
59
+ if (category.children) {
60
+ const result = searchCategories(category.children, direction);
61
+ if (result) {
62
+ return result;
63
+ }
64
+ }
65
+ }
66
+ return null;
67
+ };
68
+
69
+ return searchCategories(categories, direction);
70
+ };
71
+
72
+ const getCategoryObject = (currentKey: string, categories: Category[], direction: 'next' | 'prev'): any => {
73
+ const category = findCategoryWithQuestions(currentKey, categories, direction);
74
+ return category ? category.data : null;
75
+ };
76
+
77
+ const hasCategory = (currentKey: string, categories: Category[], direction: 'next' | 'prev'): boolean => {
78
+ const category = findCategoryWithQuestions(currentKey, categories, direction);
79
+ return !!category;
80
+ };
81
+
82
+ const getTitleWithQuestionCount = (category: any): string => {
83
+ const questionCount = category?.data?.questions?.length;
84
+ const answeredQuestions = category?.data?.questions?.filter((question: any) => question.answer !== null && question.answer !== undefined && question.answer !== '').length;
85
+
86
+ return questionCount
87
+ ? `${category.title} - ${answeredQuestions} / ${questionCount}`
88
+ : category.title ;
89
+ };
90
+
91
+ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref) => {
92
+ const { data } = props;
93
+
94
+ const [currentKey, setCurrentKey] = useState(data.categoryAnswers[0].key);
95
+ const [localData, setLocalData] = useState<any>(data);
96
+ // Setting first set of questions as default open
97
+ const [selectedCategory, setSelectedCategory] = useState<any>(data.categoryAnswers[0]);
98
+ const [initialValues, setInitialValues] = useState<any>(data.categoryAnswers[0].data);
99
+ const [form] = useForm();
100
+
101
+
102
+ const updateInitialValues = (data: any) => {
103
+ const {
104
+ questions,
105
+ openAnswer
106
+ } = data;
107
+
108
+ const initial = {
109
+ questions: questions.map((question: any) => ({
110
+ subject: question.subject,
111
+ description: question.description,
112
+ answer: question.answer || ""
113
+ })),
114
+ openAnswer: openAnswer
115
+ };
116
+
117
+ setInitialValues(initial);
118
+ form.setFieldsValue(initial);
119
+ };
120
+
121
+ const handleLabelClick = (category: any, index: number) => {
122
+ setSelectedCategory(category);
123
+ updateInitialValues(category.data);
124
+ setCurrentKey(index);
125
+ };
126
+
127
+ const onFinish = (values: any) => {
128
+ const updatedQuestions = initialValues.questions.map((question: any, index: number) => {
129
+ return {
130
+ ...question,
131
+ answer: values.questions[index].answer
132
+ };
133
+ });
134
+
135
+ const updatedCategory = updateCategoryAnswers(localData.categoryAnswers, selectedCategory.data, updatedQuestions);
136
+
137
+ const updatedLocalData = { ...localData, categoryAnswers: updatedCategory };
138
+
139
+ setLocalData(updatedLocalData);
140
+ };
141
+
142
+ const renderCategories = (categories: any) => {
143
+ return categories.map((category: any, index: number) => {
144
+ const labelClasses = classNames({
145
+ [styles.cursorPointer]: category.data.questions.length > 0
146
+ }, [styles.label]);
147
+
148
+ const indexCheck = category.data.questions.length > 0 && category.key;
149
+
150
+ return (
151
+ <div
152
+ className={`${styles.labelWrapper} ${category.data.category_id === selectedCategory.data.category_id ? styles.active : ""}`}
153
+ key={index}
154
+ >
155
+ <div
156
+ className={labelClasses}
157
+ data-index={indexCheck}
158
+ onClick={() => category.data.questions.length > 0 && handleLabelClick(category, indexCheck)}
159
+ >
160
+ {getTitleWithQuestionCount(category)}
161
+ </div>
162
+ {category.children && (
163
+ <div className={styles.subCategory}>
164
+ {renderCategories(category.children)}
165
+ </div>
166
+ )}
167
+ </div>
168
+ )
169
+ });
170
+ };
171
+
172
+ const handleNextClick = () => {
173
+ const nextCategory = findCategoryWithQuestions(currentKey, localData.categoryAnswers, 'next');
174
+ if (nextCategory) {
175
+ setCurrentKey(nextCategory.key);
176
+ setSelectedCategory(nextCategory);
177
+ }
178
+
179
+ const nextCategoryData = getCategoryObject(currentKey, localData.categoryAnswers, 'next');
180
+ setSelectedCategory(nextCategoryData ? { ...nextCategory, data: nextCategoryData } : null);
181
+ updateInitialValues(nextCategoryData);
182
+ };
183
+
184
+ const handlePreviousClick = () => {
185
+ const prevCategory = findCategoryWithQuestions(currentKey, localData.categoryAnswers, 'prev');
186
+ if (prevCategory) {
187
+ setCurrentKey(prevCategory.key);
188
+ setSelectedCategory(prevCategory);
189
+ }
190
+
191
+ const prevCategoryData = getCategoryObject(currentKey, localData.categoryAnswers, 'prev');
192
+ setSelectedCategory(prevCategoryData ? { ...prevCategory, data: prevCategoryData } : null);
193
+ updateInitialValues(prevCategoryData);
194
+ };
195
+
196
+ useImperativeHandle(ref, () => ({
197
+ handleNextClick,
198
+ handlePreviousClick,
199
+ }));
200
+
201
+ useEffect(() => {
202
+ props.serverReadyData(localData);
203
+ }, [localData]);
204
+
205
+ useEffect(() => {
206
+ const hasNext = hasCategory(currentKey, localData.categoryAnswers, 'next');
207
+ props.onNextCategoryAvailabilityChange(hasNext);
208
+
209
+ const hasPrevious = hasCategory(currentKey, localData.categoryAnswers, 'prev');
210
+ props.onPreviousCategoryAvailabilityChange(hasPrevious);
211
+ }, [currentKey, localData.categoryAnswers, props]);
212
+
213
+ const questionWrapper = classNames({
214
+ [styles.questionWrapperOpenAnswer]: selectedCategory.data.openAnswer,
215
+ }, [styles.questionWrapper]);
216
+
217
+ // This gets the scale we use for each select from the database using a key based variable,if
218
+ // any new generalEvaluationLevel is added to the backend we need to update our own without
219
+ // deleting any of the previous so we dont mess up the project history.
220
+ const selectedEvaluationOption = `scale_${selectedCategory?.data?.generalEvaluationLevel}` as keyof typeof evaluationOptions;
221
+
222
+ return (
223
+ <div className={styles.categoryResponse}>
224
+ <div className={styles.sidebarWrapper}>
225
+ <div className={styles.title}>Categorias</div>
226
+ {renderCategories(localData.categoryAnswers)}
227
+ </div>
228
+ <div className={styles.contentWrapper}>
229
+ <Form
230
+ initialValues={initialValues}
231
+ name="dynamic_form_nest_item"
232
+ onFinish={onFinish}
233
+ autoComplete="off"
234
+ form={form}
235
+ >
236
+ <div className={styles.details}>
237
+ <div className={styles.categoryName}>
238
+ {selectedCategory?.data?.categoryName}
239
+ </div>
240
+ <div className={styles.categoryDescription}>
241
+ {selectedCategory?.data?.description}
242
+ </div>
243
+ </div>
244
+ {selectedCategory?.data?.questions.map((question: any, index: number) => (
245
+ <div className={questionWrapper} key={index}>
246
+ <div className={styles.question}>
247
+ <div className={styles.subject}>
248
+ {question.subject}
249
+ </div>
250
+ <div className={styles.description}>
251
+ {question.description}
252
+ </div>
253
+ </div>
254
+ <div className={styles.answer}>
255
+ {selectedCategory.data.openAnswer
256
+ ? <Form.Item
257
+ name={["questions", index, "answer"]}
258
+ >
259
+ <TextArea />
260
+ </Form.Item>
261
+ : <Form.Item
262
+ name={["questions", index, "answer"]}
263
+ >
264
+ <Select options={evaluationOptions[selectedEvaluationOption]}
265
+ style={{ minWidth: '100%' }}
266
+ />
267
+ </Form.Item>
268
+ }
269
+ </div>
270
+ </div>
271
+ ))}
272
+
273
+ {selectedCategory?.data?.questions.length > 0 && (
274
+ <Button onClick={() => form.submit()}>Answer</Button>
275
+ )}
276
+ </Form>
277
+ </div>
278
+ </div>
279
+ );
280
+ });