Vercel/src/app/(isr)/grid/page.tsx
Sam Becker df11a86181 Init
2023-09-05 09:00:57 -05:00

30 lines
782 B
TypeScript

import SiteGrid from '@/components/SiteGrid';
import { generateImageMetaForPhoto } from '@/photo';
import PhotoGrid from '@/photo/PhotoGrid';
import PhotosEmptyState from '@/photo/PhotosEmptyState';
import { getPhotos } from '@/services/postgres';
import { Metadata } from 'next';
export const runtime = 'edge';
export const dynamic = 'force-static';
export async function generateMetadata(): Promise<Metadata> {
const photos = await getPhotos();
return generateImageMetaForPhoto(photos[0]);
}
export default async function GridPage() {
const photos = await getPhotos();
return (
photos.length > 0
? <SiteGrid
contentMain={<PhotoGrid
photos={photos}
staggerOnFirstLoadOnly
/>}
/>
: <PhotosEmptyState />
);
}