"use client";
import { useMemo } from "react";
import { motion, type Variants, useReducedMotion } from "framer-motion";
import { usePortfolioData } from "@/lib/usePortfolioData";
import { Section } from "./Section";
import MagneticButton from "./cinematic/MagneticButton";
import { DrawLine } from "./animations/DrawLine";
import { SectionLoading } from "./SectionLoading";
export default function Projects() {
const { data, loading, error } = usePortfolioData();
const shouldReduceMotion = useReducedMotion();
const projects = useMemo(
() => data?.projects.filter((p) => p.featured) || [],
[data],
);
if (loading) {
return ;
}
if (error) {
return
Error loading selected work
;
}
const gridVariants: Variants = {
hidden: {},
visible: {
transition: {
delayChildren: 0.08,
staggerChildren: 0.08,
},
},
};
const cardVariants: Variants = {
hidden: shouldReduceMotion
? { opacity: 0 }
: { opacity: 0, y: 24, 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 (
{projects.map((project) => (
{project.category}
{project.title}
{project.subtitle && (
{project.subtitle}
)}
{project.status}
{project.description}
{project.technologies.slice(0, 5).map((tech: string) => (
{tech}
))}
{project.githubUrl && (
Ver codigo
)}
{project.demoUrl && (
Abrir projeto
)}
))}
Explorar todos os cases
Ver servicos relacionados
);
}