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

import MobileMenu from "../MobileMenu"

export default async function MobileMenuServer() {
  const [languages, headerData] = await Promise.all([
    serverClient().contentstack.languageSwitcher.get(),
    serverClient().contentstack.base.header(),
  ])

  if (!languages || !headerData) {
    return null
  }

  return (
    <MobileMenu languageUrls={languages.urls} topLink={headerData?.topLink} />
  )
}
