File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,11 @@ function SearchResults() {
19
19
return (
20
20
< div className = "container mt-5" >
21
21
< h2 > Search Results for "{ searchTerm } "</ h2 >
22
- { filteredCourses . length > 0 ? (
23
- < div className = "row row-cols-1 row-cols-md-3 g-3" >
24
- { filteredCourses . map ( ( course , index ) => (
22
+ < div className = "row row-cols-1 row-cols-md-3 g-3" >
23
+ { Object . entries ( courses ) . map ( ( [ key , course ] , index ) => (
25
24
< div className = "col" key = { index } >
26
25
< div className = "card h-100" >
27
- < Link to = { `/courses/${ course . title . replace ( / \s + / g , '-' ) . toLowerCase ( ) } ` } className = 'lnk' >
26
+ < Link to = { `/courses/${ key } ` } className = 'lnk' >
28
27
< img src = { course . image } className = "card-img-top" alt = { course . title } />
29
28
< div className = "card-body" >
30
29
< h5 className = "card-title" > { course . title } </ h5 >
@@ -35,6 +34,7 @@ function SearchResults() {
35
34
</ div >
36
35
) ) }
37
36
</ div >
37
+ </ div >
38
38
) : (
39
39
< h4 className = "text-center" > No results found</ h4 >
40
40
) }
You can’t perform that action at this time.
0 commit comments