MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / OptionInput

Function OptionInput

web/src/js/components/Modal/OptionInput.tsx:161–185  ·  view source on GitHub ↗
({ name }: { name: Option })

Source from the content-addressed store, hash-verified

159}
160
161export 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}

Callers

nothing calls this directly

Calls 2

useAppDispatchFunction · 0.90
dispatchFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…