"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 _SkeletonSt = require("./Skeleton.st.css.js");
var _constants = require("./constants");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/Skeleton/Skeleton.jsx";
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; })(); }
/**
 * Skeleton is a “placeholder” component.
 * Used for filling up screen usually for when some async operation is ongoing.
 */
var Skeleton = /*#__PURE__*/function (_React$PureComponent) {
  function Skeleton() {
    (0, _classCallCheck2["default"])(this, Skeleton);
    return _callSuper(this, Skeleton, arguments);
  }
  (0, _inherits2["default"])(Skeleton, _React$PureComponent);
  return (0, _createClass2["default"])(Skeleton, [{
    key: "render",
    value: function render() {
      var _this = this;
      var _this$props = this.props,
        dataHook = _this$props.dataHook,
        content = _this$props.content,
        alignment = _this$props.alignment,
        spacing = _this$props.spacing,
        className = _this$props.className;
      return /*#__PURE__*/_react["default"].createElement("div", {
        "data-hook": dataHook,
        "data-alignment": alignment,
        "data-spacing": spacing,
        className: (0, _SkeletonSt.st)(_SkeletonSt.classes.root, {
          alignment: alignment,
          spacing: spacing
        }, className),
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 13,
          columnNumber: 7
        }
      }, content.map(function (_ref, key) {
        var type = _ref.type,
          size = _ref.size;
        return /*#__PURE__*/_react["default"].createElement("div", {
          key: key,
          "data-hook": _constants.dataHooks.line,
          className: (0, _SkeletonSt.st)(_SkeletonSt.classes.line, {
            alignment: alignment,
            spacing: spacing
          }),
          __self: _this,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 20,
            columnNumber: 11
          }
        }, /*#__PURE__*/_react["default"].createElement("div", {
          "data-hook": _constants.dataHooks.chunk,
          "data-type": type,
          "data-size": size,
          className: (0, _SkeletonSt.st)(_SkeletonSt.classes.chunk, {
            size: size
          }),
          __self: _this,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 25,
            columnNumber: 13
          }
        }));
      }));
    }
  }]);
}(_react["default"].PureComponent);
Skeleton.displayName = 'Skeleton';
Skeleton.defaultProps = {
  alignment: 'start',
  spacing: 'medium',
  content: [{
    type: 'line',
    size: 'small'
  }]
};
var _default = exports["default"] = Skeleton;