wallet-core/packages/taler-wallet-webextension/src/components/Amount.tsx
2022-04-11 11:36:37 -03:00

13 lines
371 B
TypeScript

import { AmountJson, Amounts, AmountString } from "@gnu-taler/taler-util";
import { h, VNode, Fragment } from "preact";
export function Amount({ value }: { value: AmountJson | AmountString }): VNode {
const aj = Amounts.jsonifyAmount(value);
const amount = Amounts.stringifyValue(aj, 2);
return (
<Fragment>
{amount} {aj.currency}
</Fragment>
);
}