fix: read CTA from cta group field instead of flat ctaLabel/ctaLink

The CMS hero-block sends CTA data as a nested group (cta.text, cta.link)
but the component was reading flat fields (ctaLabel, ctaLink). Falls back
to the old field names for backwards compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
CCS Admin 2026-02-25 16:13:43 +00:00
parent 8d5e687a87
commit 802f58ad17

View file

@ -13,8 +13,9 @@ export function HeroBlock({ block }: HeroBlockProps) {
const subheadline = (block.subline as string) || (block.subheadline as string) || (block.subtitle as string) || ''
const backgroundMedia = block.backgroundImage as Record<string, unknown> | undefined
const backgroundUrl = backgroundMedia?.url as string | undefined
const ctaLabel = (block.ctaLabel as string) || (block.buttonText as string) || ''
const ctaLink = (block.ctaLink as string) || (block.buttonLink as string) || ''
const cta = block.cta as Record<string, unknown> | undefined
const ctaLabel = (cta?.text as string) || (block.ctaLabel as string) || ''
const ctaLink = (cta?.link as string) || (block.ctaLink as string) || ''
const overlayStyle = (block.overlayStyle as string) || 'dark'
const alignment = (block.alignment as string) || 'center'
const fullHeight = block.fullHeight !== false