import React from 'react'; import { SectionConfig, ToolItem, AppItem, CategoryItem, VariantSpec } from '@/types'; import { resolveBindings, isSectionVisible } from '@/lib/config/bindings'; import { HeroSection } from './HeroSection'; import { ToolGridSection } from './ToolGridSection'; import { TryItWidget } from './TryItWidget'; import { BeforeAfterSection } from './BeforeAfterSection'; import { AppCardsSection } from './AppCardsSection'; import { AppHandoffSection } from './AppHandoffSection'; import { AvailabilitySection } from './AvailabilitySection'; import { AppPickerSection } from './AppPickerSection'; import { StepsSection } from './StepsSection'; import { FeatureListSection } from './FeatureListSection'; import { FaqSection } from './FaqSection'; import { StatsSection } from './StatsSection'; import { PricingExplainerSection } from './PricingExplainerSection'; import { RelatedToolsSection } from './RelatedToolsSection'; import { RichTextSection } from './RichTextSection'; import { CtaBannerSection } from './CtaBannerSection'; import { NoticeSection } from './NoticeSection'; import { TransformationReelSection } from './TransformationReelSection'; import { MediaShowcaseSection } from './MediaShowcaseSection'; import { VisualUseCasesSection } from './VisualUseCasesSection'; import { WorkflowVisualizerSection } from './WorkflowVisualizerSection'; import { VerticalToolStackSection } from './VerticalToolStackSection'; import { MajorToolBannersSection } from './MajorToolBannersSection'; import { CinematicHorizontalScrollSection } from './CinematicHorizontalScrollSection'; import { ShiftableToolsGridSection } from './ShiftableToolsGridSection'; import { TrendyBentoSection } from './TrendyBentoSection'; import { RecommendedAppsSection } from './RecommendedAppsSection'; import { HowItWorks3DSection } from './HowItWorks3DSection'; import { ReviewsMarqueeSection } from './ReviewsMarqueeSection'; import { SectionEntrance } from '@/components/ui/SectionEntrance'; interface SectionRendererProps { section: SectionConfig; context: { site?: any; page?: any; tool?: ToolItem | null; app?: AppItem | null; homeApp?: AppItem | null; tools?: ToolItem[]; apps?: AppItem[]; categories?: CategoryItem[]; variants?: VariantSpec[]; relatedTools?: ToolItem[]; locale?: string; device?: 'mobile' | 'desktop'; }; } export function SectionRenderer(props: SectionRendererProps) { // Sticky scroll-linked sections must not have parent transforms or content-visibility containment if (props.section.type === 'majorToolBanners' || props.section.type === 'cinematicHorizontal') { return ; } return ( ); } function SectionContent({ section, context }: SectionRendererProps) { const locale = context.locale || 'en'; // Visibility Check (PRD §5.2, §5.3 CFG-09) if (!isSectionVisible(section, { device: context.device, locale })) { return null; } // Resolve bindings on section props (PRD §5.2) const resolvedProps = resolveBindings(section.props || {}, context, locale); switch (section.type) { case 'hero': { return ( ); } case 'shiftableToolsGrid': case 'toolsGridShiftable': case 'ourTools': return ( ); case 'trendyBento': case 'bentoGrid': return ; case 'recommendedApps': return ( ); case 'howItWorks': case 'howSection': return ; case 'reviewsMarquee': case 'reviews': return ; case 'transformationReel': case 'mediaShowcase': case 'mediaReel': return ; case 'majorToolBanners': case 'cinematicHorizontal': return ; case 'visualUseCases': return ; case 'workflowVisualizer': return ; case 'verticalToolStack': return ( ); case 'toolGrid': return ( ); case 'tryItWidget': if (!context.tool) return null; return (
); case 'beforeAfter': return ; case 'appCards': return ( ); case 'appHandoff': if (!context.app && !context.homeApp) return null; return ( ); case 'availability': if (!context.tool) return null; return ( ); case 'appPicker': return ; case 'steps': return ; case 'featureList': return ; case 'faq': return ; case 'stats': return ; case 'pricingExplainer': return ; case 'relatedTools': return ; case 'richText': return ; case 'ctaBanner': return ; case 'notice': return ; default: console.warn(`[SectionRenderer] Unknown section type: ${section.type}`); return null; } }