import { notFound } from "next/navigation"
import { Suspense } from "react"

import { env } from "@/env/server"

import CampaignPage from "@/components/ContentType/CampaignPage"
import CampaignPageSkeleton from "@/components/ContentType/CampaignPage/CampaignPageSkeleton"

export { generateMetadata } from "@/utils/generateMetadata"

export default async function CampaignPagePage() {
  if (!env.CAMPAIGN_PAGES_ENABLED) {
    return notFound()
  }

  return (
    <Suspense fallback={<CampaignPageSkeleton />}>
      <CampaignPage />
    </Suspense>
  )
}
