import _map from "lodash/fp/map";
import React from 'react';
import PropTypes from 'prop-types';
import Card from '../../molecule/card';
import Loader from '../../atom/loader';
import style from './style.css';
const CardsGrid = props => {
  const {
    list = [],
    customStyle = {},
    loading = false
  } = props;
  const loader = loading ? /*#__PURE__*/React.createElement("div", {
    className: style.loader
  }, /*#__PURE__*/React.createElement(Loader, null)) : null;
  const cards = _map(cardProps => {
    return /*#__PURE__*/React.createElement("div", {
      "data-name": "cardGrid",
      className: style.card,
      key: cardProps.key
    }, /*#__PURE__*/React.createElement(Card, cardProps));
  }, list);
  return /*#__PURE__*/React.createElement("div", {
    className: style.defaultStyle,
    style: customStyle
  }, cards, loader);
};
CardsGrid.propTypes = process.env.NODE_ENV !== "production" ? {
  // @ts-expect-error component is not typed & wrapped into memo
  list: PropTypes.arrayOf(PropTypes.shape(Card.propTypes)),
  customStyle: PropTypes.objectOf(PropTypes.string),
  loading: PropTypes.bool
} : {};
export default CardsGrid;
//# sourceMappingURL=index.js.map