@shopgate/engage
Version:
Shopgate's ENGAGE library.
3 lines • 975 B
JavaScript
import React,{useCallback}from'react';import{RippleButton,I18n}from'@shopgate/engage/components';import{button,ripple}from"./CartItemCardReservationLabelChangeStore.style";import{useCartItem}from"../CartItem";/**
* @returns {JSX}
*/var CartItemCardReservationLabelChangeStore=function CartItemCardReservationLabelChangeStore(){var _useCartItem=useCartItem(),invokeFulfillmentAction=_useCartItem.invokeFulfillmentAction,cartItem=_useCartItem.cartItem;var handleChangeLocationClick=useCallback(function(){if(!cartItem||!cartItem.fulfillment||!cartItem.fulfillment.method){return;}var method=cartItem.fulfillment.method;invokeFulfillmentAction('changeLocation',method);},[cartItem,invokeFulfillmentAction]);return React.createElement(RippleButton,{onClick:handleChangeLocationClick,className:button,rippleClassName:ripple,type:"secondary",flat:true},React.createElement(I18n.Text,{string:"locations.change_location"}));};export default CartItemCardReservationLabelChangeStore;