CategoryFilter
Component for filtering products by category
Preview
Code
"use client"
type Category = {
code: string
name: string
subCategories: Array<any>
}
interface CategoryFilterProperties {
categoryTree: Array<Category>
}
const CategoryFilter = ({ categoryTree }: CategoryFilterProperties) => {
return (
<ul className="space-y-4 border-b border-gray-200 pb-6 text-sm md:text-base font-medium text-gray-900 cursor-pointer">
{categoryTree.map((tree) => {
return (
<li key={tree.code} onClick={() => null}>
{tree.name}
</li>
)
})}
</ul>
)
}
export default CategoryFilter