Implemented BingoController

This commit is contained in:
datalore 2023-11-03 00:03:08 +01:00
parent ae80324a46
commit c7ce85a07c
3 changed files with 25 additions and 3 deletions

View File

@ -6,3 +6,9 @@
.td{
padding: 12px 16px;
}
.warning{
font-weight: bold;
color: red;
text-align: center;
}

View File

@ -0,0 +1,17 @@
'use client';
import React from 'react'
import Bingo from './bingo.tsx'
import styles from './bingo.module.css'
export default function BingoController(){
const [size, setSize] = React.useState(5);
const [items, setItems] = React.useState(["Cloud", "Cyber", "Distruptive Technology", "AI", "Metaverse", "Gamification", "Web 3.0", "Industry 4.0", "Internet of Things", "Multiexperience", "Big Data", "Crypto", "[Insert bullshit here] as a service"]);
const sizeError = ((items.length % size) != 0);
return(
<>
{sizeError && <p className={styles.warning}>Warning: Mismatch between item count and size</p>}
<Bingo size={size} items={items}/>
</>
);
}

View File

@ -1,12 +1,11 @@
import styles from './page.module.css'
import Bingo from './components/bingo.tsx'
import BingoController from './components/bingocontroller.tsx'
export default function Home(){
const items=["test1", "test2", "test3", "test4", "test5"];
return(
<main className={styles.main}>
<h1 align="center">Buzzword Bingo</h1>
<Bingo size={2} items={items}/>
<BingoController/>
</main>
);
}