/**
 * KPI 카드 UI 매핑 (아이콘 + 색상)
 *
 * Dashboard와 MonitoringDashboard에서 중복 정의되던 KPI_UI_MAP 통합.
 * 한글 라벨 / 영문 kpiKey 모두 지원.
 */

import type { LucideIcon } from 'lucide-react';
import { Radar, AlertTriangle, Eye, Anchor, Crosshair, Shield, Target } from 'lucide-react';

export interface KpiUi {
  icon: LucideIcon;
  color: string;
}

export const KPI_UI_MAP: Record<string, KpiUi> = {
  // 한글 라벨 (DB prediction_kpi.kpi_label)
  '실시간 탐지': { icon: Radar, color: '#3b82f6' },
  'EEZ 침범': { icon: AlertTriangle, color: '#ef4444' },
  '다크베셀': { icon: Eye, color: '#f97316' },
  '불법환적 의심': { icon: Anchor, color: '#a855f7' },
  '추적 중': { icon: Crosshair, color: '#06b6d4' },
  '나포/검문': { icon: Shield, color: '#10b981' },
  // 영문 kpi_key (백엔드 코드)
  realtime_detection: { icon: Radar, color: '#3b82f6' },
  eez_violation: { icon: AlertTriangle, color: '#ef4444' },
  dark_vessel: { icon: Eye, color: '#f97316' },
  illegal_transshipment: { icon: Anchor, color: '#a855f7' },
  illegal_transship: { icon: Anchor, color: '#a855f7' },
  tracking: { icon: Target, color: '#06b6d4' },
  tracking_active: { icon: Target, color: '#06b6d4' },
  enforcement: { icon: Shield, color: '#10b981' },
  captured_inspected: { icon: Shield, color: '#10b981' },
};

export function getKpiUi(key: string): KpiUi {
  return KPI_UI_MAP[key] ?? { icon: Radar, color: '#3b82f6' };
}
