/** * Net / gross / VAT price display — shared between quote listings. */ import React from 'react'; import { __ } from '@wordpress/i18n'; interface PriceDisplayProps { /** Price excluding VAT. */ net: number; /** Price including VAT. */ gross: number; /** Whether the price includes VAT (show gross row when true). */ hasVAT: boolean; /** Currency symbol (default '£'). */ currency?: string; } function PriceDisplayInner({ net, gross, hasVAT, currency = '£' }: PriceDisplayProps) { return ( <>
{currency} {net.toFixed(2)} {__('ex VAT', 'parcel2go-shipping')}
{hasVAT && (
{currency} {gross.toFixed(2)} {__('inc VAT', 'parcel2go-shipping')}
)} ); } const PriceDisplay = React.memo(PriceDisplayInner); export default PriceDisplay;