feat: improve structure and error handling

This commit is contained in:
Michael Zetterberg
2024-05-14 15:55:46 +02:00
parent 01587d7fd5
commit f5108d1a8e
104 changed files with 1505 additions and 1570 deletions

View File

@@ -13,25 +13,14 @@ import type { LangParams, PageArgs } from "@/types/params"
export default async function MyPages({
params,
}: PageArgs<LangParams & { path: string[] }>) {
const baseUrl = myPages[params.lang].replace(`/${params.lang}`, "")
const pathUrl = params.path.join("/")
const accountPage = await serverClient().contentstack.accountPage.get({
url: `${baseUrl}/${pathUrl}`,
lang: params.lang,
})
const breadcrumbs = await serverClient().contentstack.breadcrumbs.get({
href: `${baseUrl}/${pathUrl}`,
locale: params.lang,
})
const accountPage = await serverClient().contentstack.accountPage.get()
return (
<>
<Breadcrumbs breadcrumbs={breadcrumbs} />
<Breadcrumbs />
<div className={styles.content}>
<Sidebar lang={params.lang} />
<Sidebar />
<MaxWidth className={styles.blocks} tag="main">
{accountPage.content.length ? (
<Content lang={params.lang} content={accountPage.content} />