import React from 'react';
import PropTypes from 'prop-types';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
/* eslint-disable */

import * as iconsSolid from '@fortawesome/fontawesome-free-solid';
import * as iconsBrands from '@fortawesome/fontawesome-free-brands';
/* eslint-enable */

Icon.propTypes = {
  name: PropTypes.string.isRequired,
  size: PropTypes.oneOf(['1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
  spin: PropTypes.bool,
  pulse: PropTypes.bool,
  border: PropTypes.bool,
  flip: PropTypes.oneOf(['horizontal', 'vertical', 'both']),
  color: PropTypes.string
};
Icon.defaultProps = {
  spin: false,
  size: null,
  pulse: false,
  border: false,
  flip: null,
  color: null
};

function Icon(props) {
  return React.createElement(FontAwesomeIcon, {
    icon: props.name,
    spin: props.spin,
    pulse: props.pulse,
    border: props.border,
    flip: props.flip,
    size: props.size,
    color: props.color
  });
}

export default Icon;