From 64e3705669e7c12b8013704654f17cf8eaf659d4 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 25 May 2023 18:08:20 -0300 Subject: cases, account details and new-form screen --- .../src/handlers/InputChoiceStacked.tsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx') diff --git a/packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx b/packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx index 3bce0123f..c37984368 100644 --- a/packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx +++ b/packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx @@ -3,15 +3,15 @@ import { Fragment, VNode, h } from "preact"; import { LabelWithTooltipMaybeRequired, UIFormProps } from "./InputLine.js"; import { useField } from "./useField.js"; -export interface Choice { +export interface Choice { label: TranslatedString; description?: TranslatedString; - value: string; + value: V; } export function InputChoiceStacked( props: { - choices: Choice[]; + choices: Choice[]; } & UIFormProps, ): VNode { const { @@ -41,6 +41,10 @@ export function InputChoiceStacked(
{choices.map((choice) => { + // const currentValue = !converter + // ? choice.value + // : converter.fromStringUI(choice.value) ?? ""; + let clazz = "border relative block cursor-pointer rounded-lg bg-white px-6 py-4 shadow-sm focus:outline-none sm:flex sm:justify-between"; if (choice.value === value) { @@ -49,12 +53,18 @@ export function InputChoiceStacked( } else { clazz += " border-gray-300"; } + return (