/** * Manifesto Content Component * * Long-form reading experience with manifesto text. * Renders paragraphs with proper typography for optimal reading. */ import type { ManifestoSection } from '@/content/schemas/manifesto' import { InsightBox } from './insight-box' import { StatementSection } from './statement-section' interface ManifestoContentProps { sections: ManifestoSection[] } export function ManifestoContent({ sections }: ManifestoContentProps) { // Group consecutive non-statement sections into article blocks const blocks: Array<{ start: number; end: number }> = [] let blockStart = 0 sections.forEach((section, index) => { if (section.type === 'statement') { if (blockStart < index) { blocks.push({ start: blockStart, end: index - 1 }) } blockStart = index + 1 } }) // Add final block if needed if (blockStart < sections.length) { blocks.push({ start: blockStart, end: sections.length - 1 }) } let blockIndex = 0 return ( <> {sections.map((section, index) => { // Statement sections are full-width if (section.type === 'statement') { return } // Check if this is the start of a new article block const currentBlock = blocks[blockIndex] const isBlockStart = currentBlock && index === currentBlock.start if (isBlockStart) { const blockSections = sections.slice(currentBlock.start, currentBlock.end + 1) blockIndex++ return (
{blockSections.map((blockSection) => { if (blockSection.type === 'paragraph') { return (

{blockSection.content}

) } if (blockSection.type === 'insight') { return ( {blockSection.content} ) } return null })}
) } return null })} ) }