import { notFound } from "next/navigation";
import TestParallax from "../../components/ParallaxComponent";
import { SUPPORTED_LOCALES, isSupportedLocale, type SupportedLocale } from "../../lib/locale";

export function generateStaticParams() {
  return SUPPORTED_LOCALES.map((locale) => ({ locale }));
}

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

  if (!isSupportedLocale(locale)) {
    notFound();
  }

  return (
    <main>
      <TestParallax initialLocale={locale as SupportedLocale} />
    </main>
  );
}
