"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "Path", {
  enumerable: true,
  get: function () {
    return _reactNativeSvg.Path;
  }
});
Object.defineProperty(exports, "createIcon", {
  enumerable: true,
  get: function () {
    return _createIcon.createIcon;
  }
});
exports.default = void 0;

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

var _reactNative = require("react-native");

var _styledSystem = require("styled-system");

var _theme = require("../../../theme");

var _native = _interopRequireDefault(require("styled-components/native"));

var _AntDesign = _interopRequireDefault(require("react-native-vector-icons/AntDesign"));

var _Entypo = _interopRequireDefault(require("react-native-vector-icons/Entypo"));

var _EvilIcons = _interopRequireDefault(require("react-native-vector-icons/EvilIcons"));

var _Feather = _interopRequireDefault(require("react-native-vector-icons/Feather"));

var _FontAwesome = _interopRequireDefault(require("react-native-vector-icons/FontAwesome"));

var _FontAwesome2 = _interopRequireDefault(require("react-native-vector-icons/FontAwesome5"));

var _Foundation = _interopRequireDefault(require("react-native-vector-icons/Foundation"));

var _Ionicons = _interopRequireDefault(require("react-native-vector-icons/Ionicons"));

var _MaterialCommunityIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialCommunityIcons"));

var _MaterialIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialIcons"));

var _Octicons = _interopRequireDefault(require("react-native-vector-icons/Octicons"));

var _SimpleLineIcons = _interopRequireDefault(require("react-native-vector-icons/SimpleLineIcons"));

var _Zocial = _interopRequireDefault(require("react-native-vector-icons/Zocial"));

var _SVGIcon = require("./SVGIcon");

var _reactNativeSvg = require("react-native-svg");

var _createIcon = require("./createIcon");

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

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

const Icon = iconProps => {
  const {
    name,
    type,
    size,
    style,
    ...props
  } = iconProps;
  const newProps = (0, _theme.usePropsConfig)('Icon', {
    size
  });

  if (!name) {
    return /*#__PURE__*/_react.default.createElement(_SVGIcon.SVGIcon, iconProps);
  }

  const flattenedIconStyle = _reactNative.StyleSheet.flatten([{
    fontSize: parseInt(newProps.dimension || newProps.size, 10)
  }, style]);

  switch (type) {
    case 'AntDesign':
      return /*#__PURE__*/_react.default.createElement(_AntDesign.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'Entypo':
      return /*#__PURE__*/_react.default.createElement(_Entypo.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'EvilIcons':
      return /*#__PURE__*/_react.default.createElement(_EvilIcons.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'Feather':
      return /*#__PURE__*/_react.default.createElement(_Feather.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'FontAwesome':
      return /*#__PURE__*/_react.default.createElement(_FontAwesome.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'FontAwesome5':
      return /*#__PURE__*/_react.default.createElement(_FontAwesome2.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'Foundation':
      return /*#__PURE__*/_react.default.createElement(_Foundation.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'Ionicons':
      return /*#__PURE__*/_react.default.createElement(_Ionicons.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'MaterialCommunityIcons':
      return /*#__PURE__*/_react.default.createElement(_MaterialCommunityIcons.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'Octicons':
      return /*#__PURE__*/_react.default.createElement(_Octicons.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'SimpleLineIcons':
      return /*#__PURE__*/_react.default.createElement(_SimpleLineIcons.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    case 'Zocial':
      return /*#__PURE__*/_react.default.createElement(_Zocial.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));

    default:
      return /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, _extends({
        name: name,
        style: flattenedIconStyle
      }, props));
  }
};

const styledIcon = (0, _native.default)(Icon)(_styledSystem.color, _styledSystem.space, _styledSystem.typography);
var _default = styledIcon;
exports.default = _default;
//# sourceMappingURL=index.js.map