(key: string)
| 337 | }; |
| 338 | |
| 339 | const removeExtraWidget = (key: string) => { |
| 340 | setActiveWidgets(prev => { |
| 341 | const next = { ...prev }; |
| 342 | delete next[key]; |
| 343 | return next; |
| 344 | }); |
| 345 | |
| 346 | setLayouts(prev => { |
| 347 | const nextLayouts = { ...prev } as Layouts; |
| 348 | Object.keys(nextLayouts).forEach(bp => { |
| 349 | if (nextLayouts[bp]) { |
| 350 | nextLayouts[bp] = nextLayouts[bp].filter(item => item.i !== key); |
| 351 | } |
| 352 | }); |
| 353 | return nextLayouts; |
| 354 | }); |
| 355 | }; |
| 356 | |
| 357 | const toggleWidget = (key: string) => { |
| 358 | if (key.includes('-') && activeWidgets[key]) { |
no outgoing calls
no test coverage detected