All files bucket.tsx

100% Statements 15/15
100% Branches 0/0
100% Functions 8/8
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 134x     1x   4x 4x   12x 12x   1x  
import * as React from 'react'
import { bucket, row, cell } from './model'
 
const Bucket = ({ rows }: { rows: bucket }) => <table className="bucket"><tbody>{Rows(rows)}</tbody></table>
 
const Rows = (rows: bucket) => rows.map((row, index) => <Row cells={row} key={index} />)
const Row = ({ cells }: { cells: row }) => <tr>{Cells(cells)}</tr>
 
const Cells = (cells: row) => cells.map((cell, index) => <Cell shape={cell} key={index} />)
const Cell = ({ shape }: { shape: cell }) => <td className={'tetromino-' + shape}></td>
 
export default Bucket