fix: padding

This commit is contained in:
Benno Tielen 2026-03-09 12:10:37 +01:00
parent 3a5b982bf7
commit dd5ceda986

View file

@ -3,6 +3,7 @@ import { fetchPageBySlug } from '@/fetch/pages'
import { Blocks } from '@/compositions/Blocks/Blocks'
import { Metadata } from 'next'
import { AdminMenu } from '@/components/AdminMenu/AdminMenu'
import { Section } from '@/components/Section/Section'
import { isAuthenticated } from '@/utils/auth'
type Props = {
@ -30,8 +31,14 @@ export default async function DynamicPage({ params }: Props) {
notFound()
}
const firstBlockType = page.content?.[0]?.blockType
const needsTopPadding =
firstBlockType === 'title' || firstBlockType === 'text'
return (
<>
{needsTopPadding && <Section padding={'medium'} />}
{page.content && page.content.length > 0 && (
<Blocks content={page.content} />
)}