import { ImageResponse } from 'next/og'; import { isLocale } from '@/i18n'; import { getSegmentData } from '@/data/segments'; export const runtime = 'edge'; export const size = { width: 1200, height: 630 }; export const contentType = 'image/png'; export default function Image({ params }: { params: { lang: string; segment: string } }) { const lang = isLocale(params.lang) ? params.lang : 'fr'; const data = getSegmentData(params.segment); const badge = data?.translations[lang].hero.badge ?? 'MyInfoMate'; const title = data?.meta[lang].title ?? 'MyInfoMate'; const description = data?.meta[lang].description ?? ''; return new ImageResponse( (