"use client"; import { useMemo } from "react"; import { motion, type Variants, useReducedMotion } from "framer-motion"; import { usePortfolioData } from "@/lib/usePortfolioData"; import { Section } from "./Section"; import { DrawLine } from "./animations/DrawLine"; import MagneticButton from "./cinematic/MagneticButton"; import { SectionLoading } from "./SectionLoading"; export default function Experience() { const { data, loading, error } = usePortfolioData(); const shouldReduceMotion = useReducedMotion(); const sortedExperiences = useMemo(() => { if (!data?.experiences) return []; return [...data.experiences] .filter((exp) => exp.featured) .sort((a, b) => { const yearA = Number.parseInt(a.period.match(/\d{4}/)?.[0] || "0", 10); const yearB = Number.parseInt(b.period.match(/\d{4}/)?.[0] || "0", 10); return yearB - yearA; }); }, [data]); if (loading) { return ; } if (error || !data) { return
Error loading selected experience
; } const listVariants: Variants = { hidden: {}, visible: { transition: { delayChildren: 0.08, staggerChildren: 0.08, }, }, }; const itemVariants: Variants = { hidden: shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 20, clipPath: "inset(100% 0 0 0)" }, visible: { opacity: 1, y: 0, clipPath: "inset(0% 0 0 0)", transition: shouldReduceMotion ? { duration: 0.25 } : { duration: 0.8, ease: [0.16, 1, 0.3, 1] }, }, }; return (
{sortedExperiences.map((exp) => (
{exp.period}

{exp.title}

{exp.company} • {exp.type}

{exp.location}

{exp.description}

    {exp.achievements?.map((achievement) => (
  • {achievement}
  • ))}
    {exp.technologies?.slice(0, 6).map((tech) => ( {tech} ))}
))}
); }