import React from 'react' import type { FDWideCardBlock as FDWideCardBlockProps, Media } from '@/payload-types' import { FDButton } from '@/components/FDButton' import { FDImage } from '@/components/FDImage' const cardBgMap: Record = { navy: { bg: 'bg-fd-navy', heading: 'text-white', body: 'text-white/80', isDark: true }, yellow: { bg: 'bg-fd-yellow', heading: 'text-fd-navy', body: 'text-fd-navy/80', isDark: false }, gray: { bg: 'bg-fd-gray-light dark:bg-white/10', heading: 'text-fd-navy dark:text-white', body: 'text-fd-navy/80 dark:text-white/80', isDark: false }, white: { bg: 'bg-white dark:bg-white/10 shadow-fd-card dark:shadow-none', heading: 'text-fd-navy dark:text-white', body: 'text-fd-navy/80 dark:text-white/80', isDark: false }, } const sectionBgMap: Record = { white: 'bg-white dark:bg-fd-navy', gray: 'bg-fd-gray-light dark:bg-fd-navy', navy: 'bg-fd-navy', } const btnVariantMap: Record = { yellow: { variant: 'primary' }, navy: { variant: 'outline' }, white: { variant: 'primary' }, } const cardRadius = 'rounded-[32px] md:rounded-[50px] lg:rounded-[70px]' export const FDWideCardBlockComponent: React.FC = ({ heading, body, ctaText, ctaLink, image, cardBackground = 'navy', buttonColor = 'yellow', sectionBackground = 'white', anchorId, }) => { const card = cardBgMap[cardBackground || 'navy'] const sectionBg = sectionBgMap[sectionBackground || 'white'] const { variant } = btnVariantMap[buttonColor || 'yellow'] const media = image as Media | undefined const hasImage = media && typeof media === 'object' && media.url return (

{heading}

{body && (

{body}

)} {ctaText && (
{ctaText}
)}
{hasImage && (
)}
) }