import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import Link from 'next/link' import { useRouter } from 'next/router' import BlogPost from './BlogPost' export const BlogListPage = props => { const { page = 1, posts, postCount } = props const { locale } = useGlobal() const router = useRouter() const { NOTION_CONFIG } = useGlobal() const POSTS_PER_PAGE = siteConfig('POSTS_PER_PAGE', null, NOTION_CONFIG) const totalPage = Math.ceil(postCount / POSTS_PER_PAGE) const currentPage = +page const showPrev = currentPage > 1 const showNext = currentPage < totalPage && posts?.length > 0 const pagePrefix = router.asPath .split('?')[0] .replace(/\/page\/[1-9]\d*/, '') .replace(/\/$/, '') .replace('.html', '') return (