Liferay.Loader.define("commerce-frontend-js@3.0.33/components/mini_cart/CartItemViews/ItemInfoView", ['module', 'exports', 'require', 'frontend-js-react-web$prop-types', 'frontend-js-react-web$react'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = void 0;

    var _propTypes = _interopRequireDefault(require("frontend-js-react-web$prop-types"));

    var _react = _interopRequireDefault(require("frontend-js-react-web$react"));

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * This library is free software; you can redistribute it and/or modify it under
     * the terms of the GNU Lesser General Public License as published by the Free
     * Software Foundation; either version 2.1 of the License, or (at your option)
     * any later version.
     *
     * This library is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
     * details.
     */
    function ItemInfoViewOptions(_ref) {
      var options = _ref.options;
      return (/*#__PURE__*/_react.default.createElement("div", {
          className: 'item-info-extra mt-3'
        }, /*#__PURE__*/_react.default.createElement("h6", {
          className: 'options'
        }, options))
      );
    }

    function ItemInfoViewBundle(_ref2) {
      var childItems = _ref2.childItems;
      return (/*#__PURE__*/_react.default.createElement("div", {
          className: 'child-items'
        }, childItems.map(function (item, index) {
          var name = item.name,
              quantity = item.quantity;
          return (/*#__PURE__*/_react.default.createElement("div", {
              className: 'child-item',
              key: index
            }, /*#__PURE__*/_react.default.createElement("span", null, quantity, " \xD7 ", name))
          );
        }))
      );
    }

    function ItemInfoViewBase(_ref3) {
      var name = _ref3.name,
          sku = _ref3.sku;
      return (/*#__PURE__*/_react.default.createElement("div", {
          className: 'item-info-base'
        }, /*#__PURE__*/_react.default.createElement("h5", {
          className: 'item-name'
        }, name), /*#__PURE__*/_react.default.createElement("p", {
          className: 'item-sku'
        }, sku))
      );
    }

    function ItemInfoView(_ref4) {
      var _ref4$childItems = _ref4.childItems,
          childItems = _ref4$childItems === void 0 ? [] : _ref4$childItems,
          name = _ref4.name,
          _ref4$options = _ref4.options,
          options = _ref4$options === void 0 ? '' : _ref4$options,
          sku = _ref4.sku;
      var isBundle = childItems.length > 0;
      return (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ItemInfoViewBase, {
          name: name,
          sku: sku
        }), isBundle && /*#__PURE__*/_react.default.createElement(ItemInfoViewBundle, {
          childItems: childItems
        }), !!options && /*#__PURE__*/_react.default.createElement(ItemInfoViewOptions, {
          options: options
        }))
      );
    }

    var _default = ItemInfoView;
    exports.default = _default;
    //# sourceMappingURL=ItemInfoView.js.map
  }
});
//# sourceMappingURL=ItemInfoView.js.map