import { motion } from 'framer-motion'; import { LineChart, Line, XAxis, YAxis, ResponsiveContainer } from 'recharts'; const EmotionTimeline = ({ history }) => { // Prepare data for chart const chartData = history.map((item, index) => ({ time: index, engagement: item.engagement * 100, confidence: item.confidence * 100, emotion: Object.entries(item.emotion.predictions).reduce((a, b) => a[1] > b[1] ? a : b)[1] * 100 })); const emotionColors = { happy: '#10B981', sad: '#3B82F6', angry: '#EF4444', fear: '#8B5CF6', surprise: '#F59E0B', disgust: '#6B7280', neutral: '#9CA3AF' }; return (
{history[history.length - 1].emotion.dominant}