import { Suspense } from "react"

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

import SitewideAlert, { preload } from "@/components/SitewideAlert"
import { setLang } from "@/i18n/serverContext"

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

export default function SitewideAlertPage({ params }: PageArgs<LangParams>) {
  if (env.HIDE_FOR_NEXT_RELEASE) {
    return null
  }

  setLang(params.lang)
  preload()

  return (
    <Suspense>
      <SitewideAlert />
    </Suspense>
  )
}
