@shopgate/engage
Version:
Shopgate's ENGAGE library.
27 lines (26 loc) • 855 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";
/**
* @returns {JSX.Element}
*/
import { jsx as _jsx } from "react/jsx-runtime";
const CartItemProductLayoutWideFulfillmentLabel = () => {
const {
cartItem
} = useCartItemProduct();
const fulfillmentMethod = cartItem?.fulfillment?.method || null;
let suffix = 'direct_ship';
if (fulfillmentMethod === BOPIS) {
suffix = 'bopis';
} else if (fulfillmentMethod === ROPIS) {
suffix = 'ropis';
}
return /*#__PURE__*/_jsx("div", {
className: label,
children: i18n.text(`locations.method.${suffix}`)
});
};
export { CartItemProductLayoutWideFulfillmentLabel };