import { Suspense } from "react"

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

import CurrentHeader from "@/components/Current/Header"
import HeaderFallback from "@/components/Current/Header/HeaderFallback"
import Header from "@/components/Header"
import { setLang } from "@/i18n/serverContext"

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

export default function HeaderPage({ params }: PageArgs<LangParams>) {
  setLang(params.lang)

  if (env.HIDE_FOR_NEXT_RELEASE) {
    return (
      <Suspense fallback={<HeaderFallback />}>
        <CurrentHeader />
      </Suspense>
    )
  }

  return <Header />
}
