import React from 'react'
import { notFound } from 'next/navigation'
import FooterContentPage from '@/components/FooterContentPage'
import { footerPageSlugs, isFooterPageSlug } from '@/lib/footerContent'

export function generateStaticParams() {
  return footerPageSlugs.map((slug) => ({ slug }))
}

export default function FooterPage({
  params,
}: {
  params: { slug: string }
}) {
  const { slug } = params

  if (!isFooterPageSlug(slug)) {
    notFound()
  }

  return <FooterContentPage slug={slug} />
}
