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

Function toggle

packages/ui/src/ui-component/picker/MonthDaysPicker.jsx:37–49  ·  view source on GitHub ↗
(day)

Source from the content-addressed store, hash-verified

35 }, [value])
36
37 const toggle = (day) => {
38 if (disabled) return
39 const dayStr = String(day)
40 let next
41 if (selected.includes(dayStr)) {
42 next = selected.filter((d) => d !== dayStr)
43 } else {
44 next = [...selected, dayStr]
45 }
46 next = sortDays(next)
47 setSelected(next)
48 onChange(next.join(','))
49 }
50
51 const renderChip = (valueToken, label) => {
52 const isSelected = selected.includes(valueToken)

Callers 1

renderChipFunction · 0.70

Calls 2

sortDaysFunction · 0.85
onChangeFunction · 0.50

Tested by

no test coverage detected