From c680f5aa71b08e978444df07f93c381f9d47ab82 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 5 Jun 2023 10:04:09 -0300 Subject: rename aml --- .../src/handlers/InputChoiceHorizontal.tsx | 86 ---------------------- 1 file changed, 86 deletions(-) delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputChoiceHorizontal.tsx (limited to 'packages/exchange-backoffice-ui/src/handlers/InputChoiceHorizontal.tsx') diff --git a/packages/exchange-backoffice-ui/src/handlers/InputChoiceHorizontal.tsx b/packages/exchange-backoffice-ui/src/handlers/InputChoiceHorizontal.tsx deleted file mode 100644 index fdee35447..000000000 --- a/packages/exchange-backoffice-ui/src/handlers/InputChoiceHorizontal.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import { TranslatedString } from "@gnu-taler/taler-util"; -import { Fragment, VNode, h } from "preact"; -import { LabelWithTooltipMaybeRequired, UIFormProps } from "./InputLine.js"; -import { useField } from "./useField.js"; - -export interface Choice { - label: TranslatedString; - value: V; -} - -export function InputChoiceHorizontal( - props: { - choices: Choice[]; - } & UIFormProps, -): VNode { - const { - choices, - name, - label, - tooltip, - help, - placeholder, - required, - before, - after, - converter, - } = props; - const { value, onChange, state, isDirty } = useField(name); - if (state.hidden) { - return ; - } - - return ( -
- -
-
- {choices.map((choice, idx) => { - const isFirst = idx === 0; - const isLast = idx === choices.length - 1; - let clazz = - "relative inline-flex items-center px-3 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 focus:z-10"; - if (choice.value === value) { - clazz += - " text-white bg-indigo-600 hover:bg-indigo-500 ring-2 ring-indigo-600 hover:ring-indigo-500"; - } else { - clazz += " hover:bg-gray-100 border-gray-300"; - } - if (isFirst) { - clazz += " rounded-l-md"; - } else { - clazz += " -ml-px"; - } - if (isLast) { - clazz += " rounded-r-md"; - } - return ( - - ); - })} -
-
- {help && ( -

- {help} -

- )} -
- ); -} -- cgit v1.2.3