Files
mypage/components/blog/tag-cloud.tsx
RJ a2bd055879 🖼️ added images support
- Should investigate how to resize the image from .md specs
2025-11-21 16:15:15 +02:00

37 lines
862 B
TypeScript

import Link from 'next/link'
import { TagInfo } from '@/lib/tags'
interface TagCloudProps {
tags: Array<TagInfo & { size: 'sm' | 'md' | 'lg' | 'xl' }>
}
export function TagCloud({ tags }: TagCloudProps) {
const sizeClasses = {
sm: 'text-xs opacity-70',
md: 'text-sm',
lg: 'text-base font-bold',
xl: 'text-lg font-bold',
}
return (
<div className="flex flex-wrap gap-4 items-baseline">
{tags.map(tag => (
<Link
key={tag.slug}
href={`/tags/${tag.slug}`}
className={`
${sizeClasses[tag.size]}
font-mono uppercase
text-zinc-400
hover:text-cyan-400
transition-colors
`}
title={`${tag.count} ${tag.count === 1 ? 'articol' : 'articole'}`}
>
#{tag.name}
</Link>
))}
</div>
)
}