changes
This commit is contained in:
parent
be90a09ce4
commit
3c7c2a6957
6 changed files with 30 additions and 33 deletions
|
@ -2,14 +2,18 @@ import { Post } from '../model/posts/posts.ts'
|
|||
import PostItem from './PostItem'
|
||||
|
||||
interface PostsFeedProps {
|
||||
posts: Post[]
|
||||
pages: Post[][]
|
||||
}
|
||||
|
||||
export default function PostsList({ posts }: PostsFeedProps) {
|
||||
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) => (
|
||||
<PostItem key={post.postId} post={post} />
|
||||
{posts.map((post, idx) => (
|
||||
<PostItem key={post.postId} post={post} index={idx} />
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue