Files
web/components/ContentType/LoyaltyPage.tsx
2024-05-30 16:07:42 +02:00

36 lines
1.0 KiB
TypeScript

import { serverClient } from "@/lib/trpc/server"
import { auth } from "@/auth"
import { Blocks } from "@/components/Loyalty/Blocks"
import SidebarLoyalty from "@/components/Loyalty/Sidebar"
import MaxWidth from "@/components/MaxWidth"
import Sidebar from "@/components/MyPages/Sidebar"
import Breadcrumbs from "../MyPages/Breadcrumbs"
import styles from "./loyaltyPage.module.css"
import { LangParams } from "@/types/params"
export default async function LoyaltyPage({ lang }: LangParams) {
const loyaltyPage = await serverClient().contentstack.loyaltyPage.get()
const session = await auth()
return (
<>
<Breadcrumbs />
<section className={styles.content}>
{session ? (
<Sidebar lang={lang} />
) : loyaltyPage.sidebar.length ? (
<SidebarLoyalty blocks={loyaltyPage.sidebar} />
) : null}
<MaxWidth className={styles.blocks} tag="main">
{loyaltyPage.blocks ? <Blocks blocks={loyaltyPage.blocks} /> : null}
</MaxWidth>
</section>
</>
)
}