Files
web/apps/scandic-web/components/Webviews/AccountPage/index.tsx
2025-03-18 10:56:21 +01:00

37 lines
1.0 KiB
TypeScript

import { overview } from "@/constants/routes/webviews"
import { serverClient } from "@/lib/trpc/server"
import MaxWidth from "@/components/MaxWidth"
import Surprises from "@/components/MyPages/Surprises"
import TrackingSDK from "@/components/TrackingSDK"
import Blocks from "@/components/Webviews/AccountPage/Blocks"
import LinkToOverview from "@/components/Webviews/LinkToOverview"
import { getLang } from "@/i18n/serverContext"
import styles from "./accountPage.module.css"
export default async function AccountPage() {
const accountPageRes = await serverClient().contentstack.accountPage.get()
if (!accountPageRes) {
return null
}
const { tracking, accountPage } = accountPageRes
const linkToOverview =
`/${getLang()}/webview${accountPage.url}` !== overview[getLang()]
return (
<>
<MaxWidth className={styles.blocks} tag="main">
{linkToOverview ? <LinkToOverview /> : null}
<Blocks content={accountPage.content} />
</MaxWidth>
<Surprises />
<TrackingSDK pageData={tracking} />
</>
)
}