import React from 'react'; import type { Question, Category, UserAnswer } from '../types'; import { AnswerOption } from './AnswerOption'; import styles from '../styles/quiz.module.css'; interface QuestionCardProps { question: Question; category: Category | undefined; currentAnswer: UserAnswer | undefined; onSelectAnswer: (answerIndex: number) => void; onBack: () => void; showBack: boolean; } const LETTERS = ['A', 'B', 'C', 'D', 'E', 'F']; export const QuestionCard: React.FC = ({ question, category, currentAnswer, onSelectAnswer, onBack, showBack, }) => { return (
{category && ( {category.name} )}

{question.text}

{question.answers.map((answer, idx) => ( onSelectAnswer(idx)} /> ))}
{showBack && ( )}
); };