import React from 'react' import type { FDHeaderTextImageBlock as FDHeaderTextImageBlockProps, Media } from '@/payload-types' import { FDImage } from '@/components/FDImage' const bgMap: Record = { white: 'bg-white dark:bg-fd-navy', gray: 'bg-fd-gray-light dark:bg-fd-navy', navy: 'bg-fd-navy', } // Heading: navy→yellow in dark, white stays white const headingMap: Record = { navy: 'text-fd-navy dark:text-fd-yellow', white: 'text-white', } // Body: navy→white in dark, white stays white const bodyMap: Record = { navy: 'text-fd-navy dark:text-white', white: 'text-white', } const overlayMap: Record = { none: '', navyLight: 'bg-fd-navy/20', navyMedium: 'bg-fd-navy/40', yellowLight: 'bg-fd-yellow/20', yellowMedium:'bg-fd-yellow/40', sepia: 'bg-[#8B7D3C]/30', blackLight: 'bg-black/20', blackMedium: 'bg-black/40', } /* Updated: responsive radius matching the standard system */ const roundedMap: Record = { none: '', medium: 'rounded-[20px] md:rounded-[32px] lg:rounded-[40px]', large: 'rounded-[32px] md:rounded-[50px] lg:rounded-[70px]', } export const FDHeaderTextImageBlockComponent: React.FC = ({ heading, body, image, imageOverlay = 'none', imageRounded = 'large', textAlign = 'center', sectionBackground = 'white', textColor = 'navy', }) => { const bg = bgMap[sectionBackground || 'white'] const headClr = headingMap[textColor || 'navy'] const bodyClr = bodyMap[textColor || 'navy'] const overlay = overlayMap[imageOverlay || 'none'] const rounded = roundedMap[imageRounded || 'large'] const align = textAlign === 'center' ? 'text-center' : 'text-left' const media = image as Media return (
{(heading || body) && (
{heading && (

{heading}

)} {body && (

{body}

)}
)} {media?.url && (
{overlay &&
}
)}
) }