import React, { useState } from 'react'; import { Leaf, Wind, Droplets, Factory, Info, ExternalLink, CheckCircle2, Loader2 } from 'lucide-react'; import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from 'recharts'; /* Fix: react-router-dom exports may be flaky in this environment, using standard v6 imports */ import { useNavigate } from 'react-router-dom'; const MOCK_DATA = [ { name: 'Data Centers', value: 45, color: '#3b82f6' }, { name: 'Supply Chain', value: 25, color: '#10b981' }, { name: 'Office Logistics', value: 15, color: '#8b5cf6' }, { name: 'Business Travel', value: 15, color: '#f59e0b' }, ]; const Sustainability: React.FC = () => { const [buying, setBuying] = useState(false); const isInitiallyNeutral = localStorage.getItem('esg_neutral') === 'true'; const [success, setSuccess] = useState(isInitiallyNeutral); const navigate = useNavigate(); const handleBuyCredits = () => { setBuying(true); setTimeout(() => { setBuying(false); setSuccess(true); localStorage.setItem('esg_neutral', 'true'); window.dispatchEvent(new Event('esg-update')); }, 2000); }; return (
Aggregate Carbon Intensity
Net Zero Achieved
}Quantum audit of environmental externalities
{/* Explicit container fix for Recharts dimension warning */}ESG Rating
{success ? 'AAA' : 'AA-'}
{success ? "Your corporate ledger is now verified Carbon Neutral. 25 Carbon Credits have been successfully retired. Certificate #QC-8841-B is available in your Audit Report." : "Quantum analysis identifies 1,242Kg of unmitigated emissions. Purchase 25 verified credits to achieve neutrality."}