import React, { useEffect, useState, useRef } from 'react'; import { motion, useInView } from 'framer-motion'; import { Rocket, GraduationCap, Users, Layers } from 'lucide-react'; interface CounterProps { value: number; duration?: number; suffix?: string; } const AnimatedCounter: React.FC = ({ value, duration = 1.2, suffix = "" }) => { const [count, setCount] = useState(0); const ref = useRef(null); const inView = useInView(ref, { once: true, margin: "-100px" }); useEffect(() => { if (inView) { let start = 0; const end = value; if (start === end) { setCount(end); return; } const totalMiliseconds = duration * 1000; const steps = Math.min(end, 50); // limit steps to keep it smooth const increment = Math.ceil(end / steps); const stepTime = totalMiliseconds / steps; const timer = setInterval(() => { start += increment; if (start >= end) { clearInterval(timer); setCount(end); } else { setCount(start); } }, stepTime); return () => clearInterval(timer); } }, [inView, value, duration]); return {count}{suffix}; }; export const StatsSection: React.FC = () => { const stats = [ { icon: , value: 22, suffix: "", label: "Active Incubated Startups", description: "Ambitious companies in various stages from idea validation to commercial revenue." }, { icon: , value: 100, suffix: "%", label: "Student Founders", description: "Driven completely by the entrepreneurial spirit of RIT's student community." }, { icon: , value: 20, suffix: "+", label: "Mentors Enabled", description: "Expert guidance from industry leaders and academics across engineering domains." }, { icon: , value: 8, suffix: "", label: "Sectors Represented", description: "Diverse projects across software, AI, hardware, campus tools, and social impact." } ]; return (
{/* Section Title */}
Incubator Performance

Our Metrics In Action

A snapshot of the growth and ecosystem metrics recorded for the year 2026.

{/* Stats Grid */}
{stats.map((stat, idx) => (
{stat.icon}

{stat.label}

{stat.description}

))}
); };