"use client"; import { useEffect, useRef } from "react"; import SafeImage from "./SafeImage"; interface EducationItem { degree: string; school: string; startDate: string; endDate: string; logo?: string; } interface EducationProps { education: EducationItem[]; } function EduCard({ item, index }: { item: EducationItem; index: number }) { const ref = useRef(null); useEffect(() => { const el = ref.current; if (!el) return; const obs = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) { setTimeout(() => el.classList.add("visible"), index * 100); obs.disconnect(); } }, { threshold: 0.1 } ); obs.observe(el); return () => obs.disconnect(); }, [index]); return (
(e.currentTarget.style.borderColor = "#6b5730")} onMouseLeave={(e) => (e.currentTarget.style.borderColor = "#1c1f26")} > {/* Corner accent */}
{item.startDate} — {item.endDate}
{item.logo && (
)}

{item.degree}

{item.school}

); } export default function Education({ education }: EducationProps) { const headingRef = useRef(null); useEffect(() => { const el = headingRef.current; if (!el) return; const obs = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) { el.classList.add("visible"); obs.disconnect(); } }, { threshold: 0.1 } ); obs.observe(el); return () => obs.disconnect(); }, []); return (
Academic Background

Education

{education.map((item, i) => (
))}
); }