import React, { useMemo } from 'react'; import { motion } from 'framer-motion'; const ExperienceChart = ({ applicants = [] }) => { const avgExperience = useMemo(() => { console.log("📊 Applications received:", applicants); if (!applicants || applicants.length === 0) { return "0.0"; } let totalExp = 0; applicants.forEach((app, index) => { const rawExp = app?.experience; console.log(`🔍 Applicant [${index}] experience:`, rawExp); const exp = parseFloat(rawExp); if (!isNaN(exp)) { totalExp += exp; } }); console.log("📈 Total Experience:", totalExp); console.log("👥 Total Candidates:", applicants.length); const avg = applicants.length > 0 ? totalExp / applicants.length : 0; return avg.toFixed(1); }, [applicants]); return (
Based on application data