import Image from 'next/image' import { Button } from '@/components/ui' import { cn } from '@/lib/utils' import { getMediaUrl, getMediaAlt } from '@/lib/payload-helpers' import type { BlockByType } from '@c2s/payload-contracts/types' type HeroBlockProps = Omit, 'blockType' | 'blockName'> export function HeroBlock({ headline, subline, backgroundImage, cta, alignment = 'center', overlay = true, }: HeroBlockProps) { const bgUrl = getMediaUrl(backgroundImage) const alignmentClasses = { left: 'text-left items-start', center: 'text-center items-center', right: 'text-right items-end', } return (
{/* Background Image */} {bgUrl && (
{getMediaAlt(backgroundImage)} {overlay && (
)}
)} {/* Content */}

{headline}

{subline && (

{subline}

)} {cta?.text && cta?.link && ( )}
) }