import React from 'react' import type { FDHeroBlock as FDHeroBlockProps, Media } from '@/payload-types' export const FDHeroBlockComponent: React.FC = ({ heading, subheading, body, ctaText, ctaLink = '#', secondaryCtaText, secondaryCtaLink = '#', backgroundImage, overlayOpacity = '50', textColor = 'auto', theme = 'light', }) => { const media = backgroundImage as Media | undefined const bgImageUrl = media?.url || '' const hasBgImage = Boolean(bgImageUrl) const isDark = hasBgImage || theme === 'dark' let headingColor: string let textBodyColor: string if (textColor === 'white') { headingColor = 'text-white' textBodyColor = 'text-white' } else if (textColor === 'navy') { headingColor = 'text-fd-navy' textBodyColor = 'text-fd-navy' } else { headingColor = isDark ? 'text-fd-yellow' : 'text-fd-navy' textBodyColor = isDark ? 'text-white' : 'text-fd-navy' } const overlayClass = overlayOpacity === '30' ? 'bg-black/30' : overlayOpacity === '70' ? 'bg-black/70' : 'bg-black/50' const secondaryBtnClass = isDark && textColor !== 'navy' ? 'fd-btn-secondary-dark' : 'fd-btn-secondary' return (
{hasBgImage && ( <>
) }