import { serverClient } from "@/lib/trpc/server"

import Desktop from "@/components/Current/Header/LanguageSwitcher/Desktop"
import Mobile from "@/components/Current/Header/LanguageSwitcher/Mobile"

import styles from "./page.module.css"

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

export default async function LanguageSwitcher({
  params,
}: PageArgs<LangParams & UriParams>) {
  const { urls } = await serverClient().contentstack.config.languageSwitcher()

  return (
    <>
      <section className={styles.desktop}>
        <Desktop currentLanguage={params.lang} urlObject={urls} />
      </section>
      <section className={styles.mobile}>
        <Mobile currentLanguage={params.lang} urlObject={urls} />
      </section>
    </>
  )
}
