mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 23:16:51 +00:00
fix map key
This commit is contained in:
@@ -18,14 +18,14 @@ const BlogPostListScroll = ({ posts = [], currentSearch }) => {
|
|||||||
} else {
|
} else {
|
||||||
return <div id='container' ref={targetRef} className='w-full'>
|
return <div id='container' ref={targetRef} className='w-full'>
|
||||||
{/* 文章列表 */}
|
{/* 文章列表 */}
|
||||||
{filteredPosts?.map(group => {
|
{filteredPosts?.map((group, index) => {
|
||||||
if (group.category) {
|
if (group.category) {
|
||||||
return <>
|
return <div key={index}>
|
||||||
<div className='text-md font-sans ' key={group.category}>{group.category}</div>
|
<div className='text-md font-sans ' key={group.category}>{group.category}</div>
|
||||||
{group.items?.map(post => (<div key={post.id} className='pl-6 border-l'><BlogPostCard className='text-sm' post={post} /></div>))}
|
{group.items?.map(post => (<div key={post.id} className='pl-6 border-l'><BlogPostCard className='text-sm' post={post} /></div>))}
|
||||||
</>
|
</div>
|
||||||
} else {
|
} else {
|
||||||
return <> {group.items?.map(post => (<BlogPostCard key={post.id} post={post} className='text-md' />))}</>
|
return <div key={index}> {group.items?.map(post => (<BlogPostCard key={post.id} post={post} className='text-md' />))}</div>
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user