File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,13 @@ function Sidebar() {
31
31
32
32
const navigate = useNavigate ( ) ;
33
33
34
+ // Static array for difficulty options
35
+ const difficultyLevels = [
36
+ { label : 'Easy' , value : 'easy' } ,
37
+ { label : 'Medium' , value : 'medium' } ,
38
+ { label : 'Hard' , value : 'hard' } ,
39
+ ] ;
40
+
34
41
useEffect ( ( ) => {
35
42
// Fetch categories from backend
36
43
const fetchCategories = async ( ) => {
@@ -120,11 +127,22 @@ function Sidebar() {
120
127
</ Card . Text >
121
128
</ Card . Body >
122
129
</ Card >
123
- < div >
130
+ { /* <div>
124
131
<Button variant="success" onClick={() => setDifficulty('easy')}>Easy</Button>{' '}
125
132
<Button variant="warning" onClick={() => setDifficulty('medium')}>Medium</Button>{' '}
126
133
<Button variant="danger" onClick={() => setDifficulty('hard')}>Hard</Button>{' '}
127
- </ div >
134
+ </div> */ }
135
+ < Form . Select
136
+ aria-label = "Select difficulty"
137
+ onChange = { ( e ) => setDifficulty ( e . target . value ) }
138
+ >
139
+ < option value = "" > Select difficulty</ option >
140
+ { difficultyLevels . map ( ( level ) => (
141
+ < option key = { level . value } value = { level . value } >
142
+ { level . label }
143
+ </ option >
144
+ ) ) }
145
+ </ Form . Select >
128
146
129
147
{ /* Category Dropdown */ }
130
148
< Form . Select
You can’t perform that action at this time.
0 commit comments