import { ImageResponse } from 'next/og' import { getSharedChat } from '@/app/actions' import { IconW3GPT } from '@/components/ui/icons' export const alt = 'Web3 GPT' export const size = { width: 1200, height: 630 } export const contentType = 'image/png' // const interRegular = fetch( // new URL('../../../assets/fonts/Inter-Regular.woff', import.meta.url) // ).then(res => res.arrayBuffer()) // const interBold = fetch( // new URL('../../../assets/fonts/Inter-Bold.woff', 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( (
{chat.title.length > 120 ? `${chat.title.slice(0, 120)}...` : chat.title}
...
{/*
Write and deploy smart contracts with
Web3 GPT
w3gpt.ai
*/}
), { ...size, // fonts: [ // { // name: 'Inter', // data: await interRegular, // style: 'normal', // weight: 400 // }, // { // name: 'Inter', // data: await interBold, // style: 'normal', // weight: 700 // } // ] } ) }