import React, { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { AnalysisData, Kpi } from '../types'; import { TIERS } from '../constants'; import { ArrowLeft, BarChart2, Lightbulb, Target } from 'lucide-react'; import DashboardNavigation from './DashboardNavigation'; import HealthScoreGaugeEnhanced from './HealthScoreGaugeEnhanced'; import DimensionCard from './DimensionCard'; import HeatmapEnhanced from './HeatmapEnhanced'; import OpportunityMatrixEnhanced from './OpportunityMatrixEnhanced'; import Roadmap from './Roadmap'; import EconomicModelEnhanced from './EconomicModelEnhanced'; import BenchmarkReport from './BenchmarkReport'; interface DashboardEnhancedProps { analysisData: AnalysisData; onBack: () => void; } const KpiCard: React.FC = ({ label, value, change, changeType, index }) => { const changeColor = changeType === 'positive' ? 'bg-green-100 text-green-700' : changeType === 'negative' ? 'bg-red-100 text-red-700' : 'bg-slate-100 text-slate-700'; return (

{label}

{value}

{change && ( {change} )}
); }; const DashboardEnhanced: React.FC = ({ analysisData, onBack }) => { const tierInfo = TIERS[analysisData.tier]; const [activeSection, setActiveSection] = useState('overview'); // Observe sections for active state useEffect(() => { const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { setActiveSection(entry.target.id); } }); }, { threshold: 0.3 } ); const sections = ['overview', 'dimensions', 'heatmap', 'opportunities', 'roadmap', 'economics', 'benchmark']; sections.forEach((id) => { const element = document.getElementById(id); if (element) observer.observe(element); }); return () => observer.disconnect(); }, []); const handleExport = () => { // Placeholder for export functionality alert('Funcionalidad de exportación próximamente...'); }; const handleShare = () => { // Placeholder for share functionality alert('Funcionalidad de compartir próximamente...'); }; return (
{/* Navigation */}
{/* Left Sidebar (Fixed) */} {/* Main Content Area (Scrollable) */}
{/* Overview Section */}

Resumen Ejecutivo

{analysisData.summaryKpis.map((kpi, index) => ( ))}
{/* Dimensional Analysis */}

Análisis Dimensional

{analysisData.dimensions.map((dim, index) => ( ))}
{/* Strategic Visualizations */}
); }; export default DashboardEnhanced;