import { getDictionary, type Locale } from "@/lib/dictionaries";
import ServicesContent from "./ServicesContent";
import CTA from "@/components/sections/CTA";
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 ? "Usluge" : "Services",
    description: isSR
      ? "Full-stack web razvoj, self-hosted infrastruktura i deployment iz jednih ruku."
      : "Full-stack web development, self-hosted infrastructure, and deployment under one roof.",
    alternates: localeAlternates(locale, "/services"),
  };
}

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

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