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

import Profile from "@/components/MyPages/Profile"
import TrackingSDK from "@/components/TrackingSDK"

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

export { generateMetadata } from "@/utils/generateMetadata"

export default async function ProfilePage({}: PageArgs<LangParams>) {
  const caller = await serverClient()
  const accountPage = await caller.contentstack.accountPage.get()

  return (
    <>
      <Profile />
      {accountPage && <TrackingSDK pageData={accountPage.tracking} />}
    </>
  )
}
