"use client"; import React, { useMemo } from "react"; import { motion } from "motion/react"; import { BentoGrid, BentoGridItem } from "@/components/magicui/bento-grid"; import { ExternalLink, Github, Star, Zap, Globe, Cpu, Code2, Terminal, } from "lucide-react"; import { usePortfolioData } from "@/lib/usePortfolioData"; // --- Configuração de Cores (Harmonizado com a seção anterior) --- const CATEGORY_THEMES: Record = { "full-stack": { color: "text-blue-400", bg: "bg-blue-500/10", border: "border-blue-500/20", icon: Globe }, iot: { color: "text-purple-400", bg: "bg-purple-500/10", border: "border-purple-500/20", icon: Cpu }, api: { color: "text-orange-400", bg: "bg-orange-500/10", border: "border-orange-500/20", icon: Code2 }, web: { color: "text-green-400", bg: "bg-green-500/10", border: "border-green-500/20", icon: Globe }, desktop: { color: "text-emerald-400", bg: "bg-emerald-500/10", border: "border-emerald-500/20", icon: Terminal }, }; // Funções auxiliares para Schema function getApplicationCategory(category: string): string { const map: Record = { "full-stack": "WebApplication", "iot": "DesktopApplication", "api": "WebApplication", "web": "WebApplication", "desktop": "DesktopApplication" }; return map[category.toLowerCase()] || "WebApplication"; } function getOperatingSystem(category: string): string { if (category.toLowerCase() === "desktop") return "Windows, Linux"; return "Web Browser"; } export default function Projects() { const { data, loading, error } = usePortfolioData(); const projects = useMemo(() => data?.projects.filter((p) => p.featured) || [], [data]); const projectsJsonLd = useMemo(() => { if (!projects || projects.length === 0) return null; return { "@context": "https://schema.org", "@type": "ItemList", "itemListElement": projects.map((project, index) => ({ "@type": "ListItem", "position": index + 1, "item": { "@type": "SoftwareApplication", "name": project.title, "description": project.description, "applicationCategory": getApplicationCategory(project.category), "operatingSystem": getOperatingSystem(project.category), "url": project.demoUrl || project.githubUrl || `https://evandro.dev.br/#projects`, "offers": { "@type": "Offer", "price": "0", "priceCurrency": "BRL" }, "softwareVersion": "1.0.0", "author": { "@type": "Person", "name": "Evandro Fonseca Junior", "url": "https://evandro.dev.br" } } })) }; }, [projects]); if (loading) return
Loading_Assets...
; if (error) return
System_Error: Failed to sync projects.
; return (
{/* Background Decor */}
Produção_Intelectual

Projetos Principais

{projects.map((project, index) => { const theme = CATEGORY_THEMES[project.category.toLowerCase()] || CATEGORY_THEMES.web; // Lógica de Grid Inteligente: // Index 0: NutriScan (Destaque - 2 colunas) // Index 1: Twins Lab (Complemento - 1 coluna) // Demais: 1 coluna cada (Preenche a linha 2 perfeitamente) const colSpan = index === 0 ? "md:col-span-2" : "md:col-span-1"; return ( {/* Header: Icon & Links */}

{project.title}

{project.subtitle}

{project.githubUrl && } {project.demoUrl && }
{/* Badges de Tecnologias */}
{project.technologies.slice(0, 5).map((tech: string) => ( {tech} ))}

{project.description}

{/* Footer: Metrics & Status */}
Complexity
{project.status}
{/* Background Hover Glow */}
); })} {/* JSON-LD Schema for Projects */} {projectsJsonLd && (