Implemented BingoController
This commit is contained in:
parent
ae80324a46
commit
c7ce85a07c
@ -6,3 +6,9 @@
|
||||
.td{
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
.warning{
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
text-align: center;
|
||||
}
|
||||
|
17
src/app/components/bingocontroller.tsx
Normal file
17
src/app/components/bingocontroller.tsx
Normal 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}/>
|
||||
</>
|
||||
);
|
||||
}
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user