aboutsummaryrefslogtreecommitdiff
path: root/packages/exchange-backoffice-ui/src/handlers/InputAmount.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/exchange-backoffice-ui/src/handlers/InputAmount.tsx')
-rw-r--r--packages/exchange-backoffice-ui/src/handlers/InputAmount.tsx34
1 files changed, 0 insertions, 34 deletions
diff --git a/packages/exchange-backoffice-ui/src/handlers/InputAmount.tsx b/packages/exchange-backoffice-ui/src/handlers/InputAmount.tsx
deleted file mode 100644
index 9be9dd4d0..000000000
--- a/packages/exchange-backoffice-ui/src/handlers/InputAmount.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { AmountJson, Amounts, TranslatedString } from "@gnu-taler/taler-util";
-import { VNode, h } from "preact";
-import { InputLine, UIFormProps } from "./InputLine.js";
-import { useField } from "./useField.js";
-
-export function InputAmount<T extends object, K extends keyof T>(
- props: { currency?: string } & UIFormProps<T, K>,
-): VNode {
- const { value } = useField<T, K>(props.name);
- const currency =
- !value || !(value as any).currency
- ? props.currency
- : (value as any).currency;
- return (
- <InputLine<T, K>
- type="text"
- before={{
- type: "text",
- text: currency as TranslatedString,
- }}
- converter={{
- //@ts-ignore
- fromStringUI: (v): AmountJson => {
- return Amounts.parseOrThrow(`${currency}:${v}`);
- },
- //@ts-ignore
- toStringUI: (v: AmountJson) => {
- return v === undefined ? "" : Amounts.stringifyValue(v);
- },
- }}
- {...props}
- />
- );
-}