import React, { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; export default function TopPerformersSection() { // 1. Toggle for the Configuration Panel const [showConfig, setShowConfig] = useState(true); // 2. State for Slider Values const [config, setConfig] = useState({ skillsWeight: 2, experienceWeight: 5, certificationBonus: 15, referencesBonus: 10 }); const handleChange = (key, e) => { setConfig({ ...config, [key]: parseInt(e.target.value) }); }; // --- STYLES (Dark Theme + Red Accents) --- const containerStyle = { backgroundColor: '#0f172a', // Dark Navy Background padding: '2rem', borderRadius: '1.5rem', color: 'white', fontFamily: 'sans-serif', maxWidth: '800px', margin: '0 auto' }; const headerStyle = { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: '1.5rem' }; // The "Box" for the Configuration (Inset style) const configBoxStyle = { backgroundColor: '#1e293b', // Slightly lighter dark for contrast border: '1px solid #334155', // Subtle border borderRadius: '1rem', padding: '1.5rem', marginBottom: '2rem', // Space between config and list boxShadow: 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.2)' // Inner shadow for depth }; const labelRowStyle = { display: 'flex', justifyContent: 'space-between', marginBottom: '0.5rem', fontSize: '0.85rem', fontWeight: '500', color: '#94A3B8' // Muted text }; // Helper for Red Gradient Slider const getSliderStyle = (value, max) => { const percentage = (value / max) * 100; return { width: '100%', height: '6px', borderRadius: '3px', background: `linear-gradient(to right, #EF4444 0%, #EF4444 ${percentage}%, #334155 ${percentage}%, #334155 100%)`, appearance: 'none', outline: 'none', cursor: 'pointer' }; }; // Dummy Data for the List const candidates = [ { name: "Elena Martinez", role: "Data Scientist", score: 87, img: "https://i.pravatar.cc/150?u=elena" }, { name: "Sarah Johnson", role: "UX/UI Designer", score: 81, img: "https://i.pravatar.cc/150?u=sarah" }, { name: "Iffah Fathima", role: "Student", score: 77, img: "https://i.pravatar.cc/150?u=iffah" }, { name: "Rayaaan", role: "Senior Developer", score: 62, img: "https://i.pravatar.cc/150?u=rayaan" } ]; return (
{/* --- 1. Header Section --- */}

Top Performers

Outstanding candidates by skills, experience and match

{/* Toggle Button */}
{/* --- 2. Collapsible Configuration Box --- */} {showConfig && (

Scoring Configuration

{/* Slider Item 1 */}
Skills Weight {config.skillsWeight}
handleChange('skillsWeight', e)} style={getSliderStyle(config.skillsWeight, 10)} className="custom-range" />
{/* Slider Item 2 */}
Experience Weight {config.experienceWeight}
handleChange('experienceWeight', e)} style={getSliderStyle(config.experienceWeight, 10)} className="custom-range" />
{/* Slider Item 3 */}
Certification Bonus {config.certificationBonus}
handleChange('certificationBonus', e)} style={getSliderStyle(config.certificationBonus, 30)} className="custom-range" />
{/* Slider Item 4 */}
References Bonus {config.referencesBonus}
handleChange('referencesBonus', e)} style={getSliderStyle(config.referencesBonus, 20)} className="custom-range" />
)}
{/* --- 3. Candidates List --- */}
{candidates.map((person, index) => (
{person.name}

{person.name}

Score: {person.score}

{person.role}

))}
{/* --- Global CSS for Sliders --- */}
); }