import { Quizz } from "@rahoot/common/types/game" import logo from "@rahoot/web/assets/logo.svg" import Button from "@rahoot/web/components/Button" import clsx from "clsx" import Image from "next/image" import { useState } from "react" import toast from "react-hot-toast" type QuizzWithId = Quizz & { id: string } type Props = { quizzList: QuizzWithId[] // eslint-disable-next-line no-unused-vars onSelect: (id: string) => void } export default function SelectQuizz({ quizzList, onSelect }: Props) { const [selected, setSelected] = useState(null) const handleSelect = (id: string) => () => { if (selected === id) { setSelected(null) } else { setSelected(id) } } const handleSubmit = () => { if (!selected) { toast.error("Please select a quizz") return } onSelect(selected) } return (
logo

Select a quizz

{quizzList.map((quizz) => ( ))}
) }