import { getDictionary, Locale } from "../dictionaries";
import HomeClient from "./HomeClient";

export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
  const { lang } = await params;
  const dict = await getDictionary(lang);
  return {
    title: dict.seo.home.title,
    description: dict.seo.home.description,
    alternates: {
      canonical: `/${lang}`,
    },
  };
}

export default async function Page({
  params,
}: {
  params: Promise<{ lang: Locale }>;
}) {
  const { lang } = await params;
  const dict = await getDictionary(lang);
  return <HomeClient lang={lang} dict={dict.home} />;
}
