MCPcopy Create free account
hub / github.com/EsperoTech/yaade / setNewGroupInput

Function setNewGroupInput

client/src/components/groupsInput/GroupsInput.tsx:29–39  ·  view source on GitHub ↗
(value: string, force = false)

Source from the content-addressed store, hash-verified

27 const { colorMode } = useColorMode();
28
29 function setNewGroupInput(value: string, force = false) {
30 if (value.endsWith(' ') || force) {
31 const removedDuplicates = Array.from(new Set([...groups, value.trim()]));
32 if (value !== ' ') {
33 setGroups(removedDuplicates);
34 }
35 setNewGroup('');
36 } else {
37 setNewGroup(value);
38 }
39 }
40
41 function deleteGroup(name: string) {
42 const newGroups = groups.filter((el) => el !== name);

Callers 1

GroupsInputFunction · 0.85

Calls 1

setGroupsFunction · 0.85

Tested by

no test coverage detected