"use client"; import { useState, useEffect } from "react"; import { motion, Variants } from "framer-motion"; import { ExternalLink, Github, Layers, ArrowRight } from "lucide-react"; import Link from "next/link"; import Image from "next/image"; const fadeInUp: Variants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.25, 0.1, 0.25, 1], }, }, }; const staggerContainer: Variants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.2, delayChildren: 0.1, }, }, }; interface Project { id: number; title: string; description: string; content: string; tags: string[]; featured: boolean; category: string; date: string; github?: string; live?: string; imageUrl?: string; } const Projects = () => { const [projects, setProjects] = useState([]); useEffect(() => { const loadProjects = async () => { try { const response = await fetch( "/api/projects?featured=true&published=true&limit=6", ); if (response.ok) { const data = await response.json(); setProjects(data.projects || []); } } catch (error) { if (process.env.NODE_ENV === "development") { console.error("Error loading projects:", error); } } }; loadProjects(); }, []); return (

Selected Works

A collection of projects I've worked on, ranging from web applications to experiments.

{projects.map((project) => ( {/* Project Cover / Header */}
{project.imageUrl ? ( {project.title} ) : (
{project.title.charAt(0)}
)} {/* Overlay Links */}
{project.github && ( )} {project.live && ( )}
{/* Content */}

{project.title}

{new Date(project.date).getFullYear()}

{project.description}

{project.tags.slice(0, 3).map((tag, tIdx) => ( {tag} ))} {project.tags.length > 3 && ( + {project.tags.length - 3} )}
Read more{" "}
))} View All Projects
); }; export default Projects;