import { notFound } from "next/navigation"

import ContentPage from "@/components/ContentType/ContentPage"
import LoyaltyPage from "@/components/ContentType/LoyaltyPage"

import {
  ContentTypeParams,
  LangParams,
  PageArgs,
  UIDParams,
} from "@/types/params"

export default async function ContentTypePage({
  params,
}: PageArgs<LangParams & ContentTypeParams & UIDParams, {}>) {
  switch (params.contentType) {
    case "loyalty-page":
      return <LoyaltyPage />
    case "content-page":
      return <ContentPage />
    default:
      const type: never = params.contentType
      console.error(`Unsupported content type given: ${type}`)
      notFound()
  }
}
