mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
24 lines
428 B
TypeScript
24 lines
428 B
TypeScript
import React from 'react'
|
|
import { Link } from 'react-router-dom'
|
|
|
|
const CategoryLink = ({
|
|
category,
|
|
children,
|
|
className,
|
|
...props
|
|
}: {
|
|
category: string
|
|
children?: any
|
|
className?: string
|
|
}) => (
|
|
<Link
|
|
to={`/search?categories=${encodeURIComponent(category)}`}
|
|
className={className}
|
|
{...props}
|
|
>
|
|
{children || category}
|
|
</Link>
|
|
)
|
|
|
|
export default CategoryLink
|