import { ImageResponse } from 'next/og'; import { getProductBySlug } from '@/lib/mdx'; export const runtime = 'edge'; export default async function Image({ params: { locale, slug } }: { params: { locale: string, slug: string[] } }) { const productSlug = slug[slug.length - 1]; const product = await getProductBySlug(productSlug, locale); if (!product) { return new ImageResponse(
); } return new ImageResponse( (
{/* Left Side: Content */}
KLZ Cables | {product.frontmatter.categories[0]}
{product.frontmatter.title}
{product.frontmatter.description}
{/* Accent Line */}
{/* Right Side: Product Image */}
{product.frontmatter.images?.[0] && ( )} {/* Subtle shadow under product */}
{/* Branding Corner */}
KLZ
Cables
), { width: 1200, height: 630, } ); }