35 lines
950 B
TypeScript
35 lines
950 B
TypeScript
import { notFound } from "next/navigation"
|
|
|
|
import { serverClient } from "@/lib/trpc/server"
|
|
|
|
import { Blocks } from "@/components/Loyalty/Blocks/WebView"
|
|
import Sidebar from "@/components/Loyalty/Sidebar"
|
|
import MaxWidth from "@/components/MaxWidth"
|
|
|
|
import styles from "./page.module.css"
|
|
|
|
import { LangParams, PageArgs, UriParams } from "@/types/params"
|
|
|
|
export default async function AboutScandicFriends({
|
|
params,
|
|
searchParams,
|
|
}: PageArgs<LangParams, UriParams>) {
|
|
if (!searchParams.uri) {
|
|
return notFound()
|
|
}
|
|
|
|
const loyaltyPage = await serverClient().contentstack.loyaltyPage.get({
|
|
href: searchParams.uri,
|
|
locale: params.lang,
|
|
})
|
|
return (
|
|
<section className={styles.content}>
|
|
{loyaltyPage.sidebar ? <Sidebar blocks={loyaltyPage.sidebar} /> : null}
|
|
|
|
<MaxWidth className={styles.blocks} tag="main">
|
|
<Blocks blocks={loyaltyPage.blocks} lang={params.lang} />
|
|
</MaxWidth>
|
|
</section>
|
|
)
|
|
}
|