/** * External dependencies */ import { useState } from '@wordpress/element'; import { __ } 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 } from '@woocommerce/base-utils'; const CartLineItemRow = ( { lineItem } ) => { const { name, images, quantity, totals } = lineItem; const { line_total: total, line_subtotal: subtotal } = totals; const imageProps = {}; if ( images && images.length ) { imageProps.src = lineItem.images[ 0 ].src || ''; imageProps.alt = lineItem.images[ 0 ].alt || ''; imageProps.srcSet = lineItem.images[ 0 ].srcset || ''; imageProps.sizes = lineItem.images[ 0 ].sizes || ''; } const [ lineQuantity, setLineQuantity ] = useState( quantity ); const currency = getCurrency(); const isDiscounted = subtotal !== total; const fullPrice = isDiscounted ? (