@shopgate/engage
Version:
Shopgate's ENGAGE library.
4 lines • 977 B
JavaScript
import React from'react';import{BOPIS,ROPIS}from'@shopgate/engage/locations';import{i18n}from'@shopgate/engage/core';import{label}from"./CartItemProductLayoutWideFulfillmentLabel.style";import{useCartItemProduct}from"./CartItem.hooks";/**
* @param {Object} props The component props
* @returns {JSX}
*/var CartItemProductLayoutWideFulfillmentLabel=function CartItemProductLayoutWideFulfillmentLabel(){var _cartItem$fulfillment;var _useCartItemProduct=useCartItemProduct(),cartItem=_useCartItemProduct.cartItem;var fulfillmentMethod=(cartItem===null||cartItem===void 0?void 0:(_cartItem$fulfillment=cartItem.fulfillment)===null||_cartItem$fulfillment===void 0?void 0:_cartItem$fulfillment.method)||null;var suffix='direct_ship';if(fulfillmentMethod===BOPIS){suffix='bopis';}else if(fulfillmentMethod===ROPIS){suffix='ropis';}return React.createElement("div",{className:label},i18n.text("locations.method.".concat(suffix)));};export{CartItemProductLayoutWideFulfillmentLabel};