import { ImageResponse } from 'next/og'; import * as OpengraphImage from '@/components/OpengraphImage'; import { fetchRepository } from '@/lib/repositoryApi'; import { cookies } from 'next/headers'; import { getPostBySlug } from '@/ghost/lib/contentClient'; import { PostOrPage } from '@tryghost/content-api'; import { notFound } from 'next/navigation'; // Route segment config export const runtime = 'edge'; export const contentType = 'image/png'; // Image generation export default async function Image({ params }: any) { const authToken = cookies().get('oxen_user_token')?.value; const options = await OpengraphImage.options(); const paper = await getPostBySlug(params.paperSlug); if (!paper) { notFound(); } return new ImageResponse( ( // ImageResponse JSX element ), // ImageResponse options { ...options, }, ); }