import { DigestAction } from '@/src/components/icons/DigestIcon';
import { TimerGradient } from '@/src/components/icons/TimerGradient';
import { Sms } from '@/src/components/icons/Sms';
import { Mobile } from '@/src/components/icons/Mobile';
import { Chat } from '@/src/components/icons/Chat';
import { InApp } from '@/src/components/icons/InApp';
import { Mail } from '@/src/components/icons/Mail';

export enum StepTypeEnum {
  IN_APP = 'in_app',
  EMAIL = 'email',
  SMS = 'sms',
  CHAT = 'chat',
  PUSH = 'push',
  DIGEST = 'digest',
  TRIGGER = 'trigger',
  DELAY = 'delay',
}

export function NodeIcon({ channel }: { channel: StepTypeEnum }) {
  if (channel === StepTypeEnum.EMAIL) {
    return <Mail />;
  }

  if (channel === StepTypeEnum.IN_APP) {
    return <InApp />;
  }

  if (channel === StepTypeEnum.CHAT) {
    return <Chat />;
  }

  if (channel === StepTypeEnum.PUSH) {
    return <Mobile />;
  }

  if (channel === StepTypeEnum.SMS) {
    return <Sms />;
  }

  if (channel === StepTypeEnum.DELAY) {
    return <TimerGradient />;
  }

  if (channel === StepTypeEnum.DIGEST) {
    return <DigestAction data-id="digestIcon" />;
  }
}
