@shopgate/engage
Version:
Shopgate's ENGAGE library.
3 lines • 1.35 kB
JavaScript
import React,{Fragment}from'react';import{QuantityLabel}from'@shopgate/engage/components';import{getTranslatedLineItemStatus}from'@shopgate/engage/orders';import{useCartItem,useCartItemProduct}from"./CartItem.hooks";import{column,locationColumn,statusColumn,quantityPickerDisabled}from"./CartItemProductLayoutWide.style";/**
* @returns {JSX}
*/var CartItemProductLayoutWide=function CartItemProductLayoutWide(){var _useCartItem=useCartItem(),location=_useCartItem.location,cartItem=_useCartItem.cartItem,cartIsDirectShipOnly=_useCartItem.cartIsDirectShipOnly;var _useCartItemProduct=useCartItemProduct(),product=_useCartItemProduct.product;var hasUnitWithDecimals=product.unit&&product.hasCatchWeight||false;return React.createElement(Fragment,null,!cartIsDirectShipOnly?React.createElement("div",{className:locationColumn},location===null||location===void 0?void 0:location.name):null,React.createElement("div",{className:statusColumn},getTranslatedLineItemStatus(cartItem===null||cartItem===void 0?void 0:cartItem.status,cartItem===null||cartItem===void 0?void 0:cartItem.subStatus)),React.createElement("div",{className:column},React.createElement(QuantityLabel,{className:quantityPickerDisabled,value:cartItem.quantity,unit:hasUnitWithDecimals?product.unit:null,maxDecimals:hasUnitWithDecimals?2:0})));};export default CartItemProductLayoutWide;