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

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

import DestinationCountryPage from "@/components/ContentType/DestinationPage/DestinationCountryPage"
import DestinationCountryPageSkeleton from "@/components/ContentType/DestinationPage/DestinationCountryPage/DestinationCountryPageSkeleton"

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

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

export default function DestinationCountryPagePage({}: PageArgs<
  LangParams,
  { view?: "map" }
>) {
  if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
    return notFound()
  }

  return (
    <Suspense fallback={<DestinationCountryPageSkeleton />}>
      <DestinationCountryPage
        // isMapView={searchParams.view === "map"} // Disabled until further notice
        isMapView={false}
      />
    </Suspense>
  )
}
