import React from 'react'; import { motion } from 'framer-motion'; import { TrendingUp, Zap, Clock, DollarSign, Target } from 'lucide-react'; import BadgePill from './BadgePill'; export interface Opportunity { rank: number; skill: string; volume: number; currentMetric: string; currentValue: number; benchmarkValue: number; potentialSavings: number; difficulty: 'low' | 'medium' | 'high'; timeline: string; actions: string[]; } interface TopOpportunitiesCardProps { opportunities: Opportunity[]; } const getDifficultyColor = (difficulty: string): string => { switch (difficulty) { case 'low': return 'bg-green-100 text-green-700'; case 'medium': return 'bg-amber-100 text-amber-700'; case 'high': return 'bg-red-100 text-red-700'; default: return 'bg-gray-100 text-gray-700'; } }; const getDifficultyLabel = (difficulty: string): string => { switch (difficulty) { case 'low': return '🟢 Baja'; case 'medium': return '🟡 Media'; case 'high': return '🔴 Alta'; default: return 'Desconocida'; } }; export const TopOpportunitiesCard: React.FC = ({ opportunities }) => { if (!opportunities || opportunities.length === 0) { return null; } return (

Top Oportunidades de Mejora

Ordenadas por ROI
{opportunities.map((opp, index) => ( {/* Header with Rank */}
{opp.rank}

{opp.skill}

Volumen: {opp.volume.toLocaleString()} calls/mes

{/* Metrics Analysis */}

Estado Actual

{opp.currentValue}{opp.currentMetric.includes('AHT') ? 's' : '%'}

Benchmark P50

{opp.benchmarkValue}{opp.currentMetric.includes('AHT') ? 's' : '%'}

Brecha

{Math.abs(opp.currentValue - opp.benchmarkValue)}{opp.currentMetric.includes('AHT') ? 's' : '%'}

{/* Impact Calculation */}

Ahorro Potencial Anual

€{(opp.potentialSavings / 1000).toFixed(1)}K

Si mejoras al benchmark P50

Timeline Estimado

{opp.timeline}

Dificultad:{' '} {getDifficultyLabel(opp.difficulty)}

{/* Recommended Actions */}

Acciones Recomendadas:

    {opp.actions.map((action, idx) => (
  • {action}
  • ))}
{/* CTA Button */} Explorar Detalles de Implementación ))}
{/* Summary Footer */}

ROI Total Combinado:{' '} €{opportunities.reduce((sum, opp) => sum + opp.potentialSavings, 0) / 1000000 > 0 ? (opportunities.reduce((sum, opp) => sum + opp.potentialSavings, 0) / 1000).toFixed(0) : '0'}K/año {' '} | Tiempo promedio implementación:{' '} {Math.round(opportunities.reduce((sum, opp) => { const months = parseInt(opp.timeline) || 2; return sum + months; }, 0) / opportunities.length)} meses

); }; export default TopOpportunitiesCard;