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

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

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

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