"use client"; import { useState, useEffect } from "react"; import { motion } from 'framer-motion'; import { ExternalLink, Github, Calendar, ArrowLeft } from 'lucide-react'; import Link from 'next/link'; interface Project { id: number; title: string; description: string; content: string; tags: string[]; featured: boolean; category: string; date: string; github?: string; live?: string; } const ProjectsPage = () => { const [projects, setProjects] = useState([]); // Load projects from localStorage useEffect(() => { const savedProjects = localStorage.getItem('portfolio-projects'); if (savedProjects) { setProjects(JSON.parse(savedProjects)); } }, []); const categories = ["All", "Web Development", "Full-Stack", "Web Application", "Mobile App"]; const [selectedCategory, setSelectedCategory] = useState("All"); const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); }, []); if (!mounted) { return null; } const filteredProjects = selectedCategory === "All" ? projects : projects.filter(project => project.category === selectedCategory); console.log('Selected category:', selectedCategory); console.log('Filtered projects:', filteredProjects); if (!mounted) { return null; } return (
{/* Header */} Back to Home

My Projects

Explore my portfolio of projects, from web applications to mobile apps. Each project showcases different skills and technologies.

{/* Category Filter */}
{categories.map((category) => ( ))}
{/* Projects Grid */}
{filteredProjects.map((project, index) => (
{project.title.split(' ').map(word => word[0]).join('').toUpperCase()}
{project.title}
{project.featured && (
Featured
)}
{project.github && ( )} {project.live && project.live !== "#" && ( )}

{project.title}

{project.date}

{project.description}

{project.tags.map((tag) => ( {tag} ))}
View Project
))}
); }; export default ProjectsPage;