import { INVOICE_STATE } from '@proton/shared/lib/constants' ; import { Price } from '../../components' ; import { Invoice } from './interface' ; interface Props { invoice : Invoice ; } const format = ( { State , AmountCharged = 0 , AmountDue = 0 } ) => { return State === INVOICE_STATE . UNPAID ? AmountDue : AmountCharged ; } ; const InvoiceAmount = ( { invoice } ) => { return < Price currency = { invoice . Currency } > { format ( invoice ) } < /Price>; } ; export default InvoiceAmount ;