/** @format */ /** * External dependencies */ import { __ } from '@wordpress/i18n'; import classnames from 'classnames'; import { Dashicon } from '@wordpress/components'; import PropTypes from 'prop-types'; const SummaryNumber = ( { context, delta, label, selected, value } ) => { if ( ! context ) { context = __( 'vs Previous Period', 'woo-dash' ); } const classes = classnames( 'woocommerce-summary__item', { 'is-selected': selected, } ); return (
  • { label } { value } { delta && ( 0 ? 'arrow-up-alt' : 'arrow-down-alt' } /> { delta }% { context } ) }
  • ); }; SummaryNumber.propTypes = { context: PropTypes.string, delta: PropTypes.number, label: PropTypes.string.isRequired, selected: PropTypes.bool, value: PropTypes.oneOfType( [ PropTypes.number, PropTypes.string ] ).isRequired, }; export default SummaryNumber;