|
import BlogPostCard from './BlogPostCard' |
|
import { siteConfig } from '@/lib/config' |
|
import NavPostListEmpty from './NavPostListEmpty' |
|
import PaginationSimple from './PaginationSimple' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const BlogPostListPage = ({ page = 1, posts = [], postCount }) => { |
|
const totalPage = Math.ceil(postCount / parseInt(siteConfig('POSTS_PER_PAGE'))) |
|
|
|
if (!posts || posts.length === 0) { |
|
return <NavPostListEmpty /> |
|
} |
|
|
|
return ( |
|
<div className='w-full justify-center'> |
|
<div id='posts-wrapper'> |
|
{/* 文章列表 */} |
|
{posts?.map(post => ( |
|
<BlogPostCard key={post.id} post={post} /> |
|
))} |
|
</div> |
|
<PaginationSimple page={page} totalPage={totalPage} /> |
|
</div> |
|
) |
|
} |
|
|
|
export default BlogPostListPage |
|
|