import React from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { GripVertical, ChevronDown, ChevronUp, Pencil, Trash2, Check, X, Triangle, Diamond, Circle, Square } from 'lucide-react'; import { Question } from '../types'; interface QuestionCardProps { question: Question; index: number; onEdit: () => void; onDelete: () => void; isExpanded: boolean; onToggleExpand: () => void; isDragging?: boolean; dragListeners?: any; } const ShapeIcon: React.FC<{ shape: string; className?: string }> = ({ shape, className }) => { const props = { size: 16, className }; switch (shape) { case 'triangle': return ; case 'diamond': return ; case 'circle': return ; case 'square': return ; default: return ; } }; const colorMap: Record = { red: 'bg-red-500', blue: 'bg-blue-500', yellow: 'bg-yellow-500', green: 'bg-green-500' }; export const QuestionCard: React.FC = ({ question, index, onEdit, onDelete, isExpanded, onToggleExpand, isDragging, dragListeners }) => { const correctOption = question.options.find(o => o.isCorrect); const truncatedText = question.text.length > 60 ? question.text.slice(0, 60) + '...' : question.text; return ( {index + 1} {truncatedText} {correctOption && ( {correctOption.text} )} { e.stopPropagation(); onEdit(); }} className="p-2 text-gray-400 hover:text-theme-primary hover:bg-theme-primary/10 rounded-lg transition-colors" > { e.stopPropagation(); onDelete(); }} className="p-2 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-lg transition-colors" > {isExpanded ? : } {isExpanded && ( {question.text} {question.options.map((option, idx) => ( {option.text} {option.isCorrect ? ( ) : ( )} {option.reason && ( {option.reason} )} ))} Time limit: {question.timeLimit}s )} ); };
{truncatedText}
{question.text}
{option.reason}