woocommerce/plugins/woocommerce-blocks/assets/js/base/components/totals/totals-taxes-item/index.js

32 lines
620 B
JavaScript
Raw Normal View History

/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
/**
* Internal dependencies
*/
import TotalsItem from '../totals-item';
const TotalsTaxesItem = ( { currency, values } ) => {
const { total_tax: totalTax } = values;
return (
<TotalsItem
currency={ currency }
label={ __( 'Taxes', 'woo-gutenberg-products-block' ) }
value={ parseInt( totalTax, 10 ) }
/>
);
};
TotalsTaxesItem.propTypes = {
currency: PropTypes.object.isRequired,
values: PropTypes.shape( {
total_tax: PropTypes.string,
} ).isRequired,
};
export default TotalsTaxesItem;