@@ -35,7 +35,7 @@ interface Question {
35
35
const ITEMS_PER_PAGE_OPTIONS = [ 5 , 10 ] ; // Number of items to display per page
36
36
37
37
const InterviewQuestionsTable : React . FC = ( ) => {
38
- const [ questionsData , setQuestions ] = useState < Question [ ] > ( [ ] ) ;
38
+ const [ questionsData , setQuestionsData ] = useState < Question [ ] > ( [ ] ) ;
39
39
const [ selectedCategories , setSelectedCategories ] = useState < string [ ] > ( [ ] ) ;
40
40
const [ currentPage , setCurrentPage ] = useState < number > ( 0 ) ;
41
41
const [ itemsPerPage , setItemsPerPage ] = useState < number > (
@@ -52,10 +52,11 @@ const InterviewQuestionsTable: React.FC = () => {
52
52
getQuestions ( ) ;
53
53
}
54
54
getInterviewQuestions ( ) ;
55
+ // eslint-disable-next-line
55
56
} , [ ] ) ;
56
57
57
58
useEffect ( ( ) => {
58
- setQuestions ( questions ) ;
59
+ setQuestionsData ( questions ) ;
59
60
} , [ questions ] ) ;
60
61
61
62
const handleCategoriesChange = ( event : SelectChangeEvent < unknown > ) => {
@@ -110,9 +111,9 @@ const InterviewQuestionsTable: React.FC = () => {
110
111
if ( selected . length === 0 ) {
111
112
return < em > Filter by category</ em > ;
112
113
} else {
113
- return ( selected as string [ ] ) . join ( ", " ) }
114
+ return ( selected as string [ ] ) . join ( ", " ) ;
114
115
}
115
- }
116
+ } }
116
117
style = { { marginTop : "10px" , marginBottom : "10px" , width : "80%" } }
117
118
>
118
119
{ uniqueCategories . map ( ( category ) => (
@@ -146,7 +147,7 @@ const InterviewQuestionsTable: React.FC = () => {
146
147
color : "inherit" ,
147
148
fontSize : "16px" ,
148
149
fontWeight : "bold" ,
149
- textTransform : "initial"
150
+ textTransform : "initial" ,
150
151
} }
151
152
>
152
153
{ question . title }
@@ -192,14 +193,14 @@ const InterviewQuestionsTable: React.FC = () => {
192
193
{ selectedQuestion && (
193
194
< >
194
195
< DialogTitle > { selectedQuestion . title } </ DialogTitle >
195
- < DialogContent >
196
- < Typography variant = "body2" style = { { padding : "5px" } } >
197
- < b > Categories:</ b > { selectedQuestion . categories . join ( ", " ) }
196
+ < DialogContent >
197
+ < Typography variant = "body2" style = { { padding : "5px" } } >
198
+ < b > Categories:</ b > { selectedQuestion . categories . join ( ", " ) }
198
199
</ Typography >
199
- < Typography variant = "body2" style = { { padding : "5px" } } >
200
+ < Typography variant = "body2" style = { { padding : "5px" } } >
200
201
< b > Difficulty:</ b > { selectedQuestion . difficulty }
201
202
</ Typography >
202
- < Typography variant = "body2" style = { { padding : "5px" } } >
203
+ < Typography variant = "body2" style = { { padding : "5px" } } >
203
204
< b > Description</ b > : { selectedQuestion . description }
204
205
</ Typography >
205
206
</ DialogContent >
0 commit comments