import { NanoBananaWorkbench } from "@/features/nano-banana";
import { Locale, locales, resolveLocale } from "@/config/i18n";
import { loadDictionary } from "@allai/i18n/server";
import { notFound } from "next/navigation";

type PageProps = {
  params: { locale: string };
};

export default async function LocaleHomePage({ params }: PageProps) {
  const locale = resolveLocale(params.locale);

  if (!locales.includes(locale)) {
    notFound();
  }

  const dictionary = await loadDictionary(locale);

  return <NanoBananaWorkbench locale={locale as Locale} dictionary={dictionary} />;
}
