export enum PUSH_STATUS {
  NOT_PUSH = 0,
  PUSHED,
}
export const PUSH_STATUS_MAP = {
  [PUSH_STATUS.NOT_PUSH]: '否',
  [PUSH_STATUS.PUSHED]: '是',
};

/**
 * 灾害防范字典
 */
// 气象灾害图标
import typhoonBlue from './images/weather-disaster/typhoon-blue-alert.png';
import typhoonYellow from './images/weather-disaster/typhoon-yellow-alert.png';
import typhoonOrange from './images/weather-disaster/typhoon-orange-alert.png';
import typhoonRed from './images/weather-disaster/typhoon-red-alert.png';
import rainBlue from './images/weather-disaster/rain-blue-alert.png';
import rainYellow from './images/weather-disaster/rain-yellow-alert.png';
import rainOrange from './images/weather-disaster/rain-orange-alert.png';
import rainRed from './images/weather-disaster/rain-red-alert.png';
import snowYellow from './images/weather-disaster/snow-yellow-alert.png';
import snowOrange from './images/weather-disaster/snow-orange-alert.png';
import snowRed from './images/weather-disaster/snow-red-alert.png';
import coldBlue from './images/weather-disaster/cold-blue-alert.png';
import coldYellow from './images/weather-disaster/cold-yellow-alert.png';
import coldOrange from './images/weather-disaster/cold-orange-alert.png';
import coldRed from './images/weather-disaster/cold-red-alert.png';
import galeBlue from './images/weather-disaster/gale-blue-alert.png';
import galeYellow from './images/weather-disaster/gale-yellow-alert.png';
import galeOrange from './images/weather-disaster/gale-orange-alert.png';
import galeRed from './images/weather-disaster/gale-red-alert.png';
import sandstormYellow from './images/weather-disaster/sandstorm-yellow-alert.png';
import sandstormOrange from './images/weather-disaster/sandstorm-orange-alert.png';
import sandstormRed from './images/weather-disaster/sandstorm-red-alert.png';
import heatwaveYellow from './images/weather-disaster/heatwave-yellow-alert.png';
import heatwaveOrange from './images/weather-disaster/heatwave-orange-alert.png';
import heatwaveRed from './images/weather-disaster/heatwave-red-alert.png';
import droughtOrange from './images/weather-disaster/drought-orange-alert.png';
import droughtRed from './images/weather-disaster/drought-red-alert.png';
import lightningYellow from './images/weather-disaster/lightning-yellow-alert.png';
import lightningOrange from './images/weather-disaster/lightning-orange-alert.png';
import lightningRed from './images/weather-disaster/lightning-red-alert.png';
import hailOrange from './images/weather-disaster/hail-orange-alert.png';
import hailRed from './images/weather-disaster/hail-red-alert.png';
import frostBlue from './images/weather-disaster/frost-blue-alert.png';
import frostYellow from './images/weather-disaster/frost-yellow-alert.png';
import frostOrange from './images/weather-disaster/frost-orange-alert.png';
import fogYellow from './images/weather-disaster/fog-yellow-alert.png';
import fogOrange from './images/weather-disaster/fog-orange-alert.png';
import fogRed from './images/weather-disaster/fog-red-alert.png';
import iceYellow from './images/weather-disaster/ice-yellow-alert.png';
import iceOrange from './images/weather-disaster/ice-orange-alert.png';
import iceRed from './images/weather-disaster/ice-red-alert.png';
import hazeYellow from './images/weather-disaster/haze-yellow-alert.png';
import hazeOrange from './images/weather-disaster/haze-orange-alert.png';
import hazeRed from './images/weather-disaster/haze-red-alert.png';
import thunderBlue from './images/weather-disaster/thunder-blue-alert.png';
import thunderYellow from './images/weather-disaster/thunder-yellow-alert.png';
import thunderOrange from './images/weather-disaster/thunder-orange-alert.png';
import thunderRed from './images/weather-disaster/thunder-red-alert.png';
import pollutionBlue from './images/weather-disaster/pollution-blue-alert.png';
import pollutionYellow from './images/weather-disaster/pollution-yellow-alert.png';
import pollutionOrange from './images/weather-disaster/pollution-orange-alert.png';
import pollutionRed from './images/weather-disaster/pollution-red-alert.png';
// 颜色类型定义
type AlertLevel = 'blue' | 'yellow' | 'orange' | 'red';

// 图标类型定义
type IconMap = {
  [key in AlertLevel]?: string;
};

// 颜色中文映射
const colorMap: Record<AlertLevel, string> = {
  blue: '蓝色',
  yellow: '黄色',
  orange: '橙色',
  red: '红色',
};

// 灾害类型定义
interface DisasterType {
  name: string;
  levels: AlertLevel[];
  icons: IconMap;
}

// 灾害类型和颜色映射
const disasterTypes: Record<string, DisasterType> = {
  typhoon: {
    name: '台风',
    levels: ['blue', 'yellow', 'orange', 'red'] as AlertLevel[],
    icons: { blue: typhoonBlue, yellow: typhoonYellow, orange: typhoonOrange, red: typhoonRed },
  },
  rain: {
    name: '暴雨',
    levels: ['blue', 'yellow', 'orange', 'red'] as AlertLevel[],
    icons: { blue: rainBlue, yellow: rainYellow, orange: rainOrange, red: rainRed },
  },
  snow: {
    name: '暴雪',
    levels: ['yellow', 'orange', 'red'] as AlertLevel[],
    icons: { yellow: snowYellow, orange: snowOrange, red: snowRed },
  },
  cold: {
    name: '寒潮',
    levels: ['blue', 'yellow', 'orange', 'red'] as AlertLevel[],
    icons: { blue: coldBlue, yellow: coldYellow, orange: coldOrange, red: coldRed },
  },
  gale: {
    name: '大风',
    levels: ['blue', 'yellow', 'orange', 'red'] as AlertLevel[],
    icons: { blue: galeBlue, yellow: galeYellow, orange: galeOrange, red: galeRed },
  },
  sandstorm: {
    name: '沙尘暴',
    levels: ['yellow', 'orange', 'red'] as AlertLevel[],
    icons: { yellow: sandstormYellow, orange: sandstormOrange, red: sandstormRed },
  },
  heatwave: {
    name: '高温',
    levels: ['yellow', 'orange', 'red'] as AlertLevel[],
    icons: { yellow: heatwaveYellow, orange: heatwaveOrange, red: heatwaveRed },
  },
  drought: {
    name: '干旱',
    levels: ['orange', 'red'] as AlertLevel[],
    icons: { orange: droughtOrange, red: droughtRed },
  },
  lightning: {
    name: '雷电',
    levels: ['yellow', 'orange', 'red'] as AlertLevel[],
    icons: { yellow: lightningYellow, orange: lightningOrange, red: lightningRed },
  },
  hail: {
    name: '冰雹',
    levels: ['orange', 'red'] as AlertLevel[],
    icons: { orange: hailOrange, red: hailRed },
  },
  frost: {
    name: '霜冻',
    levels: ['blue', 'yellow', 'orange'] as AlertLevel[],
    icons: { blue: frostBlue, yellow: frostYellow, orange: frostOrange },
  },
  fog: {
    name: '大雾',
    levels: ['yellow', 'orange', 'red'] as AlertLevel[],
    icons: { yellow: fogYellow, orange: fogOrange, red: fogRed },
  },
  ice: {
    name: '道路结冰',
    levels: ['yellow', 'orange', 'red'] as AlertLevel[],
    icons: { yellow: iceYellow, orange: iceOrange, red: iceRed },
  },
  haze: {
    name: '霾',
    levels: ['yellow', 'orange', 'red'] as AlertLevel[],
    icons: { yellow: hazeYellow, orange: hazeOrange, red: hazeRed },
  },
  thunder: {
    name: '雷雨大风',
    levels: ['blue', 'yellow', 'orange', 'red'] as AlertLevel[],
    icons: { blue: thunderBlue, yellow: thunderYellow, orange: thunderOrange, red: thunderRed },
  },
  pollution: {
    name: '重污染天气',
    levels: ['blue', 'yellow', 'orange', 'red'] as AlertLevel[],
    icons: { blue: pollutionBlue, yellow: pollutionYellow, orange: pollutionOrange, red: pollutionRed },
  },
};

// 气象灾害预警类型
export const WEATHER_DISASTER_ALERT_TYPE = Object.entries(disasterTypes).flatMap(([_, disaster]) =>
  disaster.levels.map((level) => {
    const alertText = `${disaster.name}${colorMap[level]}预警`;
    return {
      label: alertText,
      value: alertText,
      icon: disaster.icons[level],
    };
  }),
);
