import React, { useState } from 'react'; function Challenges() { const [completedChallenges, setCompletedChallenges] = useState([]); const challenges = [ { id: 1, title: "🚲 Bike Week Challenge", description: "Use bike or walk for transportation for 7 days", difficulty: "Medium", points: 150, co2Savings: 14.7 }, { id: 2, title: "🌱 Plant-Based Week", description: "Eat only plant-based meals for 7 consecutive days", difficulty: "Hard", points: 200, co2Savings: 23.1 }, { id: 3, title: "💡 Energy Saver Challenge", description: "Reduce home energy consumption by 25% for one month", difficulty: "Medium", points: 300, co2Savings: 45.2 } ]; const startChallenge = (challengeId) => { alert(`Challenge ${challengeId} started! Track your progress in the app.`); }; const getDifficultyColor = (difficulty) => { switch (difficulty) { case 'Easy': return '#4CAF50'; case 'Medium': return '#FF9800'; case 'Hard': return '#f44336'; default: return '#666'; } }; return (
Take on challenges to reduce your environmental impact and earn points!
Total challenge points
kg CO₂ prevented
challenges finished
{challenge.description}