import { getDictionary } from "@/get-dictionary";
import type { Locale } from "@/i18n-config";
import PartnersClient from "@/components/PartnersClient";
import { getPartners } from "@/app/actions";

export async function generateStaticParams() {
  return [{ lang: "tr" }, { lang: "en" }];
}

export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
  const { lang } = await params;
  const dict = await getDictionary(lang);
  return {
    title: `${dict.partners.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
    description: dict.partners.desc,
  };
}

export default async function PartnersPage({ params }: { params: Promise<{ lang: Locale }> }) {
  const { lang } = await params;
  const dict = await getDictionary(lang);
  const partners = await getPartners();

  return <PartnersClient lang={lang} dict={dict} initialPartners={partners} />;
}
