@shopgate/engage
Version:
Shopgate's ENGAGE library.
36 lines (35 loc) • 1.23 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import CartItemGroupReservation from "./CartItemGroupReservation";
/**
* Renders the product group.
* @param {Object} props The component props.
* @param {React.ReactNode} props.children The child components.
* @param {string|null} [props.fulfillmentLocationId] The fulfillment location ID.
* @param {boolean} [props.multiLineReservation=false] Whether multi-line reservation is enabled.
* @param {string|null} [props.fulfillmentMethod] The fulfillment method.
* @returns {JSX.Element} The rendered component.
*/
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
const CartItemGroup = ({
children,
fulfillmentLocationId,
multiLineReservation,
fulfillmentMethod
}) => {
if (!multiLineReservation) {
return children;
}
return /*#__PURE__*/_jsxs(_Fragment, {
children: [!!fulfillmentLocationId && /*#__PURE__*/_jsx(CartItemGroupReservation, {
locationId: fulfillmentLocationId,
fulfillmentMethod: fulfillmentMethod
}), children]
});
};
CartItemGroup.defaultProps = {
fulfillmentLocationId: null,
multiLineReservation: false,
fulfillmentMethod: null
};
export default CartItemGroup;