Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Failing after 1m13s
Build & Deploy / 🏗️ Build (push) Failing after 5m53s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Smoke Test (push) Has been skipped
Build & Deploy / ⚡ Lighthouse (push) Has been skipped
Build & Deploy / ♿ WCAG (push) Has been skipped
Build & Deploy / 🛡️ Quality Gates (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 4s
27 lines
784 B
TypeScript
27 lines
784 B
TypeScript
import { ImageResponse } from 'next/og';
|
|
import { getTranslations } from 'next-intl/server';
|
|
import { OGImageTemplate } from '@/components/OGImageTemplate';
|
|
import { getOgFonts, OG_IMAGE_SIZE } from '@/lib/og-helper';
|
|
|
|
export const size = OG_IMAGE_SIZE;
|
|
export const contentType = 'image/png';
|
|
export const runtime = 'nodejs';
|
|
|
|
export default async function Image({ params }: { params: Promise<{ locale: string }> }) {
|
|
const { locale } = await params;
|
|
const t = await getTranslations({ locale, namespace: 'Index.meta' });
|
|
const fonts = await getOgFonts();
|
|
|
|
return new ImageResponse(
|
|
<OGImageTemplate
|
|
title={t('title')}
|
|
description={t('description')}
|
|
label="Reliable Energy Infrastructure"
|
|
/>,
|
|
{
|
|
...OG_IMAGE_SIZE,
|
|
fonts,
|
|
},
|
|
);
|
|
}
|