diff options
Diffstat (limited to 'packages/exchange-backoffice-ui/src/handlers/InputLine.tsx')
-rw-r--r-- | packages/exchange-backoffice-ui/src/handlers/InputLine.tsx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/exchange-backoffice-ui/src/handlers/InputLine.tsx b/packages/exchange-backoffice-ui/src/handlers/InputLine.tsx index 255654949..32b16313d 100644 --- a/packages/exchange-backoffice-ui/src/handlers/InputLine.tsx +++ b/packages/exchange-backoffice-ui/src/handlers/InputLine.tsx @@ -23,7 +23,7 @@ interface StringConverter<T> { } export interface UIFormProps<T> { - name: string; + name: keyof T; label: TranslatedString; placeholder?: TranslatedString; tooltip?: TranslatedString; @@ -181,7 +181,11 @@ function defaultFromString(v: string) { return v; } -export function InputLine<T>(props: { type: string } & UIFormProps<T>): VNode { +type InputType = "text" | "text-area" | "password" | "email"; + +export function InputLine<T>( + props: { type: InputType } & UIFormProps<T>, +): VNode { const { name, placeholder, before, after, converter, type } = props; const { value, onChange, state, isDirty } = useField(name); |