2023-08-16 23:55:57 +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:55:57 +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:29:22 +08:00
|
|
|
<Link
|
|
|
|
href={`/tags/${slug(text)}`}
|
2023-08-16 23:55:57 +08:00
|
|
|
className="mr-3 text-sm font-medium uppercase text-primary-500 hover:text-primary-600 dark:hover:text-primary-400">
|
2023-08-16 23:29:22 +08:00
|
|
|
{text.split(' ').join('-')}
|
2022-07-17 21:40:41 +08:00
|
|
|
</Link>
|
2023-08-16 23:55:57 +08:00
|
|
|
);
|
|
|
|
};
|
2022-07-17 21:40:41 +08:00
|
|
|
|
2023-08-16 23:55:57 +08:00
|
|
|
export default Tag;
|