"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _lodash = _interopRequireDefault(require("lodash"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function Icon(_ref) {
  var type = _ref.type,
      name = _ref.name;
  var typePrefix;

  switch (_lodash.default.toLower(type)) {
    case 'simplelineicons':
    case 'icon':
    case 'sli':
      typePrefix = 'icon-';
      break;

    case 'flag':
      typePrefix = 'flag-icon-';
      break;

    case 'fontawesome':
    case 'fa':
      typePrefix = 'fa fa-';
      break;

    case 'coreui':
    case 'cui':
    default:
      typePrefix = 'cui-';
      break;
  }

  var iconClass = typePrefix + name;
  return _react.default.createElement("i", {
    className: iconClass
  });
}

var _default = Icon;
exports.default = _default;
Icon.propTypes = {
  type: _propTypes.default.string.isRequired,
  name: _propTypes.default.string.isRequired
};
Icon.defaultProps = {
  type: 'coreui'
};