import styles from './bingo.module.css'
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; i++)
	{
		rows[i] = items.slice(i * size, (i + 1) * size);
	}
	return(
		<table className={styles.table}>
		<tbody>
		{rows.map((item, index) => <BingoRow key={index} items={item}/>)}
		</tbody>
		</table>
	);
}
