import React from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { useGenerate } from '../GenerateContext'; import { Layers, Activity, FileStack, BookOpen, BrainCircuit } from 'lucide-react'; import { cn } from '../../../../src/utils/cn'; export const SummaryPanel = () => { const { materials, configure, step } = useGenerate(); // Calculate total questions safely handling objects vs arrays let totalQuestions = 0; if (configure?.questionTypes && Array.isArray(configure.questionTypes)) { totalQuestions = configure.questionTypes.filter(q => q.selected).reduce((acc, curr) => acc + (parseInt(curr.count) || 0), 0); } else if (configure?.questionTypes) { totalQuestions = Object.values(configure.questionTypes).reduce((acc, curr) => acc + (parseInt(curr) || 0), 0); } const bloomColors = { remember: 'bg-[#ff6b6b]', understand: 'bg-[#feca57]', apply: 'bg-[#1dd1a1]', analyze: 'bg-[#54a0ff]', evaluate: 'bg-[#5f27cd]', create: 'bg-[#ff9ff3]' }; return (

Configuration Summary

{/* Materials selected */}

Source Materials

{materials.length} Files Selected
{materials.length === 0 && No files selected}
{/* Difficulty & Type */}

Difficulty & Format

{configure.difficulty < 33 ? 'Easy' : configure.difficulty < 66 ? 'Med' : 'Hard'} Level
{totalQuestions} Questions
{/* Bloom's Breakdown */}

Cognitive Depth

{/* Mini donut/bar chart approximation */}
{Object.entries(configure.bloomsDistribution).map(([key, rawVal]) => { const val = parseInt(rawVal) || 0; if (val === 0) return null; return (
); })}
{Object.entries(configure.bloomsDistribution).map(([key, val]) => { if (val === 0) return null; return (
{key}
{val}%
); })}
{/* Smart AI Recommendation hint based on bloom levels */} {step === 2 && configure.bloomsDistribution.remember > 40 && (

AI Suggestion

This distribution is heavily focused on recall. Consider increasing "Apply" and "Analyze" for a more robust assessment.

)}
); };