"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.ItemDescription = void 0;

var _taggedTemplateLiteralLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));

var _lib = require("@sentecacommerce-theme/lib");

var _react = _interopRequireDefault(require("react"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _ = require("../../");

var _templateObject;

var ItemDescription = function ItemDescription(_ref) {
  var content = _ref.content,
      handleClose = _ref.handleClose,
      props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["content", "handleClose"]);

  var _useUIFunctions = (0, _lib.useUIFunctions)(),
      closeViewById = _useUIFunctions.closeViewById;

  var _useConfigState = (0, _lib.useConfigState)(),
      views = _useConfigState.views;

  return /*#__PURE__*/_react["default"].createElement(_.Modal, (0, _extends2["default"])({
    open: true,
    handleClose: function handleClose() {
      return closeViewById(views.itemDesc);
    }
  }, props), /*#__PURE__*/_react["default"].createElement(Container, null, content == null ? void 0 : content.map(function (info, index) {
    var _info$content;

    return /*#__PURE__*/_react["default"].createElement("div", {
      dangerouslySetInnerHTML: {
        __html: (_info$content = info == null ? void 0 : info.content) != null ? _info$content : ''
      },
      key: "Info__" + (info.name || index)
    });
  })));
};

exports.ItemDescription = ItemDescription;

var Container = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  position: relative;\n  background-color: #fff;\n  padding: 3rem 3rem 3rem;\n"])));
//# sourceMappingURL=index.js.map