/* eslint-disable @next/next/no-img-element */ import { ImageResponse } from "next/og"; import { TITLE } from "../../../../lib/metadata/shared-metadata"; import { BasicLayout } from "../_components/basic-layout"; import { DEFAULT_URL, SIZE, calSemiBold, commitMonoBold, commitMonoRegular, interLight, interRegular, } from "../utils"; export const runtime = "edge"; export async function GET(req: Request) { const [ interRegularData, interLightData, calSemiBoldData, commitMonoRegularData, commitMonoBoldData, ] = await Promise.all([ interRegular, interLight, calSemiBold, commitMonoRegular, commitMonoBold, ]); const { searchParams } = new URL(req.url); const title = (searchParams.has("title") && searchParams.get("title")) || TITLE; const description = searchParams.has("description") ? searchParams.get("description") : undefined; const image = searchParams.has("image") ? searchParams.get("image") : undefined; return new ImageResponse( {image ? ( ) : null} , { ...SIZE, fonts: [ { name: "Inter", data: interRegularData, style: "normal", weight: 400, }, { name: "Inter", data: interLightData, style: "normal", weight: 300, }, { name: "Cal", data: calSemiBoldData, style: "normal", weight: 600, }, { name: "Commit Mono", data: commitMonoRegularData, style: "normal", weight: 400, }, { name: "Commit Mono", data: commitMonoBoldData, style: "normal", weight: 700, }, ], }, ); }