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

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

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

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