buzzword-bingo/src/app/components/bingoitem.tsx

15 lines
326 B
TypeScript
Raw Normal View History

2023-11-03 03:41:08 +01:00
import clsx from 'clsx'
import React from 'react'
2023-11-02 23:08:51 +01:00
2023-11-02 23:38:12 +01:00
interface Props{
text: string;
}
export default function BingoItem({text}: Props){
2023-11-03 03:41:08 +01:00
const [clicked, setClicked] = React.useState(false);
2023-11-02 23:08:51 +01:00
return(
2023-11-03 03:41:08 +01:00
<td className={clsx("cursor-pointer", {"bg-primary-focus":clicked})} onClick={() => setClicked(!clicked)}>{text}</td>
2023-11-02 23:08:51 +01:00
);
}