import { baseUrls } from "@/constants/routes/baseUrls"
import { serverClient } from "@/lib/trpc/server"

import Header from "@/components/Current/Header"
import LanguageSwitcher from "@/components/Current/Header/LanguageSwitcher"
import MyPagesMobileDropdown from "@/components/Current/Header/MyPagesMobileDropdown"
import { setLang } from "@/i18n/serverContext"

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

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

  const navigation = await serverClient().contentstack.myPages.navigation.get()
  return (
    <Header
      myPagesMobileDropdown={<MyPagesMobileDropdown navigation={navigation} />}
      languageSwitcher={<LanguageSwitcher urls={baseUrls} />}
    />
  )
}
