import React from 'react';
import PropTypes from 'prop-types';
import { componentWithName } from 'airbnb-prop-types';

var IconLink = function IconLink(props) {
  return React.createElement(
    'span',
    { className: props.wrapperClasses.join(' ') },
    props.icon && props.icon.props.name && React.createElement(
      React.Fragment,
      null,
      props.icon,
      ' \xA0'
    ),
    props.link
  );
};

IconLink.propTypes = process.env.NODE_ENV !== "production" ? {
  icon: componentWithName('Icon'),
  link: componentWithName('Link'),
  wrapperClasses: PropTypes.arrayOf(PropTypes.string)
} : {};

IconLink.defaultProps = {
  wrapperClasses: []
};

export default IconLink;