import { Metadata } from "next";
import { getTranslations } from "next-intl/server";
import SignUpForm from "./signup-form";

export async function generateMetadata(props: {
  params: Promise<{ locale: string }>;
}): Promise<Metadata> {
  const params = await props.params;
  const { locale } = params;
  const t = await getTranslations({ locale, namespace: "seo" });
  const siteUrl = process.env.NEXT_PUBLIC_APP_URL || "https://iddaai.com";

  const pathSegment = "signup";

  return {
    title: t("signup.title"),
    description: t("signup.description"),
    alternates: {
      canonical: `${siteUrl}/${locale}/${pathSegment}`,
      languages: {
        en: `${siteUrl}/en/${pathSegment}`,
        tr: `${siteUrl}/tr/${pathSegment}`,
      },
    },
  };
}

export default function SignUpPage() {
  return <SignUpForm />;
}
