This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
import type { MouseEvent } from 'react'
|
||||
import type { FC, MouseEvent } from 'react'
|
||||
|
||||
import type { Post } from '@/types'
|
||||
|
||||
type Props = { posts: Post[]
|
||||
onClick?: (event: MouseEvent<HTMLElement>) => void }
|
||||
|
||||
|
||||
export default ({ posts, onClick }: Props) => (
|
||||
export default (({ posts, onClick }: Props) => (
|
||||
<div className="flex flex-wrap gap-6 p-4">
|
||||
{posts.map ((post, i) => (
|
||||
<Link to={`/posts/${ post.id }`}
|
||||
@@ -22,4 +23,4 @@ export default ({ posts, onClick }: Props) => (
|
||||
decoding="async"
|
||||
className="object-none w-full h-full" />
|
||||
</Link>))}
|
||||
</div>)
|
||||
</div>)) satisfies FC<Props>
|
||||
|
||||
Reference in New Issue
Block a user