import BlogPostCard from './BlogPostCard' import BlogPostListEmpty from './BlogPostListEmpty' import React, { useRef } from 'react' /** * 博客列表滚动分页 * @param posts 所有文章 * @param tags 所有标签 * @returns {JSX.Element} * @constructor */ const BlogPostListScroll = ({ posts = [], currentSearch }) => { const targetRef = useRef(null) const filteredPosts = Object.assign(posts) if (!filteredPosts || filteredPosts.length === 0) { return } else { return
{/* 文章列表 */} {filteredPosts?.map(group => { if (group.category) { return <>
{group.category}
{group.items?.map(post => (
))} } else { return <> {group.items?.map(post => ())} } })}
} } export default BlogPostListScroll