import { ReactNode } from 'react';
import { DangerIcon } from '../components/icons/DangerIcon';
import { ProcessesIcon } from '../components/icons/ProcessesIcon';
import { PlansIcon } from '../components/icons/PlansIcon';
import { ServiceIcon } from '../components/icons/ServiceIcon';
import { SafetyIcon } from '../components/icons/SafetyIcon';
import { TeamworkIcon } from '../components/icons/TeamworkIcon';
import { LaboratoriesIcon } from '../components/icons/LaboratoriesIcon';
import { TeachSystemsIcon } from '../components/icons/TeachSystemsIcon';
import { ClassNameWrapper } from '../hocs/ClassNameWrapper';

export function getIcon(
  type:
    | 'danger'
    | 'processes'
    | 'plans'
    | 'service'
    | 'safety'
    | 'teamwork'
    | 'teaching'
    | 'labs',
  animated: boolean,
  className?: string,
) {
  return new Map<typeof type, ReactNode>([
    [
      'danger',
      ClassNameWrapper({ element: DangerIcon({ animated }), className }),
    ],
    [
      'processes',
      ClassNameWrapper({ element: ProcessesIcon({ animated }), className }),
    ],
    [
      'plans',
      ClassNameWrapper({ element: PlansIcon({ animated }), className }),
    ],
    [
      'service',
      ClassNameWrapper({ element: ServiceIcon({ animated }), className }),
    ],
    [
      'safety',
      ClassNameWrapper({ element: SafetyIcon({ animated }), className }),
    ],
    [
      'teamwork',
      ClassNameWrapper({ element: TeamworkIcon({ animated }), className }),
    ],
    [
      'labs',
      ClassNameWrapper({ element: LaboratoriesIcon({ animated }), className }),
    ],
    [
      'teaching',
      ClassNameWrapper({ element: TeachSystemsIcon({ animated }), className }),
    ],
  ]).get(type);
}
