import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' import { useRouter } from 'next/router' import Link from 'next/link' export const BlogList = (props) => { const { page, posts, postCount } = props const { locale } = useGlobal() const router = useRouter() const totalPage = Math.ceil(postCount / BLOG.POSTS_PER_PAGE) const showNext = page < totalPage && posts.length === BLOG.POSTS_PER_PAGE && posts.length < postCount const currentPage = +page return
{posts.map(p => (

{p.title}

by {BLOG.AUTHOR} on {p.date?.start_date || p.createdTime} | {p.category} {/* | */} {/* 2 Comments */}

{p.summary}

{/* 搜索结果 */} {p.results && (

{p.results.map(r => ( {r} ))}

)}
))}
1 ? 'bg-black ' : 'bg-gray pointer-events-none '} text-white no-underline py-2 px-3 rounded`}>{locale.PAGINATION.PREV} {locale.PAGINATION.NEXT}
}