"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 _FluidColumns = _interopRequireDefault(require("../common/FluidColumns"));
var _Text = _interopRequireDefault(require("../Text"));
var _TestimonialListSt = require("./TestimonialList.st.css.js");
var _constants = require("./constants");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/TestimonialList/TestimonialList.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; })(); }
/** TestimonialList is a group of layouts that display avatar, description and name. It's used in a footer of a marketing page layout. */
var TestimonialList = /*#__PURE__*/function (_React$Component) {
  function TestimonialList() {
    (0, _classCallCheck2["default"])(this, TestimonialList);
    return _callSuper(this, TestimonialList, arguments);
  }
  (0, _inherits2["default"])(TestimonialList, _React$Component);
  return (0, _createClass2["default"])(TestimonialList, [{
    key: "render",
    value: function render() {
      var _this = this;
      var _this$props = this.props,
        className = _this$props.className,
        dataHook = _this$props.dataHook,
        testimonials = _this$props.testimonials,
        cols = _this$props.cols;
      return /*#__PURE__*/_react["default"].createElement("div", {
        className: (0, _TestimonialListSt.st)(_TestimonialListSt.classes.root, className),
        "data-hook": dataHook,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 14,
          columnNumber: 7
        }
      }, /*#__PURE__*/_react["default"].createElement(_FluidColumns["default"], {
        cols: cols,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 15,
          columnNumber: 9
        }
      }, testimonials.map(function (testimonial, index) {
        return /*#__PURE__*/_react["default"].createElement(TestimonialItem, {
          dataHook: _constants.dataHooks.testimonial,
          key: index,
          index: index,
          avatar: testimonial.avatar,
          text: testimonial.text,
          authorName: testimonial.authorName,
          __self: _this,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 18,
            columnNumber: 15
          }
        });
      })));
    }
  }]);
}(_react["default"].Component);
var TestimonialItem = function TestimonialItem(_ref) {
  var index = _ref.index,
    avatar = _ref.avatar,
    text = _ref.text,
    authorName = _ref.authorName,
    dataHook = _ref.dataHook;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: _TestimonialListSt.classes.testimonialItem,
    "data-hook": dataHook,
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 35,
      columnNumber: 3
    }
  }, avatar && /*#__PURE__*/_react["default"].createElement("div", {
    className: _TestimonialListSt.classes.testimonialItemAvatar,
    "data-hook": "".concat(_constants.dataHooks.testimonialAvatar).concat(index),
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 37,
      columnNumber: 7
    }
  }, avatar), /*#__PURE__*/_react["default"].createElement("div", {
    className: _TestimonialListSt.classes.testimonialItemTextArea,
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 44,
      columnNumber: 5
    }
  }, text && /*#__PURE__*/_react["default"].createElement("div", {
    className: _TestimonialListSt.classes.testimonialItemText,
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 46,
      columnNumber: 9
    }
  }, /*#__PURE__*/_react["default"].createElement(_Text["default"], {
    dataHook: "".concat(_constants.dataHooks.testimonialText).concat(index),
    size: "small",
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 47,
      columnNumber: 11
    }
  }, text)), authorName && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
    dataHook: "".concat(_constants.dataHooks.testimonialAuthorName).concat(index),
    size: "small",
    weight: "bold",
    __self: _this2,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 53,
      columnNumber: 9
    }
  }, authorName)));
};
TestimonialList.displayName = 'TestimonialList';
TestimonialList.defaultProps = {
  cols: 3,
  testimonials: []
};
var _default = exports["default"] = TestimonialList;