A daily game
at main 14 lines 404 B view raw
1import { PropsWithChildren } from "react"; 2import { Button } from "../ui/button"; 3import { useResetAtom } from "jotai/utils"; 4import { boardAtom } from "@/lib/state"; 5 6export function NewGameButton(props: PropsWithChildren) { 7 const newGame = useNewGameButton(); 8 9 return <Button {...props} onClick={() => newGame()} size={"lg"} />; 10} 11 12function useNewGameButton() { 13 return useResetAtom(boardAtom); 14}