"use client"; import React, { useMemo } from "react"; import { motion } from "framer-motion"; import { ChevronRight, Terminal, Cpu, Network, Code2 } from "lucide-react"; import { usePortfolioData } from "@/lib/usePortfolioData"; // --- Tipagem e Configuração (Otimização Pareto 80/20) --- const CONFIG = { "innovo-tecnologia": { color: "text-blue-400", bg: "bg-blue-400/10", border: "border-blue-400/20", icon: Cpu }, "apolo-energia": { color: "text-emerald-400", bg: "bg-emerald-400/10", border: "border-emerald-400/20", icon: Network }, default: { color: "text-slate-400", bg: "bg-slate-400/10", border: "border-slate-400/20", icon: Code2 } }; export default function Experience() { const { data, loading, error } = usePortfolioData(); // Memória: Evita re-processamento de regex em cada re-render (Princípio de Eficiência) const sortedExperiences = useMemo(() => { if (!data?.experiences) return []; return [...data.experiences] .filter((exp) => exp.featured) .sort((a, b) => { const yearA = parseInt(a.period.match(/\d{4}/)?.[0] || "0"); const yearB = parseInt(b.period.match(/\d{4}/)?.[0] || "0"); return yearB - yearA; // Da mais recente para a mais antiga (Padrão Senior) }); }, [data]); if (loading) return ; return (
{/* Background Gradients */}
{/* Header com Identidade Visual */}
SYSTEM_LOGS.history Trajetória Profissional
{/* Timeline Desktop (Linha Central com Gradiente) */}
{sortedExperiences.map((exp, index) => ( ))}
); } // --- Sub-componente Card (Encapsulamento de Lógica de Transição) --- function ExperienceCard({ exp, index }: { exp: any, index: number }) { const isEven = index % 2 === 0; const config = (CONFIG as any)[exp.company.toLowerCase().replace(/\s+/g, "-")] || CONFIG.default; const Icon = config.icon; return (
{/* Node Central (O "Ponto" da Timeline) */}
{/* Indicador de Data na Timeline */}
{exp.period.split(' ')[0]}
{/* Card Principal */}
{/* Background Glow Effect on Hover */}
{/* Badge de Empresa & Header */}
{exp.company}

{exp.title}

{exp.period}

{exp.description}

{/* Conquistas (Checklist Técnico) */}
{exp.achievements?.map((ach: string, i: number) => (
{ach}
))}
{/* Tags de Tech */}
{exp.technologies?.map((tech: string) => ( {tech} ))}
{/* Spacer para Timeline Desktop */}
); } function ExperienceSkeleton() { return (
BOOTING_SYSTEM_HISTORY...
); }