import { ImageResponse } from 'next/og';
import { getTranslations } from 'next-intl/server';
import { OGImageTemplate } from '@/components/OGImageTemplate';

export const runtime = 'edge';

export default async function Image({ params: { locale } }: { params: { locale: string } }) {
  const t = await getTranslations({ locale, namespace: 'Team' });
  const title = t('meta.title') || t('hero.subtitle');
  const description = t('meta.description') || t('hero.title');

  return new ImageResponse(
    (
      <OGImageTemplate
        title={title}
        description={description}
        label="Our Team"
        image="https://klz-cables.com/uploads/2024/12/DSC07655-Large.webp"
      />
    ),
    {
      width: 1200,
      height: 630,
    }
  );
}
