import type { Metadata } from "next";
import { getTranslations, setRequestLocale } from "next-intl/server";
import { Locale } from "@/i18n/config";
import { createPageMetadata } from "@/lib/seo";
import AboutHeroSection from "@/components/AboutHeroSection";
import ParentCompanySection from "@/components/ParentCompanySection";
import TeamSection from "@/components/TeamSection";
import MilestonesSection from "@/components/MilestonesSection";
import RecruitSection from "@/components/RecruitSection";

export async function generateMetadata({
  params,
}: {
  params: Promise<{ locale: string }>;
}): Promise<Metadata> {
  const { locale } = await params;
  const t = await getTranslations({ locale, namespace: "metadata" });

  return createPageMetadata({
    locale: locale as Locale,
    pathname: "/about",
    title: t("aboutTitle"),
    description: t("aboutDescription"),
    siteName: t("title"),
  });
}

export default async function AboutPage({
  params,
}: {
  params: Promise<{ locale: string }>;
}) {
  const { locale } = await params;
  setRequestLocale(locale);

  return (
    <main>
      <AboutHeroSection />
      <ParentCompanySection />
      <TeamSection />
      <MilestonesSection />
      <RecruitSection />
    </main>
  );
}
