ContentBlocksSection.tsx22 lines · main
| 1 | import type { GoContentBlocksSection } from '../schemas' |
| 2 | |
| 3 | export default function ContentBlocksSection({ section }: { section: GoContentBlocksSection }) { |
| 4 | const gridCols = section.columns === '2' ? 'md:grid-cols-2' : 'md:grid-cols-3' |
| 5 | |
| 6 | return ( |
| 7 | <div> |
| 8 | {section.heading && ( |
| 9 | <h2 className="text-foreground text-2xl text-center mb-8">{section.heading}</h2> |
| 10 | )} |
| 11 | <div className={`grid grid-cols-1 ${gridCols} gap-8`}> |
| 12 | {section.blocks.map((block) => ( |
| 13 | <div key={block.heading}> |
| 14 | {block.icon && <span className="text-2xl mb-2 block">{block.icon}</span>} |
| 15 | <h3 className="text-foreground text-lg font-medium">{block.heading}</h3> |
| 16 | <p className="text-foreground-lighter mt-2 text-sm">{block.body}</p> |
| 17 | </div> |
| 18 | ))} |
| 19 | </div> |
| 20 | </div> |
| 21 | ) |
| 22 | } |