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

import Breadcrumbs from "@/components/MyPages/Breadcrumbs"

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

export default async function StaysBreadcrumbs({
  params,
}: PageArgs<LangParams>) {
  const href = stays[params.lang].replace(`/${params.lang}`, "")
  const breadcrumbs = await serverClient().contentstack.breadcrumbs.get({
    href,
    locale: params.lang,
  })
  return <Breadcrumbs breadcrumbs={breadcrumbs} />
}
