import {
  IconAward,
  IconBriefcase,
  IconBriefcase2,
  IconBuildingCommunity,
  IconBus,
  IconCalendar,
  IconCash,
  IconCircles,
  IconDeviceDesktop,
  IconFileText,
  IconFirstAidKit,
  IconHanger,
  IconHeadset,
  IconHeart,
  IconHelp,
  IconHome,
  IconIdBadge2,
  IconInfoCircle,
  IconLock,
  IconMessages,
  IconMinus,
  IconPackage,
  IconPlant2,
  IconPremiumRights,
  IconReload,
  IconShoppingBag,
  IconShoppingCart,
  IconStopwatch,
  IconTool,
  IconUsers,
  IconWifi,
  IconWorld,
} from '@material-hu/icons/tabler';

import {
  BannerColor,
  CategoryIcon,
} from 'src/pages/dashboard/serviceManagement/types';

export const DETAIL_HEADER_HEIGHT = '91px';
export const DETAIL_INFORMATION_HEIGHT = '94px';

export const ALL_CATEGORIES_ICON = IconCircles;
export const DEFAULT_CATEGORY_ICON = IconMinus;

export const CATEGORY_ICONS = {
  [CategoryIcon.PAYMENTS]: {
    Icon: IconCash,
  },
  [CategoryIcon.TIMER]: {
    Icon: IconStopwatch,
  },
  [CategoryIcon.CHECKROOM]: {
    Icon: IconHanger,
  },
  [CategoryIcon.BADGE]: {
    Icon: IconIdBadge2,
  },
  [CategoryIcon.WORK]: {
    Icon: IconBriefcase2,
  },
  [CategoryIcon.HELP]: {
    Icon: IconHelp,
  },
  [CategoryIcon.FORUM]: {
    Icon: IconMessages,
  },
  [CategoryIcon.BUSSINESS]: {
    Icon: IconBriefcase,
  },
  [CategoryIcon.SHOPPING]: {
    Icon: IconShoppingBag,
  },
  [CategoryIcon.GROUP]: {
    Icon: IconUsers,
  },
  [CategoryIcon.DESCRIPTION]: {
    Icon: IconFileText,
  },
  [CategoryIcon.HEALTH]: {
    Icon: IconFirstAidKit,
  },
  [CategoryIcon.SPA]: {
    Icon: IconPlant2,
  },
  [CategoryIcon.GLOBAL]: {
    Icon: IconWorld,
  },
  [CategoryIcon.PREMIUM]: {
    Icon: IconAward,
  },
  [CategoryIcon.COMMUTE]: {
    Icon: IconBuildingCommunity,
  },
  [CategoryIcon.HARDWARE]: {
    Icon: IconTool,
  },
  [CategoryIcon.COMPUTER]: {
    Icon: IconDeviceDesktop,
  },
  [CategoryIcon.HOME]: {
    Icon: IconHome,
  },
  [CategoryIcon.MONEY]: {
    Icon: IconPremiumRights,
  },
  [CategoryIcon.BUS]: {
    Icon: IconBus,
  },
  [CategoryIcon.UPDATE]: {
    Icon: IconReload,
  },
  [CategoryIcon.GROCERY]: {
    Icon: IconShoppingCart,
  },
  [CategoryIcon.CALENDAR]: {
    Icon: IconCalendar,
  },
  [CategoryIcon.HEART]: {
    Icon: IconHeart,
  },
  [CategoryIcon.LOCK]: {
    Icon: IconLock,
  },
  [CategoryIcon.WIFI]: {
    Icon: IconWifi,
  },
  [CategoryIcon.SUPPORT]: {
    Icon: IconHeadset,
  },
  [CategoryIcon.INFO]: {
    Icon: IconInfoCircle,
  },
  [CategoryIcon.REPAIR]: {
    Icon: IconPackage,
  },
};

export const COLORS = {
  [BannerColor.BLUE]: {
    value: '#2574C6',
    gradient: {
      from: '#5197DC',
      to: '#1976D2',
    },
    button: '#5197DC',
  },
  [BannerColor.PURPLE]: {
    value: '#3D27C7',
    gradient: {
      from: '#6060DC',
      to: '#3215C0',
    },
    button: '#6060DC',
  },
  [BannerColor.VIOLET]: {
    value: '#A615C0',
    gradient: {
      from: '#B360DC',
      to: '#A615C0',
    },
    button: '#B360DC',
  },
  [BannerColor.PINK]: {
    value: '#CA2E76',
    gradient: {
      from: '#DC60BF',
      to: '#C01551',
    },
    button: '#DC60BF',
  },
  [BannerColor.RED]: {
    value: '#C01551',
    gradient: {
      from: '#F55C5C',
      to: '#C01515',
    },
    button: '#F55C5C',
  },
  [BannerColor.ORANGE]: {
    value: '#CD8127',
    gradient: {
      from: '#F5B35C',
      to: '#C07015',
    },
    button: '#ab7b3c',
  },
  [BannerColor.YELLOW]: {
    value: '#C5C226',
    gradient: {
      from: '#BBB24C',
      to: '#C9C914',
    },
    button: '#918a39',
  },
  [BannerColor.GREEN]: {
    value: '#54AD2F',
    gradient: {
      from: '#80BB4C',
      to: '#41A722',
    },
    button: '#80BB4C',
  },
  [BannerColor.AQUA]: {
    value: '#2EAD7E',
    gradient: {
      from: '#4CBB9E',
      to: '#22A772',
    },
    button: '#4CBB9E',
  },
  [BannerColor.GREY]: {
    value: '#727674',
    gradient: {
      from: '#8F9090',
      to: '#676B6A',
    },
    button: '#8F9090',
  },
};

export const fileFormats = [
  'png',
  'gif',
  'jpeg',
  'webp',
  'pdf',
  'doc',
  'ppt',
  'xls',
  'csv',
  'xlsx',
  'docx',
  'pptx',
  'ppsx',
  'xlsm',
  'ppsm',
  'xml',
  /* TODO: not supported for the time being - This will be uncommented when we support these file types
  'avi',
  'mpeg',
  'webm',
  'mp4',
  'mov', */
];

export const ATTACHMENTS_MAX_SIZE = 104_857_600; // 100MB

export const WORKFLOWS_ALLOWED_FILE_TYPES = {
  'image/png': [],
  'image/gif': [],
  'image/jpeg': [],
  'image/webp': [],
  'application/pdf': [],
  'application/msword': [],
  'application/vnd.ms-powerpoint': [],
  'application/vnd.ms-excel': [],
  'text/csv': [],
  'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': [],
  'application/vnd.openxmlformats-officedocument.wordprocessingml.document': [],
  'application/vnd.openxmlformats-officedocument.presentationml.presentation':
    [],
  'application/vnd.openxmlformats-officedocument.presentationml.slideshow': [
    '.ppsx',
  ],
  'application/vnd.ms-excel.sheet.macroEnabled.12': ['.xlsm'],
  'application/vnd.ms-powerpoint.slideshow.macroenabled.12': ['.ppsm'],
  // Compressed file types
  'application/zip': ['.zip'],
  'application/x-rar-compressed': ['.rar'],
  'application/x-7z-compressed': ['.7z'],
  'application/x-tar': ['.tar'],
  'application/gzip': ['.gz'],
  'application/x-bzip2': ['.bz2'],
  'application/x-xz': ['.xz'],
  // Video
  'video/x-msvideo': [],
  'video/mpeg': [],
  'video/webm': [],
  'video/mp4': [],
  'video/quicktime': [],
  'application/xml': ['.xml'],
};
