import React from 'react' ; import { Tax } from 'common/types' ; export type TaxNameProps = { taxId : string ; taxes : Tax [ ] ; className ? : string ; } ; export default function TaxName ( { taxId , taxes , className = '' } ) { const tax = taxes . find ( ( tax ) => tax . id === taxId ) ; if ( ! tax ) return null ; return < span className = { className } > { `${ tax . name } (${ tax . precentage }%)` } < /span>; }