"use client"; import { useState, useEffect } from "react"; import { motion } from "framer-motion"; import { ArrowUpRight } from "lucide-react"; import Link from "next/link"; import Image from "next/image"; import { useLocale, useTranslations } from "next-intl"; import { Skeleton } from "./ui/Skeleton"; interface Project { id: number; slug: string; 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([]); const [loading, setLoading] = useState(true); const locale = useLocale(); useTranslations("home.projects"); 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) { console.error("Featured projects fetch failed:", error); } finally { setLoading(false); } }; loadProjects(); }, []); return (

Selected Work.

Projects that pushed my boundaries.

View Archive
{loading ? ( Array.from({ length: 2 }).map((_, i) => (
)) ) : projects.length === 0 ? (
No projects yet.
) : ( projects.map((project) => ( {/* Image Card */}
{project.imageUrl ? ( {project.title} ) : (
{project.title.charAt(0)}
)} {/* Overlay on Hover */}
{/* Text Content */}

{project.title}

{project.description}

{project.tags.slice(0, 2).map(tag => ( {tag} ))}
)))}
); }; export default Projects;