Vercel/app/admin/recipe/[photoId]/page.tsx
2025-02-21 17:24:19 -06:00

30 lines
819 B
TypeScript

import SiteGrid from '@/components/SiteGrid';
import { getPhoto, getPhotos } from '@/photo/db/query';
import PhotoRecipeOverlay from '@/photo/PhotoRecipeOverlay';
export default async function AdminRecipePage({
params,
}: {
params: Promise<{ photoId: string }>
}) {
const { photoId } = await params;
const photo = await getPhoto(photoId);
const photosHidden = await getPhotos({ hidden: 'only' });
const { filmSimulation } = photo!;
const { fujifilmRecipe } = photosHidden[0];
return (
<SiteGrid
contentMain={photo && fujifilmRecipe && filmSimulation
? <PhotoRecipeOverlay
backgroundImageUrl={photo.url}
recipe={fujifilmRecipe}
simulation={filmSimulation}
/>
: <div>
Can&apos;t find photo/recipe
</div>}
/>
);
}