add theme nav & add pageIcon support of @lib/getNotionData

This commit is contained in:
emengweb
2023-10-13 03:14:03 +00:00
parent 8e01d0713e
commit a4d9007a2a
48 changed files with 2483 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
import BlogPostCard from './BlogPostCard'
import BLOG from '@/blog.config'
import NavPostListEmpty from './NavPostListEmpty'
import PaginationSimple from './PaginationSimple'
/**
* 文章列表分页表格
* @param page 当前页
* @param posts 所有文章
* @param tags 所有标签
* @returns {JSX.Element}
* @constructor
*/
const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
const totalPage = Math.ceil(postCount / BLOG.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