import React, { Fragment } from 'react';
import Entypo from 'react-native-vector-icons/Entypo';
import AntDesign from 'react-native-vector-icons/AntDesign';
import EvilIcons from 'react-native-vector-icons/EvilIcons'
import Feather from 'react-native-vector-icons/Feather'
import FontAwesome from 'react-native-vector-icons/FontAwesome'
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5'
import Foundation from 'react-native-vector-icons/Foundation'
import Ionicons from 'react-native-vector-icons/Ionicons';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
import Octicons from 'react-native-vector-icons/Octicons'
import SimpleLineIcons from 'react-native-vector-icons/SimpleLineIcons'
import Zocial from 'react-native-vector-icons/Zocial'

const Icon = ({style={}, iconFamily = 'Entypo', iconName, color = "white", size = 30 }) => {
    return (
        <Fragment>
            {(() => {
                if(iconFamily=='Entypo') { return <Entypo style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='AntDesign') { return <AntDesign style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='EvilIcons') { return <EvilIcons style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='Feather') { return <Feather style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='FontAwesome') { return <FontAwesome style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='FontAwesome5') { return <FontAwesome5 style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='Foundation') { return <Foundation style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='Ionicons') { return <Ionicons style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='MaterialCommunityIcons') { return <MaterialCommunityIcons style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='Octicons') { return <Octicons style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='SimpleLineIcons') { return <SimpleLineIcons style={style} name={`${iconName}`} color={color} size={size} /> }
                else if(iconFamily=='Zocial') { return <Zocial style={style} name={`${iconName}`} color={color} size={size} /> }
            })()}
        </Fragment>
    );
};

export default Icon;
