jonbio/components/Tag.tsx

19 lines
393 B
TypeScript
Raw Normal View History

2023-07-07 11:17:22 +08:00
import Link from 'next/link'
2023-07-09 17:27:47 +08:00
import { slug } from 'github-slugger'
2023-07-07 11:17:22 +08:00
interface Props {
text: string
}
const Tag = ({ text }: Props) => {
return (
<Link
2023-07-09 17:27:47 +08:00
href={`/tags/${slug(text)}`}
2023-07-07 11:17:22 +08:00
className="mr-3 text-sm font-medium uppercase text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"
>
{text.split(' ').join('-')}
</Link>
)
}
export default Tag