import React from 'react' import type { FDPricingCardBlock as FDPricingCardBlockProps } from '@/payload-types' 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-[6px] border-[#d1d5db]', title: 'text-fd-navy', subtitle: 'text-fd-navy', body: 'text-fd-navy/80', bullet: 'text-fd-navy' }, navy: { bg: 'bg-fd-navy', border: '', title: 'text-fd-yellow', subtitle: 'text-white', body: 'text-white/80', bullet: 'text-white' }, gray: { bg: 'bg-[#e5e5e5]', border: '', title: 'text-fd-navy', subtitle: 'text-fd-navy', body: 'text-fd-navy/80', bullet: 'text-fd-navy' }, yellow: { bg: 'bg-fd-yellow', border: '', title: 'text-fd-navy', subtitle: 'text-fd-navy', body: 'text-fd-navy/80', bullet: 'text-fd-navy' }, white: { bg: 'bg-white shadow-lg', border: '', title: 'text-fd-navy', subtitle: 'text-fd-navy', body: 'text-fd-navy/80', bullet: 'text-fd-navy' }, } // Map to fd-btn classes; the 'a' tag just uses the class directly const buttonStyleMap: Record = { yellow: 'fd-btn-primary', navy: 'fd-btn-navy', outlinedNavy: 'fd-btn-secondary', outlinedWhite: 'fd-btn-secondary-dark', } 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 btnClass = buttonStyleMap[buttonColor || 'yellow'] || 'fd-btn-primary' const cardCount = cards?.length || 1 const gridCols = gridColsMap[cardCount] || gridColsMap[3] return (
{sectionTitle && (

{sectionTitle}

)}
{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 && ( )}
))}
) }