File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
refactor/src/components/Category Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
import Link from 'next/link' ;
2
2
import { v4 as uuidv4 } from 'uuid' ;
3
3
4
- /**
5
- * Map over the categories and display them individually.
6
- * Uses uuidv4 for unique key IDs
7
- * @param {Object } categories Product categories
8
- */
9
- const Categories = ( { categories } : any ) => (
4
+ interface ICategoriesProps {
5
+ categories : { id : string ; name : string ; slug : string } [ ] ;
6
+ }
7
+
8
+ const Categories = ( { categories } : ICategoriesProps ) => (
10
9
< section className = "container mx-auto bg-white" >
11
10
< div className = "grid gap-2 px-2 pt-2 pb-2 lg:px-0 xl:px-0 md:px-0 lg:grid-cols-4 sm:grid-cols-2 md:grid-cols-3 xs:grid-cols-3" >
12
- { categories . map ( ( { id, name, slug } : any ) => (
11
+ { categories . map ( ( { id, name, slug } ) => (
13
12
< Link
14
13
key = { uuidv4 ( ) }
15
14
as = { `/kategori/${ slug } ?id=${ id } ` }
You can’t perform that action at this time.
0 commit comments