2023-08-16 23:28:02 +08:00
|
|
|
import Link from 'next/link'
|
|
|
|
import { slug } from 'github-slugger'
|
2022-10-07 13:55:39 +08:00
|
|
|
interface Props {
|
2023-08-16 23:28:02 +08:00
|
|
|
text: string
|
2022-10-07 13:55:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const Tag = ({ text }: Props) => {
|
2022-07-17 21:40:41 +08:00
|
|
|
return (
|
2023-08-16 23:28:02 +08:00
|
|
|
<Link
|
|
|
|
href={`/tags/${slug(text)}`}
|
|
|
|
className="mr-3 text-sm font-medium uppercase text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"
|
|
|
|
>
|
|
|
|
{text.split(' ').join('-')}
|
2022-07-17 21:40:41 +08:00
|
|
|
</Link>
|
2023-08-16 23:28:02 +08:00
|
|
|
)
|
|
|
|
}
|
2022-07-17 21:40:41 +08:00
|
|
|
|
2023-08-16 23:28:02 +08:00
|
|
|
export default Tag
|