import { notFound, redirect } from "next/navigation" import { serverClient } from "@/lib/trpc/server" import { Blocks } from "@/components/Loyalty/Blocks" import Sidebar from "@/components/Loyalty/Sidebar" import MaxWidth from "@/components/MaxWidth" import styles from "./page.module.css" import type { LangParams, PageArgs, UriParams } from "@/types/params" export default async function AboutScandicFriends({ params, searchParams, }: PageArgs) { if (!searchParams.uri) { return notFound() } const loyaltyPage = await serverClient({ onError() { const returnUrl = new URLSearchParams({ returnurl: `${params.lang}/webview/${searchParams.uri}`, }) const refreshUrl = `/${params.lang}/webview/refresh?${returnUrl.toString()}` redirect(refreshUrl) }, }).contentstack.loyaltyPage.get({ href: searchParams.uri, locale: params.lang, }) return (
{loyaltyPage.sidebar ? : null}
) }