import React from 'react' import type { FDPricingCardBlock as FDPricingCardBlockProps } from '@/payload-types' import { FDButton } from '@/components/FDButton' const sectionBgMap: Record = { white: 'bg-white', navy: 'bg-fd-navy', gray: 'bg-fd-gray-light', yellow: 'bg-fd-yellow', } const titleColorMap: Record = { navy: 'text-fd-navy', white: 'text-white', yellow: 'text-fd-yellow', } const cardStyleMap: Record = { outlined: { bg: 'bg-white', border: 'border-[2px] border-[#d1d5db]', title: 'text-fd-navy', subtitle: 'text-fd-navy', body: 'text-fd-navy/80', bullet: 'text-fd-navy', isDark: false }, navy: { bg: 'bg-fd-navy', border: '', title: 'text-fd-yellow', subtitle: 'text-white', body: 'text-white/80', bullet: 'text-white', isDark: true }, gray: { bg: 'bg-fd-gray-light', border: '', title: 'text-fd-navy', subtitle: 'text-fd-navy', body: 'text-fd-navy/80', bullet: 'text-fd-navy', isDark: false }, yellow: { bg: 'bg-fd-yellow', border: '', title: 'text-fd-navy', subtitle: 'text-fd-navy', body: 'text-fd-navy/80', bullet: 'text-fd-navy', isDark: false }, white: { bg: 'bg-white shadow-lg', border: '', title: 'text-fd-navy', subtitle: 'text-fd-navy', body: 'text-fd-navy/80', bullet: 'text-fd-navy', isDark: false }, } const buttonVariantMap: Record = { yellow: { variant: 'primary' }, navy: { variant: 'primary' }, outlinedNavy: { variant: 'outline' }, outlinedWhite: { variant: 'outline' }, } const gridColsMap: Record = { 1: 'lg:grid-cols-1 max-w-[500px] mx-auto', 2: 'lg:grid-cols-2', 3: 'lg:grid-cols-3', } export const FDPricingCardBlockComponent: React.FC = ({ sectionTitle, cards, cardStyle = 'outlined', buttonColor = 'yellow', sectionBackground = 'white', titleColor = 'navy', }) => { const sectionBg = sectionBgMap[sectionBackground || 'white'] const sectionTitleColor = titleColorMap[titleColor || 'navy'] const style = cardStyleMap[cardStyle || 'outlined'] const { variant } = buttonVariantMap[buttonColor || 'yellow'] const cardCount = cards?.length || 1 const gridCols = gridColsMap[cardCount] || gridColsMap[3] const outlineOnDark = style.isDark return (
{sectionTitle && (

{sectionTitle}

)} {/* FIX: rounded-[32px] → rounded-[70px] per design system */}
{cards?.map((card, index) => (

{card.title}

{card.subtitle && (

{card.subtitle}

)} {card.description && (

{card.description}

)} {card.bulletPoints && card.bulletPoints.length > 0 && (
    {card.bulletPoints.map((point, i) => (
  • {point.text}
  • ))}
)} {card.ctaText && (
{card.ctaText}
)}
))}
) }