({ name }: { name: Option })
| 159 | } |
| 160 | |
| 161 | export default function OptionInput({ name }: { name: Option }) { |
| 162 | const dispatch = useAppDispatch(); |
| 163 | const choices = useAppSelector( |
| 164 | (state) => state.options_meta[name]?.choices, |
| 165 | ); |
| 166 | const type = useAppSelector((state) => state.options_meta[name]?.type); |
| 167 | const value = useAppSelector((state) => { |
| 168 | const editState = state.ui.optionsEditor[name]; |
| 169 | return editState ? editState.value : state.options_meta[name]?.value; |
| 170 | }); |
| 171 | const error = useAppSelector( |
| 172 | (state) => state.ui.optionsEditor[name]?.error, |
| 173 | ); |
| 174 | |
| 175 | return ( |
| 176 | <PureOption |
| 177 | name={name} |
| 178 | choices={choices} |
| 179 | type={type} |
| 180 | value={value} |
| 181 | error={error} |
| 182 | onChange={(value) => dispatch(updateOptions(name, value))} |
| 183 | /> |
| 184 | ); |
| 185 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…