"use client"; import { useState, useEffect } from 'react'; import { motion } from 'framer-motion'; import { ExternalLink, Github, Calendar, Layers, ArrowRight } from 'lucide-react'; import Link from 'next/link'; import { LiquidHeading } from '@/components/LiquidHeading'; import Image from 'next/image'; 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 [mounted, setMounted] = useState(false); const [projects, setProjects] = useState([]); useEffect(() => { setMounted(true); 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) { console.error('Error loading projects:', error); } }; loadProjects(); }, []); if (!mounted) return null; return (

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

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

{project.title}

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

{project.description}

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