import React, { useState } from "react"; interface ModalProps { state: "none" | "flex", setState: (state: "none" | "flex") => void question : { question: string, reponse_idx: number, choix: string[] }, valides?: [boolean[], React.Dispatch>], markerIndex?: number } export default function Modal({ state, setState, question, valides, markerIndex }: ModalProps) { const [isSuccess, setIsSuccess] = useState(false); const [isSubmitted, setIsSubmitted] = useState(false); console.log(state, setState, question) return (
{ isSuccess ?

CONGRATULATIONS

: isSubmitted && !isSuccess &&

WRONG : CORRECT ANSWER IS {question.choix[question.reponse_idx]}

}

{question.question}

{ question.choix.map((choix, index) => ( )) }
)}