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 ( ) => {
@@ -129,11 +136,22 @@ function Sidebar() {
129
136
</ Card . Text >
130
137
</ Card . Body >
131
138
</ Card >
132
- < div >
139
+ { /* <div>
133
140
<Button variant="success" onClick={() => setDifficulty('easy')}>Easy</Button>{' '}
134
141
<Button variant="warning" onClick={() => setDifficulty('medium')}>Medium</Button>{' '}
135
142
<Button variant="danger" onClick={() => setDifficulty('hard')}>Hard</Button>{' '}
136
- </ div >
143
+ </div> */ }
144
+ < Form . Select
145
+ aria-label = "Select difficulty"
146
+ onChange = { ( e ) => setDifficulty ( e . target . value ) }
147
+ >
148
+ < option value = "" > Select difficulty</ option >
149
+ { difficultyLevels . map ( ( level ) => (
150
+ < option key = { level . value } value = { level . value } >
151
+ { level . label }
152
+ </ option >
153
+ ) ) }
154
+ </ Form . Select >
137
155
138
156
{ /* Category Dropdown */ }
139
157
< Form . Select
You can’t perform that action at this time.
0 commit comments