import React, { useEffect, useState } from 'react'; import { motion } from 'framer-motion'; import type { Event } from '../../types'; interface StatsSectionProps { events: Event[]; } const StatsSection: React.FC = ({ events }) => { const [counts, setCounts] = useState({ nonTechnical: 0, technical: 0, workshops: 0, totalEvents: 0 }); useEffect(() => { if (events) { const nonTech = events.filter(e => e.category === 'NON-TECHNICAL').length; const tech = events.filter(e => e.category === 'TECHNICAL').length; const workshops = events.filter(e => e.category === 'WORKSHOP').length; setCounts({ nonTechnical: nonTech, technical: tech, workshops: workshops, totalEvents: events.length }); } }, [events]); const stats = [ { label: "Active Non-Tech Events", value: counts.nonTechnical, suffix: "+", delay: 0.1 }, { label: "Technical Events", value: counts.technical, suffix: "+", delay: 0.2 }, { label: "Workshops", value: counts.workshops, suffix: "+", delay: 0.3 }, { label: "Total Events", value: counts.totalEvents, suffix: "+", delay: 0.4 } ]; return (
{stats.map((stat, index) => ( {/* Corner accents similar to the image */}

{stat.value}{stat.suffix}

{stat.label}

))}
); }; export default StatsSection;