'use client' import { useState } from 'react' import { ChevronRightIcon } from '@heroicons/react/20/solid' import { clsx } from 'clsx' import { Button } from './button' const filters = { category: ['All', 'Education', 'Health', 'Climate', 'Infrastructure'], country: ['All', 'South Africa', 'Brazil', 'Tanzania'], status: ['All', 'Active', 'Funded', 'Closed'], funding: ['All', 'Donation', 'Investment', 'Pay-it-Forward'], } const projects = [ { id: 1, title: 'Zanzibar Schools', imageUrl: '/portfolio/zanzibar.jpg', impactGoal: 'Build 10 sustainable classrooms', location: 'Zanzibar, Tanzania', category: 'Education', country: 'Tanzania', status: 'Active', fundingType: 'Donation', fundedPercent: 68, contributors: 128, phase: 'Phase 1', href: '#', }, { id: 2, title: 'Kayamandi Health Hub', imageUrl: '/portfolio/kayamandi.jpg', impactGoal: 'Provide care to 500 families', location: 'Stellenbosch, South Africa', category: 'Health', country: 'South Africa', status: 'Funded', fundingType: 'Investment', fundedPercent: 100, contributors: 302, phase: 'Phase 2', href: '#', }, { id: 3, title: 'Southern Cape Solar', imageUrl: '/portfolio/southern.jpg', impactGoal: 'Power 200 homes with clean energy', location: 'Southern Cape, South Africa', category: 'Climate', country: 'South Africa', status: 'Active', fundingType: 'Investment', fundedPercent: 54, contributors: 91, phase: 'Phase 3', href: '#', }, { id: 4, title: 'Township WiFi Project', imageUrl: '/portfolio/township.jpg', impactGoal: 'Free internet for 1,000 students', location: 'Johannesburg, South Africa', category: 'Infrastructure', country: 'South Africa', status: 'Active', fundingType: 'Pay-it-Forward', fundedPercent: 32, contributors: 45, phase: 'Phase 2', href: '#', }, { id: 5, title: 'Durban Climate Garden', imageUrl: '/portfolio/durban.jpg', impactGoal: 'Grow 5 community food forests', location: 'Durban, South Africa', category: 'Climate', country: 'South Africa', status: 'Funded', fundingType: 'Donation', fundedPercent: 100, contributors: 212, phase: 'Phase 3', href: '#', }, { id: 6, title: 'Rio Digital Youth Labs', imageUrl: '/portfolio/rio.jpg', impactGoal: 'Train 1,000 young coders', location: 'Rio de Janeiro, Brazil', category: 'Education', country: 'Brazil', status: 'Active', fundingType: 'Pay-it-Forward', fundedPercent: 45, contributors: 89, phase: 'Phase 1', href: '#', }, ] export default function ProjectCard() { const [filtersState, setFiltersState] = useState({ category: 'All', country: 'All', status: 'All', funding: 'All', }) const handleFilterChange = (type: string, value: string) => { setFiltersState(prev => ({ ...prev, [type]: value })) } const filteredProjects = projects.filter(project => { return ( (filtersState.category === 'All' || project.category === filtersState.category) && (filtersState.country === 'All' || project.country === filtersState.country) && (filtersState.status === 'All' || project.status === filtersState.status) && (filtersState.funding === 'All' || project.fundingType === filtersState.funding) ) }) return (
Back causes that shape a better future.
{project.location}