/**
 * Mawidi Demo Booking Page
 * Interactive demo scheduler with bilingual support
 */

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

// 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" ? "احجز جلسة تجريبية | مويدي" : "Book a Demo | Mawidi",
    description:
      lang === "ar"
        ? "احجز جلسة تجريبية مع فريق مويدي لاستكشاف منصتنا لإدارة المواعيد عبر واتساب. اختر الوقت المناسب لك."
        : "Schedule a demo session with the Mawidi team to explore our WhatsApp appointment management platform. Choose a time that works for you.",
    openGraph: {
      title:
        lang === "ar" ? "احجز جلسة تجريبية | مويدي" : "Book a Demo | Mawidi",
      description:
        lang === "ar"
          ? "احجز جلسة تجريبية مع فريق مويدي"
          : "Schedule a demo session with the Mawidi team",
      type: "website",
      locale: lang === "ar" ? "ar_SA" : "en_US",
    },
  };
}

// Disable static generation for demo page - it's fully interactive and uses client-side features
// This prevents hydration errors from SSR/client mismatches
export const dynamic = "force-dynamic";

export default function DemoPage({ params }: { params: { lang: Lang } }) {
  return <DemoPageClient lang={params.lang} />;
}
