This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
import type { Post } from '@/types'
|
||||
|
||||
type Props = { posts: Post[] }
|
||||
|
||||
|
||||
export default ({ posts }: Props) => (
|
||||
<div className="flex flex-wrap gap-6 p-4">
|
||||
{posts.map ((post, i) => (
|
||||
<Link to={`/posts/${ post.id }`}
|
||||
key={i}
|
||||
className="w-40 h-40 overflow-hidden rounded-lg shadow-md hover:shadow-lg">
|
||||
<img src={post.thumbnail || post.thumbnailBase || undefined}
|
||||
alt={post.title || post.url}
|
||||
title={post.title || post.url || undefined}
|
||||
loading="eager"
|
||||
fetchPriority="high"
|
||||
decoding="async"
|
||||
className="object-none w-full h-full" />
|
||||
</Link>))}
|
||||
</div>)
|
||||
Reference in New Issue
Block a user