import { ImageResponse } from 'next/server' import { getSharedChat } from '@/app/actions' export const runtime = 'edge' export const alt = 'AI Chatbot' export const size = { width: 1200, height: 630 } export const contentType = 'image/png' const interRegular = fetch( new URL('../../../assets/fonts/Inter-Regular.ttf', import.meta.url) ).then(res => res.arrayBuffer()) const interBold = fetch( new URL('../../../assets/fonts/Inter-Bold.ttf', import.meta.url) ).then(res => res.arrayBuffer()) interface ImageProps { params: { id: string } } export default async function Image({ params }: ImageProps) { const chat = await getSharedChat(params.id) if (!chat || !chat?.sharePath) { return null } const textAlign = chat?.title?.length > 40 ? 'items-start' : 'items-center' return new ImageResponse( (