22 lines
460 B
TypeScript
22 lines
460 B
TypeScript
import BingoRow from './bingorow.tsx'
|
|
|
|
interface Props{
|
|
size: number;
|
|
items: string[];
|
|
}
|
|
|
|
export default function Bingo({size, items}: Props){
|
|
let rows: string[][] = [];
|
|
for(let i = 0; i < (items.length / size); i++)
|
|
{
|
|
rows[i] = items.slice(i * size, (i + 1) * size);
|
|
}
|
|
return(
|
|
<table className='table bg-primary text-primary-content m-auto'>
|
|
<tbody>
|
|
{rows.map((item, index) => <BingoRow key={index} items={item}/>)}
|
|
</tbody>
|
|
</table>
|
|
);
|
|
}
|