Feature/sas mypages * feat: Add SAS partner page under my pages * fix: feature toggle SAS Partner page in my pages * add translations for SAS account page * use 'flex-start' instead of 'start' * fix: flatten css * fix: don't use <SectionContainer /> on linkedAccounts page
56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
import { Suspense } from "react"
|
|
|
|
import { serverClient } from "@/lib/trpc/server"
|
|
|
|
import Blocks from "@/components/Blocks"
|
|
import SectionHeader from "@/components/Section/Header"
|
|
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
|
import Title from "@/components/TempDesignSystem/Text/Title"
|
|
import TrackingSDK from "@/components/TrackingSDK"
|
|
import { getIntl } from "@/i18n"
|
|
import { setLang } from "@/i18n/serverContext"
|
|
|
|
import styles from "./page.module.css"
|
|
|
|
import type { LangParams, PageArgs } from "@/types/params"
|
|
|
|
export { generateMetadata } from "@/utils/generateMetadata"
|
|
|
|
export default async function MyPages({
|
|
params,
|
|
}: PageArgs<LangParams & { path: string[] }>) {
|
|
setLang(params.lang)
|
|
|
|
const accountPageRes = await serverClient().contentstack.accountPage.get()
|
|
const intl = await getIntl()
|
|
|
|
if (!accountPageRes) {
|
|
return null
|
|
}
|
|
|
|
const { tracking, accountPage } = accountPageRes
|
|
const { heading, preamble, content } = accountPage
|
|
|
|
return (
|
|
<>
|
|
<main className={styles.blocks}>
|
|
<SectionHeader
|
|
title={heading}
|
|
preamble={preamble}
|
|
headingAs="h1"
|
|
headingLevel="h1"
|
|
/>
|
|
|
|
{content?.length ? (
|
|
<Blocks blocks={content} />
|
|
) : (
|
|
<p>{intl.formatMessage({ id: "No content published" })}</p>
|
|
)}
|
|
</main>
|
|
<Suspense fallback={null}>
|
|
<TrackingSDK pageData={tracking} />
|
|
</Suspense>
|
|
</>
|
|
)
|
|
}
|