MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / SwitchInput

Function SwitchInput

packages/agentflow/src/atoms/SwitchInput.tsx:14–32  ·  view source on GitHub ↗
({ label, value, onChange, disabled = false }: SwitchInputProps)

Source from the content-addressed store, hash-verified

12 * Mirrors the original Flowise SwitchInput component.
13 */
14export function SwitchInput({ label, value, onChange, disabled = false }: SwitchInputProps) {
15 const checked = value !== undefined ? !!value : false
16
17 return (
18 <FormControl
19 sx={{ mt: 1, width: '100%', display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }}
20 size='small'
21 >
22 {label && <Typography>{label}</Typography>}
23 <Switch
24 disabled={disabled}
25 checked={checked}
26 onChange={(event) => {
27 onChange(event.target.checked)
28 }}
29 />
30 </FormControl>
31 )
32}

Callers

nothing calls this directly

Calls 1

onChangeFunction · 0.50

Tested by

no test coverage detected