/**
 * Interview Scheduling Page
 * Public page for applicants to schedule interviews via token-based links
 */

import { Metadata } from "next";
import { LANGS, type Lang } from "@/lib/config";
import InterviewScheduleClient from "./InterviewScheduleClient";

// Generate static params for all supported languages
export async function generateStaticParams() {
  return LANGS.map((lang) => ({ lang }));
}

// Dynamic metadata per language
export async function generateMetadata({
  params,
}: {
  params: { lang: Lang };
}): Promise<Metadata> {
  const { lang } = params;

  return {
    title:
      lang === "ar"
        ? "جدولة مقابلة العمل | ماويدي"
        : "Schedule Interview | Mawidi",
    description:
      lang === "ar"
        ? "حدد الوقت المناسب لك لإجراء مقابلة العمل مع فريق ماويدي"
        : "Choose your preferred time for the interview with the Mawidi team",
    robots: {
      index: false,
      follow: false,
    },
    openGraph: {
      title:
        lang === "ar"
          ? "جدولة مقابلة العمل | ماويدي"
          : "Schedule Interview | Mawidi",
      description:
        lang === "ar"
          ? "حدد الوقت المناسب لك لإجراء مقابلة العمل"
          : "Choose your preferred time for the interview",
      type: "website",
      locale: lang === "ar" ? "ar_SA" : "en_US",
    },
  };
}

// Force dynamic rendering - this is a token-based page
export const dynamic = "force-dynamic";

export default function InterviewSchedulePage({
  params,
}: {
  params: { lang: Lang };
}) {
  return <InterviewScheduleClient lang={params.lang} />;
}
