import type { RiskLevel } from '../types';
import type { AnalysisStats } from '../services/vesselAnalysis';

export type AlertLevel = 'CRITICAL' | 'WATCH' | 'MONITOR' | 'NORMAL';

export const RISK_TO_ALERT: Record<RiskLevel, AlertLevel> = {
  CRITICAL: 'CRITICAL',
  HIGH: 'WATCH',
  MEDIUM: 'MONITOR',
  LOW: 'NORMAL',
};

export const ALERT_COLOR: Record<AlertLevel, string> = {
  CRITICAL: '#FF5252',
  WATCH: '#FFD740',
  MONITOR: '#18FFFF',
  NORMAL: '#00E676',
};

export const ALERT_EMOJI: Record<AlertLevel, string> = {
  CRITICAL: '🔴',
  WATCH: '🟠',
  MONITOR: '🟡',
  NORMAL: '🟢',
};

export const ALERT_LEVELS: AlertLevel[] = ['CRITICAL', 'WATCH', 'MONITOR', 'NORMAL'];

// 서버 stats 키(critical/high/medium/low) → AlertLevel 매핑
export const STATS_KEY_MAP: Record<AlertLevel, keyof Pick<AnalysisStats, 'critical' | 'high' | 'medium' | 'low'>> = {
  CRITICAL: 'critical',
  WATCH: 'high',
  MONITOR: 'medium',
  NORMAL: 'low',
};
