"use strict";

var __assign = void 0 && (void 0).__assign || function () {
  __assign = Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];

      for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
    }

    return t;
  };

  return __assign.apply(this, arguments);
};

var __rest = void 0 && (void 0).__rest || function (s, e) {
  var t = {};

  for (var p in s) {
    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  }

  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  }
  return t;
};

var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
  return mod && mod.__esModule ? mod : {
    "default": mod
  };
};

Object.defineProperty(exports, "__esModule", {
  value: true
});

var jsx_runtime_1 = require("react/jsx-runtime");

var icon_render_1 = __importDefault(require("./icon-render"));

var context_1 = require("../style/context");

var style_1 = require("../style"); // /**
//  *
//  * @param Icons
//  */


var createIcon = function createIcon(Icons) {
  return function (props) {
    var theme = style_1.getTheme();

    if (Array.isArray(Icons)) {
      var Icon_1;

      switch (theme) {
        case context_1.ThemeEnum.dark:
          Icon_1 = Icons[0];
          break;

        case context_1.ThemeEnum.light:
          Icon_1 = Icons[1];
          break;

        default:
          Icon_1 = Icons[0];
          break;
      }

      return jsx_runtime_1.jsx(icon_render_1["default"], __assign({}, props, {
        children: function children(_a) {
          var color = _a.color,
              size = _a.size,
              others = __rest(_a, ["color", "size"]);

          return jsx_runtime_1.jsx(Icon_1, __assign({
            color: color,
            width: size,
            height: size
          }, others), void 0);
        }
      }), void 0);
    }

    var Icon = Icons;
    return jsx_runtime_1.jsx(icon_render_1["default"], __assign({}, props, {
      children: function children(_a) {
        var color = _a.color,
            size = _a.size,
            others = __rest(_a, ["color", "size"]);

        return jsx_runtime_1.jsx(Icon, __assign({
          color: color,
          width: size,
          height: size
        }, others), void 0);
      }
    }), void 0);
  };
};

exports["default"] = createIcon;

