import React from 'react'; import { cn } from '@/lib/utils'; import { ArrowRight } from 'lucide-react'; interface Section { id: string; type: string; layoutVariant?: string; colorScheme?: string; props: Record; elementStyles?: Record; } interface CTABannerRendererProps { section: Section; className?: string; } const COLOR_SCHEMES: Record = { default: { bg: '', text: 'text-gray-900', btnBg: 'bg-blue-600', btnText: 'text-white' }, primary: { bg: 'bg-blue-600', text: 'text-white', btnBg: 'bg-white', btnText: 'text-blue-600' }, secondary: { bg: 'bg-gray-800', text: 'text-white', btnBg: 'bg-white', btnText: 'text-gray-800' }, muted: { bg: 'bg-gray-50', text: 'text-gray-700', btnBg: 'bg-gray-800', btnText: 'text-white' }, gradient: { bg: 'bg-gradient-to-r from-purple-600 to-blue-500', text: 'text-white', btnBg: 'bg-white', btnText: 'text-purple-600' }, }; export function CTABannerRenderer({ section, className }: CTABannerRendererProps) { const scheme = COLOR_SCHEMES[section.colorScheme || 'primary']; const title = section.props?.title?.value || 'Ready to get started?'; const text = section.props?.text?.value || 'Join thousands of happy customers today.'; const buttonText = section.props?.button_text?.value || 'Get Started'; const buttonUrl = section.props?.button_url?.value || '#'; // Helper to get text styles (including font family) const getTextStyles = (elementName: string) => { const styles = section.elementStyles?.[elementName] || {}; return { classNames: cn( styles.fontSize, styles.fontWeight, { 'font-sans': styles.fontFamily === 'secondary', 'font-serif': styles.fontFamily === 'primary', } ), style: { color: styles.color, textAlign: styles.textAlign, backgroundColor: styles.backgroundColor } }; }; const titleStyle = getTextStyles('title'); const textStyle = getTextStyles('text'); const btnStyle = getTextStyles('button_text'); return (

{title}

{text}

); }