19 lines
458 B
TypeScript
19 lines
458 B
TypeScript
import { getPhotoCached } from '@/cache';
|
|
import PhotoShareModal from '@/photo/PhotoShareModal';
|
|
import { PATH_ROOT } from '@/site/paths';
|
|
import { redirect } from 'next/navigation';
|
|
|
|
export const runtime = 'edge';
|
|
|
|
export default async function Share({
|
|
params: { photoId },
|
|
}: {
|
|
params: { photoId: string }
|
|
}) {
|
|
const photo = await getPhotoCached(photoId);
|
|
|
|
if (!photo) { return redirect(PATH_ROOT); }
|
|
|
|
return <PhotoShareModal photo={photo} />;
|
|
}
|