import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { ResumePageContent } from "@/components/resume-page-content";
import { isLanguage, languages, type Language } from "@/data/portfolio";
import { getResumeMetadata } from "@/data/seo";

export function generateStaticParams() {
  return languages.map((lang) => ({ lang }));
}

export function generateMetadata({ params }: { params: { lang: string } }): Metadata {
  if (!isLanguage(params.lang)) {
    return {};
  }

  return getResumeMetadata(params.lang as Language);
}

export default function LocalizedResumePage({ params }: { params: { lang: string } }) {
  if (!isLanguage(params.lang)) {
    notFound();
  }

  return <ResumePageContent language={params.lang as Language} />;
}
