"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _react = _interopRequireDefault(require("react"));
var _FeatureListSt = require("./FeatureList.st.css.js");
var _constants = require("./constants");
var _FluidColumns = _interopRequireDefault(require("../common/FluidColumns"));
var _Text = _interopRequireDefault(require("../Text"));
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/FeatureList/FeatureList.jsx",
  _this2 = void 0;
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
/** FeatureList is a group of layouts that displays image, description and title. It's used in a footer of a marketing page to list product features. */
var FeatureList = /*#__PURE__*/function (_React$Component) {
  function FeatureList() {
    (0, _classCallCheck2["default"])(this, FeatureList);
    return _callSuper(this, FeatureList, arguments);
  }
  (0, _inherits2["default"])(FeatureList, _React$Component);
  return (0, _createClass2["default"])(FeatureList, [{
    key: "render",
    value: function render() {
      var _this = this;
      var _this$props = this.props,
        dataHook = _this$props.dataHook,
        className = _this$props.className,
        features = _this$props.features,
        cols = _this$props.cols;
      return /*#__PURE__*/_react["default"].createElement("div", {
        className: (0, _FeatureListSt.st)(_FeatureListSt.classes.root, className),
        "data-hook": dataHook,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 13,
          columnNumber: 7
        }
      }, /*#__PURE__*/_react["default"].createElement(_FluidColumns["default"], {
        cols: cols,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 14,
          columnNumber: 9
        }
      }, features.map(function (feature, index) {
        return /*#__PURE__*/_react["default"].createElement(FeatureItem, {
          dataHook: _constants.dataHooks.feature,
          key: index,
          index: index,
          image: feature.image,
          title: feature.title,
          text: feature.text,
          __self: _this,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 17,
            columnNumber: 15
          }
        });
      })));
    }
  }]);
}(_react["default"].Component);
var FeatureItem = function FeatureItem(_ref) {
  var dataHook = _ref.dataHook,
    index = _ref.index,
    image = _ref.image,
    title = _ref.title,
    text = _ref.text;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: _FeatureListSt.classes.featureItem,
    "data-hook": dataHook,
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 34,
      columnNumber: 3
    }
  }, image && /*#__PURE__*/_react["default"].createElement("div", {
    className: _FeatureListSt.classes.featureItemImageContainer,
    "data-hook": "".concat(_constants.dataHooks.featureImage).concat(index),
    children: image,
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 36,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: _FeatureListSt.classes.featureItemTextContainer,
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 42,
      columnNumber: 5
    }
  }, title && /*#__PURE__*/_react["default"].createElement("div", {
    className: _FeatureListSt.classes.featureItemTitleContainer,
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 44,
      columnNumber: 9
    }
  }, /*#__PURE__*/_react["default"].createElement(_Text["default"], {
    dataHook: "".concat(_constants.dataHooks.featureTitle).concat(index),
    size: "medium",
    weight: "bold",
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 45,
      columnNumber: 11
    }
  }, title)), text && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
    dataHook: "".concat(_constants.dataHooks.featureText).concat(index),
    size: "small",
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 55,
      columnNumber: 9
    }
  }, text)));
};
FeatureList.displayName = 'FeatureList';
FeatureList.defaultProps = {
  cols: 3,
  features: []
};
var _default = exports["default"] = FeatureList;