2022-04-11 16:33:55 +02:00
|
|
|
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>
|
2022-05-26 20:55:14 +02:00
|
|
|
{amount} {aj.currency}
|
2022-04-11 16:33:55 +02:00
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
}
|