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

15 lines
376 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(
<td><a className={clsx("btn btn-xs sm:btn-sm md:btn-md w-full", {"btn-ghost":(!clicked)}, {"btn-accent":clicked})} onClick={() => setClicked(!clicked)}>{text}</a></td>
2023-11-02 23:08:51 +01:00
);
}