diff options
Diffstat (limited to 'src/components/ui')
-rw-r--r-- | src/components/ui/Radio.tsx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/components/ui/Radio.tsx b/src/components/ui/Radio.tsx index b5be64c5d..1f41deedc 100644 --- a/src/components/ui/Radio.tsx +++ b/src/components/ui/Radio.tsx | |||
@@ -1,10 +1,11 @@ | |||
1 | import { Component } from 'react'; | 1 | import { Component } from 'react'; |
2 | import { observer } from 'mobx-react'; | 2 | import { observer } from 'mobx-react'; |
3 | import { Field } from 'mobx-react-form'; | ||
4 | import classnames from 'classnames'; | 3 | import classnames from 'classnames'; |
4 | import FieldInterface from 'mobx-react-form/lib/models/FieldInterface'; | ||
5 | import Error from './error'; | ||
5 | 6 | ||
6 | type Props = { | 7 | type Props = { |
7 | field: typeof Field; | 8 | field: FieldInterface; |
8 | className: string; | 9 | className: string; |
9 | focus: boolean; | 10 | focus: boolean; |
10 | showLabel: boolean; | 11 | showLabel: boolean; |
@@ -47,7 +48,8 @@ class Radio extends Component<Props> { | |||
47 | </label> | 48 | </label> |
48 | )} | 49 | )} |
49 | <div className="franz-form__radio-wrapper"> | 50 | <div className="franz-form__radio-wrapper"> |
50 | {field.options.map(type => ( | 51 | {/* @ts-expect-error Property 'map' does not exist on type 'OptionsModel'. */} |
52 | {field.options?.map(type => ( | ||
51 | <label | 53 | <label |
52 | key={type.value} | 54 | key={type.value} |
53 | htmlFor={`${field.id}-${type.value}`} | 55 | htmlFor={`${field.id}-${type.value}`} |
@@ -68,7 +70,8 @@ class Radio extends Component<Props> { | |||
68 | </label> | 70 | </label> |
69 | ))} | 71 | ))} |
70 | </div> | 72 | </div> |
71 | {field.error && <div className="franz-form__error">{field.error}</div>} | 73 | |
74 | {field.error && <Error message={field.error} />} | ||
72 | </div> | 75 | </div> |
73 | ); | 76 | ); |
74 | } | 77 | } |