/** * External dependencies */ import classnames from 'classnames'; import { isValidElement } from '@wordpress/element'; import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount'; import type { ReactElement, ReactNode } from 'react'; import type { Currency } from '@woocommerce/price-format'; /** * Internal dependencies */ import './style.scss'; export interface TotalsItemProps { className?: string; currency: Currency; label: string; // Value may be a number, or react node. Numbers are passed to FormattedMonetaryAmount. value: number | ReactNode; description?: ReactNode; } const TotalsItemValue = ( { value, currency, }: Partial< TotalsItemProps > ): ReactElement | null => { if ( isValidElement( value ) ) { return (