diff --git a/src/app/(frontend)/posts/page/page.tsx b/src/app/(frontend)/posts/page/page.tsx index 8c8cc1b..e02fe14 100644 --- a/src/app/(frontend)/posts/page/page.tsx +++ b/src/app/(frontend)/posts/page/page.tsx @@ -6,106 +6,70 @@ import type { Post, Media } from '@/payload-types' import { FDImage } from '@/components/FDImage' import { formatDateTime } from '@/utilities/formatDateTime' import { Pagination } from '@/components/Pagination' -import PageClient from './page.client' export const dynamic = 'force-dynamic' -export default async function Page() { +export default async function Page({ params }: { params: Promise<{ pageNumber: string }> }) { + const { pageNumber } = await params const payload = await getPayload({ config: configPromise }) const posts = await payload.find({ collection: 'posts', depth: 1, limit: 12, + page: parseInt(pageNumber, 10), overrideAccess: false, select: { title: true, slug: true, heroImage: true, - categories: true, meta: true, publishedAt: true, - populatedAuthors: true, }, }) return (
- {posts.totalDocs} {posts.totalDocs === 1 ? 'artikel' : 'artiklar'} -
-Inga inlägg hittades.
- ) : ( -- {summary} -
- )} - - {/* Date */} - {p.publishedAt && ( -- {formatDateTime(p.publishedAt)} -
- )} -+ {formatDateTime(p.publishedAt)} +
+ )} +