diff --git a/src/app/(isr)/og/page.tsx b/src/app/(isr)/og/page.tsx index e8272969..3183cefb 100644 --- a/src/app/(isr)/og/page.tsx +++ b/src/app/(isr)/og/page.tsx @@ -1,14 +1,30 @@ -import StaggeredPhotos from '@/photo/StaggeredPhotos'; -import { getPhotos } from '@/services/postgres'; +import MorePhotos from '@/components/MorePhotos'; +import { getPhotosLimitForQuery } from '@/photo'; +import StaggeredOgPhotos from '@/photo/StaggeredOgPhotos'; +import { getPhotos, getPhotosCount } from '@/services/postgres'; export const runtime = 'edge'; -export default async function GridPage() { - const photos = await getPhotos(); +export default async function GridPage({ + searchParams, +}: { + searchParams: { next: string }; +}) { + const { offset, limit } = getPhotosLimitForQuery(searchParams.next); + + const photos = await getPhotos(undefined, limit); + + const count = await getPhotosCount(); + + const showMorePhotos = count > photos.length; return ( -