diff options
author | Sebastian <sebasjm@gmail.com> | 2023-05-22 10:40:13 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-05-22 10:40:13 -0300 |
commit | 3e95ae356a98d01e523bdf48547db4114ff224fe (patch) | |
tree | 7cc1e488b902bb3a3eeba92ff81ea0e383ed542d /packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx | |
parent | 0544b8358af68df87dbc472221d8c0842c2b2db0 (diff) | |
download | wallet-core-3e95ae356a98d01e523bdf48547db4114ff224fe.tar.gz wallet-core-3e95ae356a98d01e523bdf48547db4114ff224fe.tar.bz2 wallet-core-3e95ae356a98d01e523bdf48547db4114ff224fe.zip |
fix break on build
Diffstat (limited to 'packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx')
-rw-r--r-- | packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx b/packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx index 361eb39a3..3bce0123f 100644 --- a/packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx +++ b/packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx @@ -9,10 +9,10 @@ export interface Choice { value: string; } -export function InputChoiceStacked( +export function InputChoiceStacked<T extends object, K extends keyof T>( props: { choices: Choice[]; - } & UIFormProps<string>, + } & UIFormProps<T, K>, ): VNode { const { choices, @@ -26,9 +26,7 @@ export function InputChoiceStacked( after, converter, } = props; - const { value, onChange, state, isDirty } = useField<{ - [s: string]: undefined | string; - }>(name); + const { value, onChange, state, isDirty } = useField<T, K>(name); if (state.hidden) { return <Fragment />; } @@ -58,7 +56,11 @@ export function InputChoiceStacked( name="server-size" defaultValue={choice.value} onClick={(e) => { - onChange(value === choice.value ? undefined : choice.value); + onChange( + (value === choice.value + ? undefined + : choice.value) as T[K], + ); }} class="sr-only" aria-labelledby="server-size-0-label" |