"use client"; import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { ExternalLinkIcon, GithubIcon, CodeIcon } from 'lucide-react'; interface Project { title: string; description: string; techStack: string[]; link?: { href: string; label?: string; }; } interface ProjectsSectionProps { projects: Project[]; } const ProjectsSection: React.FC = ({ projects }) => { const [activeFilter, setActiveFilter] = useState('All'); const [hoveredProject, setHoveredProject] = useState(null); const [selectedProject, setSelectedProject] = useState(null); // Extract unique tech stacks for filter const techStacks = Array.from( new Set(projects.flatMap(project => project.techStack)) ); // Filter projects based on tech stack const filteredProjects = activeFilter === 'All' ? projects : projects.filter(project => project.techStack.includes(activeFilter)); const containerVariants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.1, when: "beforeChildren" }, }, }; const itemVariants = { hidden: { y: 20, opacity: 0 }, visible: { y: 0, opacity: 1, transition: { type: "spring", stiffness: 100, }, }, }; // Generate a random image for each project (for demo purposes) // In a real project, you'd use actual project images const getProjectImage = (title: string) => { const seed = title.charCodeAt(0) + title.length; return `https://picsum.photos/seed/${seed}/600/400`; }; return (

My Projects

A showcase of my technical projects and applications, demonstrating my skills and expertise in various technologies.

{/* Filter controls */} setActiveFilter('All')} whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }} > All Projects {techStacks.map((tech, index) => ( setActiveFilter(tech)} whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }} > {tech} ))} {/* Projects Grid */} {filteredProjects.map((project, index) => ( setHoveredProject(project.title)} onHoverEnd={() => setHoveredProject(null)} onClick={() => setSelectedProject(project)} >
{project.title}

{project.title}

{project.description}

{project.techStack.map((tech, techIndex) => ( {tech} ))}
{project.link && ( e.stopPropagation()} > )}
))}
{/* Project Modal */} {selectedProject && ( setSelectedProject(null)} > e.stopPropagation()} >
{selectedProject.title}

{selectedProject.title}

{selectedProject.techStack.map((tech, techIndex) => ( {tech} ))}

{selectedProject.description}

{selectedProject.link && ( )}
)}
); }; export default ProjectsSection;