MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / toggleOption

Function toggleOption

packages/web/src/components/ui/multi-select.tsx:160–166  ·  view source on GitHub ↗
(option: string)

Source from the content-addressed store, hash-verified

158 };
159
160 const toggleOption = (option: string) => {
161 const newSelectedValues = selectedValues.includes(option)
162 ? selectedValues.filter((value) => value !== option)
163 : [...selectedValues, option];
164 setSelectedValues(newSelectedValues);
165 onValueChange(newSelectedValues);
166 };
167
168 const handleClear = () => {
169 setSelectedValues([]);

Callers 1

multi-select.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected