import React from 'react' import { cn } from '@/core/lib/utils' import { buildSectionClasses } from '@/core/types/blocks' import type { TextContentBlockProps } from './schema' /** * Text Content Block Component * * Props from 3-tab structure: * - Content: title, content (rich-text), cta * - Design: backgroundColor, maxWidth, alignment * - Advanced: className, id * * Note: `content` is the main rich-text body of this block */ export function TextContentBlock({ // Base content props title, content, cta, // Base design props backgroundColor, // Text-content-specific design maxWidth = 'lg', alignment = 'left', // Base advanced props className, id, }: TextContentBlockProps) { const maxWidthClasses: Record = { sm: 'max-w-2xl', md: 'max-w-3xl', lg: 'max-w-4xl', xl: 'max-w-5xl', full: 'max-w-none', } const alignmentClasses: Record = { left: 'text-left', center: 'text-center mx-auto', right: 'text-right ml-auto', } // Build section classes with background and custom className const sectionClasses = buildSectionClasses( 'py-16 px-4 @md:py-24', { backgroundColor, className } ) return (
{/* Optional Section Title */} {title && (

{title}

)} {/* Rich Text Content */}
{/* Optional CTA */} {cta && ( )}
) }