diff --git a/frontend/src/components/WrittenVocabularyExercise.tsx b/frontend/src/components/WrittenVocabularyExercise.tsx new file mode 100644 index 0000000..c746252 --- /dev/null +++ b/frontend/src/components/WrittenVocabularyExercise.tsx @@ -0,0 +1,46 @@ +import { useState } from 'react'; + +interface WrittenVocabularyProps { + question: string; + pronunciation: string; + definition: string; + example: string; + onQuestionSubmit: Function; +} + +export default function WrittenQuestionExercise({question, pronunciation, definition, example, onQuestionSubmit}: WrittenVocabularyProps) { + const [answered, setAnswered] = useState(false); + + const handleSubmit = () => { + if (answered) { + setAnswered(false); + onQuestionSubmit(); + } else { + setAnswered(true); + } + + } + + return ( +
{definition}
+{example}
+