diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2025-10-04 18:36:10 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2025-10-04 18:36:10 -0700 |
| commit | 35add63ec4dce39710095f17abd86777de9e5b49 (patch) | |
| tree | 1afdf952f310e09a663e85541474efdc95155a73 /src/components/grid/GridComponent.tsx | |
| parent | 507c972ecafeceaf4f8962ad881f8fb50c9b86c1 (diff) | |
| download | ansicolor-35add63ec4dce39710095f17abd86777de9e5b49.tar.gz ansicolor-35add63ec4dce39710095f17abd86777de9e5b49.zip | |
Working history state
Diffstat (limited to 'src/components/grid/GridComponent.tsx')
| -rw-r--r-- | src/components/grid/GridComponent.tsx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/components/grid/GridComponent.tsx b/src/components/grid/GridComponent.tsx new file mode 100644 index 0000000..75d65aa --- /dev/null +++ b/src/components/grid/GridComponent.tsx @@ -0,0 +1,30 @@ +import React from 'react'; + +import type { Grid, GridCell } from '@/types/grid'; +import { Cell } from '@/components/grid/Cell'; + +interface GridProps { + grid: Grid; + onCellInteract?: (cell: GridCell) => void; +} + +export const GridComponent: React.FC<GridProps> = ({ + grid, + onCellInteract, +}) => { + return ( + <div className='grid'> + {grid.map((row, i) => ( + <div className='grid-row' key={i}> + {row.map((cell, j) => ( + <Cell + key={j} + cell={cell} + onClick={() => onCellInteract?.(cell)} + /> + ))} + </div> + ))} + </div> + ); +}; |
