import { ImageResponse } from 'next/og';

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 fonts = await getOgFonts();

  return new ImageResponse(
    <OGImageTemplate
      title="E-TIB GmbH | Spezialist für Kabelnetzbau"
      description="Ihr Partner für Kabelnetzbau, Horizontalspülbohrungen und Glasfaser-Montage in Guben und bundesweit."
      label="Reliable Energy Infrastructure"
    />,
    {
      ...OG_IMAGE_SIZE,
      fonts,
    },
  );
}
