From 7d9ca6bdd587fb34f272f68e1457ceefb4810c52 Mon Sep 17 00:00:00 2001 From: datalore Date: Sat, 17 Feb 2024 12:45:53 +0100 Subject: [PATCH] feat: Implemented LPT Bingo --- src/app/components/bingocontroller.tsx | 7 ++++--- src/app/components/bingoitem.tsx | 2 +- src/app/lpt/page.tsx | 8 ++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 src/app/lpt/page.tsx diff --git a/src/app/components/bingocontroller.tsx b/src/app/components/bingocontroller.tsx index eca3663..69c75cf 100644 --- a/src/app/components/bingocontroller.tsx +++ b/src/app/components/bingocontroller.tsx @@ -14,8 +14,9 @@ function FisherYatesShuffle(array:string[]):string[]{ return array; } -export default function BingoController({buzzwords} : {buzzwords?: string[]}){ - const [size, setSize] = React.useState(5); +export default function BingoController({buzzwords, maxSize} : {buzzwords?: string[], maxSize?: number}){ + if(maxSize == undefined) maxSize = 5; + const [size, setSize] = React.useState(maxSize!); if(buzzwords == undefined || buzzwords.length < 1) buzzwords = ["Cloud", "Cyber-[Something]", "Distrupt[ive]", "AI", "Meta [Something]", "Gamification", "Web 2.0/3.0", "Industry 4.0", "Internet of Things", "Multiexperience", "Big Data", "Crypto", "[Something] as a service", "Emerging [Something]", "Streamline", "Ecosystem", "Leverage", "Outside the Box", "Pivot", "Strategic", "Agile", "Smart Tech", "Data Warehouse", "Actionable Insights", "Holistic Approach", "Digital Transformation", "Growth Hacking"]; const [items, setItems] = React.useState(buzzwords); const sizeError = (items.length < size); @@ -24,7 +25,7 @@ export default function BingoController({buzzwords} : {buzzwords?: string[]}){
- setSize(+s)}/> + setSize(+s)}/>
3x3 4x4 diff --git a/src/app/components/bingoitem.tsx b/src/app/components/bingoitem.tsx index e72c404..2571d22 100644 --- a/src/app/components/bingoitem.tsx +++ b/src/app/components/bingoitem.tsx @@ -9,6 +9,6 @@ export default function BingoItem({text}: Props){ const [clicked, setClicked] = React.useState(false); return( - setClicked(!clicked)}>{text} + setClicked(!clicked)}>{text} ); } diff --git a/src/app/lpt/page.tsx b/src/app/lpt/page.tsx new file mode 100644 index 0000000..77b9617 --- /dev/null +++ b/src/app/lpt/page.tsx @@ -0,0 +1,8 @@ +import BingoController from '../components/bingocontroller' + +export default function Home(){ + const buzzwords = ["Ohne Frieden ist alles nichts", "KW muss die Wahlordnung nochmal erklären", "Die Pizza ist da", "Stefan pöbelt", "Mareike pöbelt zurück", "Jemand überzieht die Redezeit", "Machentanz knallt die Tür zu", "GO-Antrag zur Mittagspause", "GO-Antrag zum GO-Antrag", "Mehrere Für-/Gegenreden", "Rita Krüger redet", "Ins Mikrofon schreien"]; + return( + + ); +}