Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | import { Fragment, memo } from 'react'; import { type FormatsEnum } from '@amalia/data-capture/fields/types'; import { type CurrencySymbolsEnum } from '@amalia/ext/iso-4217'; import { type FormatOptions } from '@amalia/kernel/intl/formatters'; import { type ComputeEnginePrimitiveTypes } from '@amalia/payout-calculation/types'; import { useFormatValue } from '../../hooks/use-format-value'; export type FormattedValueProps = { readonly value: ComputeEnginePrimitiveTypes | undefined; readonly format: FormatsEnum; readonly currencySymbol?: CurrencySymbolsEnum; readonly currencyRate?: number; readonly intlOptions?: Intl.NumberFormatOptions; readonly formatOptions?: FormatOptions; }; export const FormattedValue = memo(function FormattedValue({ value, format, currencySymbol, currencyRate, intlOptions, formatOptions, }: FormattedValueProps) { const formatValue = useFormatValue(); return ( <Fragment> {formatValue(value, format, { currencySymbol, currencyRate, intlOptions, formatOptions, })} </Fragment> ); }); |