import { useState } from 'react' const noop = (event) => event.preventDefault() function ViewGlyph({ kind }) { if (kind === 'two') { return ( ) } if (kind === 'four') { return ( {[0, 8].map((x) => [0, 8].map((y) => ), )} ) } return ( {[0, 5, 10].map((x) => [0, 5, 10].map((y) => ), )} ) } const VIEWS = [ { cols: 2, kind: 'two', label: '2 columns' }, { cols: 3, kind: 'four', label: '3 columns' }, { cols: 4, kind: 'nine', label: '4 columns' }, ] function Cell({ cell, projectName, index }) { const style = { aspectRatio: `928.5 / ${cell.h}` } if (cell.off) style.marginTop = `${cell.off / 2}px` return ( {cell.type === 'img' ? ( ) : ( )} ) } export default function ProjectSection({ project }) { const [cols, setCols] = useState(4) const [pressedCols, setPressedCols] = useState(4) const cells = project.rows.flat() return ( {project.name} , {project.tags.join(', ')}, {project.year} {VIEWS.map((view) => ( { setCols(view.cols) setPressedCols(cols) }} > ))} {cells.map((cell, i) => ( ))} ) }