import PageTransition from "@/components/home/PageTransition"; import { Button } from "@/components/ui/button"; import { useProjects } from "@/hooks/queires/useProjects"; import { AnimatePresence, motion } from "framer-motion"; import { ArrowLeft, Brain, Cloud, ExternalLink, Github, Globe, Loader2, Search, Smartphone, Workflow, } from "lucide-react"; import { useMemo, useState } from "react"; import { Link } from "react-router-dom"; const categories = [ { id: "all", name: "All Projects", icon: null }, { id: "web", name: "Web", icon: Globe }, { id: "mobile", name: "Mobile", icon: Smartphone }, { id: "ai", name: "AI", icon: Brain }, { id: "cloud", name: "Cloud", icon: Cloud }, { id: "devops", name: "DEVOPS", icon: Workflow }, ]; const containerVariants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.08, }, }, }; export default function Projects() { const { data: projectsData, isLoading, isError } = useProjects(); const [activeCategory, setActiveCategory] = useState("all"); const [searchQuery, setSearchQuery] = useState(""); const filteredProjects = useMemo(() => { const projects = projectsData?.data?.data?.result || []; if (!projects) return []; return projects.filter((project) => { const matchesCategory = activeCategory === "all" || project.category === activeCategory; const matchesSearch = searchQuery.trim() === "" || project.title.toLowerCase().includes(searchQuery.toLowerCase()) || project.description.toLowerCase().includes(searchQuery.toLowerCase()) || project.technologies.some((tech: string) => tech.toLowerCase().includes(searchQuery.toLowerCase()), ); return matchesCategory && matchesSearch; }); }, [projectsData, activeCategory, searchQuery]); return (
{/* Hero Section */}
{/* Back Button */} {/* Header */}

Our Projects

Explore our portfolio of innovative solutions designed to scale and transform businesses across industries.

{/* Interactive Search and Filter Section */} {/* Search Bar */}
setSearchQuery(e.target.value)} className="w-full pl-10 pr-4 py-2.5 rounded-full border border-border/50 bg-background/50 backdrop-blur-sm focus:outline-none focus:ring-2 focus:ring-primary/40 transition-all text-sm shadow-sm" aria-label="Search projects" />
{/* Filter Tabs */}
{categories.map((category) => { const Icon = category.icon; const isActive = activeCategory === category.id; return ( ); })}
{/* Projects Grid */}
{/* Loading / Error State */} {isLoading && (
Loading projects...
)} {isError && (

Failed to load projects.

Please check your network connection or try again later.

)} {!isLoading && !isError && ( {filteredProjects.map((project) => (
{/* Project Image */}
{project.title}
{/* Category Badge */}
{ categories.find( (c) => c.id === project.category, )?.name }
{/* Quick External Links */}
{project.liveUrl && ( )} {project.githubUrl && ( )}
{/* Title & Description */}
{project.client} {project.year}

{project.title}

{project.description}

{/* Technologies and Detail Navigation */}
{project.technologies .slice(0, 5) .map((tech: string) => ( {tech} ))} {project.technologies.length > 5 && ( +{project.technologies.length - 5} )}
))} )} {/* Empty State */} {!isLoading && !isError && filteredProjects.length === 0 && (

No projects match your current search or category.

)}
); }