Liferay.Loader.define("commerce-frontend-js@3.0.43/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 };
    }

    /**
     * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
     * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
     */
    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