"use strict";

exports.__esModule = true;
exports.default = void 0;
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _card = _interopRequireDefault(require("../../molecule/card"));
var _loader = _interopRequireDefault(require("../../atom/loader"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const CardsGrid = props => {
  const {
    list = [],
    customStyle = {},
    loading = false
  } = props;
  const loader = loading ? /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.loader
  }, /*#__PURE__*/_react.default.createElement(_loader.default, null)) : null;
  const cards = (0, _map2.default)(cardProps => {
    return /*#__PURE__*/_react.default.createElement("div", {
      "data-name": "cardGrid",
      className: _style.default.card,
      key: cardProps.key
    }, /*#__PURE__*/_react.default.createElement(_card.default, cardProps));
  }, list);
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.defaultStyle,
    style: customStyle
  }, cards, loader);
};
CardsGrid.propTypes = process.env.NODE_ENV !== "production" ? {
  // @ts-expect-error component is not typed & wrapped into memo
  list: _propTypes.default.arrayOf(_propTypes.default.shape(_card.default.propTypes)),
  customStyle: _propTypes.default.objectOf(_propTypes.default.string),
  loading: _propTypes.default.bool
} : {};
var _default = exports.default = CardsGrid;
//# sourceMappingURL=index.js.map