/**
 * @flow
 */

import React from 'react';
import Entypo from 'react-native-vector-icons/Entypo';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
import Ionicons from 'react-native-vector-icons/Ionicons';
import Octicons from 'react-native-vector-icons/Octicons';
import Zocial from 'react-native-vector-icons/Zocial';
import EvilIcons from 'react-native-vector-icons/EvilIcons';
import Foundation from 'react-native-vector-icons/Foundation';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';

const mapping = {
  Entypo,
  FontAwesome,
  Ionicons,
  Octicons,
  Zocial,
  EvilIcons,
  Foundation,
  MaterialIcons,
};

type SuiteType = 'Entypo'
  | 'FontAwesome'
  | 'Ionicons'
  | 'Octicons'
  | 'Zocial'
  | 'EvilIcons'
  | 'Foundation'
  | 'MaterialIcons';


export type IconType = {
  suite: SuiteType,
  name: string,
  color?: string,
  size?: number,
}

export default function BasicIcon(props: IconType) {
  const { suite, ...extraProps } = {
    color: 'white',
    size: 30,
    ...props,
  }
  const VectorIcon = mapping[suite]
  return <VectorIcon {...extraProps} />;
}
