import { motion } from 'framer-motion';
import { ChevronRight, TrendingUp, TrendingDown, Minus } from 'lucide-react';
import type { AnalysisData, DimensionAnalysis, Finding, Recommendation } from '../../types';
interface DimensionAnalysisTabProps {
data: AnalysisData;
}
// Dimension Card Component
function DimensionCard({
dimension,
findings,
recommendations,
delay = 0
}: {
dimension: DimensionAnalysis;
findings: Finding[];
recommendations: Recommendation[];
delay?: number;
}) {
const Icon = dimension.icon;
const getScoreColor = (score: number) => {
if (score >= 80) return 'text-emerald-600 bg-emerald-100';
if (score >= 60) return 'text-amber-600 bg-amber-100';
return 'text-red-600 bg-red-100';
};
const getScoreLabel = (score: number) => {
if (score >= 80) return 'Óptimo';
if (score >= 60) return 'Aceptable';
if (score >= 40) return 'Mejorable';
return 'Crítico';
};
// Get KPI trend icon
const TrendIcon = dimension.kpi.changeType === 'positive' ? TrendingUp :
dimension.kpi.changeType === 'negative' ? TrendingDown : Minus;
const trendColor = dimension.kpi.changeType === 'positive' ? 'text-emerald-600' :
dimension.kpi.changeType === 'negative' ? 'text-red-600' : 'text-slate-500';
return (
{dimension.summary}{dimension.title}
Hallazgos Clave
{findings.slice(0, 3).map((finding, idx) => (
| KPI | Actual | Industria | Percentil |
|---|---|---|---|
| {item.kpi} | {item.userDisplay} | {item.industryDisplay} | P{item.percentile} |