import React, {memo} from 'react';
import {View, ViewStyle, StyleProp} from 'react-native';
import NormalForm from '@assets/normalForm.svg';
import PdfForm from '@assets/pdfForm.svg';
// TODO: Migrate this icon
import Survey from '@assets/oldSurvey.svg';
import {StepType} from '@interfaces/questions';
import {FormType} from '@modules/form/interfaces';

import {styles, ICON_SIZE} from './styles';

interface Props {
  type: FormType;
  stepsType: StepType;
  iconSize?: number;
  style?: StyleProp<ViewStyle>;
}

function FormIcon({type, stepsType, iconSize = ICON_SIZE, style}: Props) {
  return type === FormType.FORM ? (
    <View style={style}>
      {stepsType === StepType.FILE ? (
        <PdfForm height={iconSize} width={iconSize} />
      ) : (
        <NormalForm height={iconSize} width={iconSize} />
      )}
    </View>
  ) : (
    <View style={styles.container}>
      <Survey height={iconSize} width={iconSize} />
    </View>
  );
}

export default memo(FormIcon);
