import { getDictionary, type Locale } from "@/lib/dictionaries";
import CTA from "@/components/sections/CTA";
import AboutContent from "./AboutContent";
import { localeAlternates } from "@/lib/seo";
import type { Metadata } from "next";

export async function generateMetadata({
  params,
}: {
  params: Promise<{ locale: string }>;
}): Promise<Metadata> {
  const { locale } = await params;
  const isSR = locale === "sr";
  return {
    title: isSR ? "O meni" : "About",
    description: isSR
      ? "Full-stack inženjer koji gradi, deployuje i hostuje na vlastitoj infrastrukturi."
      : "End-to-end engineer who builds, deploys, and hosts on self-managed infrastructure.",
    alternates: localeAlternates(locale, "/about"),
  };
}

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

  return (
    <>
      <AboutContent locale={locale as Locale} dict={dict} />
      <CTA locale={locale as Locale} dict={dict} />
    </>
  );
}
