/** * External dependencies */ import { RawHTML } from '@wordpress/element'; import { __, sprintf } from '@wordpress/i18n'; import PropTypes from 'prop-types'; import QuantitySelector from '@woocommerce/base-components/quantity-selector'; import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount'; import { getCurrency, formatPrice } from '@woocommerce/base-utils'; import { useStoreCartItem } from '@woocommerce/base-hooks'; import { Icon, trash } from '@woocommerce/icons'; /** * Internal dependencies */ import ProductVariationData from './product-variation-data'; import ProductImage from './product-image'; import ProductLowStockBadge from './product-low-stock-badge'; /** * Cart line item table row component. */ const CartLineItemRow = ( { lineItem = {} } ) => { const { key = '', name = '', summary = '', permalink = '', images = [], variation = [], prices = {}, } = lineItem; const { quantity, changeQuantity, removeItem, isPending: itemQuantityDisabled, } = useStoreCartItem( key ); const currency = getCurrency(); const regularPrice = parseInt( prices.regular_price, 10 ) * quantity; const purchasePrice = parseInt( prices.price, 10 ) * quantity; const saleAmount = regularPrice - purchasePrice; return (