MCPcopy Create free account
hub / github.com/ModelEngine-Group/app-platform / SelectMode

Function SelectMode

agent-flow/src/components/end/SelectMode.jsx:20–56  ·  view source on GitHub ↗
({mode, disabled})

Source from the content-addressed store, hash-verified

18 * @constructor
19 */
20export const SelectMode = ({mode, disabled}) => {
21 const dispatch = useDispatch();
22 const {t} = useTranslation();
23
24 /**
25 * 模式切换后的回调
26 *
27 * @param value 模式的值
28 */
29 const onChange = (value) => {
30 if (value === mode) {
31 return;
32 }
33 dispatch({type: 'changeMode', value});
34 };
35
36 return (<>
37 <div style={{display: 'flex', alignItems: 'center'}}>
38 <div className='mode-select-title jade-panel-header-font'>{t('modeSelect')}</div>
39 <JadeStopPropagationSelect
40 disabled={disabled}
41 className={'jade-select'}
42 showSearch
43 optionFilterProp='children'
44 onChange={onChange}
45 defaultValue='mode-variables'
46 value={mode}
47 options={[
48 {value: 'variables', label: t('directlyOutputTheResult')},
49 {value: 'manualCheck', label: t('intelligentFormShowResult')},
50 ]}
51 style={{width: '70%', marginLeft: 'auto'}}
52 >
53 </JadeStopPropagationSelect>
54 </div>
55 </>);
56};
57
58SelectMode.propTypes = {
59 mode: PropTypes.string,

Callers

nothing calls this directly

Calls 1

useDispatchFunction · 0.90

Tested by

no test coverage detected