import { useState } from 'react' import { CheckCircle, XCircle } from 'lucide-react' export default function QuizComponent({ data, onUpdate }) { const [selectedOption, setSelectedOption] = useState(null) const [isSubmitted, setIsSubmitted] = useState(false) const quizData = data || { question: "What did you learn from this section?", options: [ "Key concept A", "Important detail B", "Main takeaway C", "All of the above" ], correctAnswer: 3 } const handleSubmit = () => { setIsSubmitted(true) } const isCorrect = selectedOption === quizData.correctAnswer return (

Quick Quiz

{quizData.question}

{quizData.options.map((option, index) => (
{!isSubmitted ? ( ) : (
{isCorrect ? (
Correct! Well done.
) : (
Not quite right. Try again!
)}
)}
) }