From bedeebff1572fa8cfdb0a818030f6b13a3fc0f53 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 31 Dec 2023 15:32:12 -0300 Subject: remove handlers from impl --- .../aml-backoffice-ui/src/handlers/InputAmount.tsx | 36 ---------------------- 1 file changed, 36 deletions(-) delete mode 100644 packages/aml-backoffice-ui/src/handlers/InputAmount.tsx (limited to 'packages/aml-backoffice-ui/src/handlers/InputAmount.tsx') diff --git a/packages/aml-backoffice-ui/src/handlers/InputAmount.tsx b/packages/aml-backoffice-ui/src/handlers/InputAmount.tsx deleted file mode 100644 index 29ec43525..000000000 --- a/packages/aml-backoffice-ui/src/handlers/InputAmount.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { AmountJson, Amounts, TranslatedString } from "@gnu-taler/taler-util"; -import { VNode, h } from "preact"; -import { InputLine } from "./InputLine.js"; -import { useField } from "./useField.js"; -import { UIFormProps } from "./FormProvider.js"; - -export function InputAmount( - props: { currency?: string } & UIFormProps, -): VNode { - const { value } = useField(props.name); - const currency = - !value || !(value as any).currency - ? props.currency - : (value as any).currency; - return ( - - type="text" - before={{ - type: "text", - text: currency as TranslatedString, - }} - converter={{ - //@ts-ignore - fromStringUI: (v): AmountJson => { - - return Amounts.parse(`${currency}:${v}`) ?? Amounts.zeroOfCurrency(currency); - }, - //@ts-ignore - toStringUI: (v: AmountJson) => { - return v === undefined ? "" : Amounts.stringifyValue(v); - }, - }} - {...props} - /> - ); -} -- cgit v1.2.3