From 2a0e24e24f728bbb858e11c47a08ad9d672d840e Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 17 Feb 2021 22:22:30 +0100 Subject: voerbord connector beginnings --- components/voerBord.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'components') diff --git a/components/voerBord.tsx b/components/voerBord.tsx index 3e319a1..67bc86d 100644 --- a/components/voerBord.tsx +++ b/components/voerBord.tsx @@ -1,18 +1,17 @@ -interface VoerBordProps { +export function VoerBord(props: { width: number; height: number; -} - -export function VoerBord(props: VoerBordProps) { + onMove: (move: string) => void; +}) { return { - [...Array(props.height)].map(() => ( + [...Array(props.height).keys()].map((row) => ( - {[...Array(props.width)].map(() => ( + {[...Array(props.width).keys()].map((column) => ( ))} -- cgit v1.2.3
{ + props.onMove((event.target as HTMLElement).id.split("-")[1]) }}/>