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

import CurrentFooter from "@/components/Current/Footer"
import Footer, { preload } from "@/components/Footer"
import { setLang } from "@/i18n/serverContext"

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

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

  if (env.HIDE_FOR_NEXT_RELEASE) {
    return <CurrentFooter />
  }

  preload()

  return <Footer />
}
