From c7ce85a07c527438453f9126eae7f5d82182a7e5 Mon Sep 17 00:00:00 2001 From: datalore Date: Fri, 3 Nov 2023 00:03:08 +0100 Subject: [PATCH] Implemented BingoController --- src/app/components/bingo.module.css | 6 ++++++ src/app/components/bingocontroller.tsx | 17 +++++++++++++++++ src/app/page.tsx | 5 ++--- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 src/app/components/bingocontroller.tsx diff --git a/src/app/components/bingo.module.css b/src/app/components/bingo.module.css index b3c967f..8565b45 100644 --- a/src/app/components/bingo.module.css +++ b/src/app/components/bingo.module.css @@ -6,3 +6,9 @@ .td{ padding: 12px 16px; } + +.warning{ + font-weight: bold; + color: red; + text-align: center; +} diff --git a/src/app/components/bingocontroller.tsx b/src/app/components/bingocontroller.tsx new file mode 100644 index 0000000..56c0ac3 --- /dev/null +++ b/src/app/components/bingocontroller.tsx @@ -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 &&

Warning: Mismatch between item count and size

} + + + ); +} diff --git a/src/app/page.tsx b/src/app/page.tsx index d3c5c10..ea960dc 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -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(

Buzzword Bingo

- +
); }