femto-webapp/src/components/PostsList.tsx
2025-05-04 12:57:43 +02:00

20 lines
500 B
TypeScript

import { Post } from '../model/posts/posts.ts'
import PostItem from './PostItem'
interface PostsFeedProps {
pages: Post[][]
}
export default function PostsList({ pages }: PostsFeedProps) {
return <div className="flex flex-col gap-6 w-full">{pages.map(renderPage)}</div>
}
function renderPage(posts: Post[]) {
return (
<div className="flex flex-col gap-6 w-full">
{posts.map((post, idx) => (
<PostItem key={post.postId} post={post} index={idx} />
))}
</div>
)
}