(id: string)
| 32 | }; |
| 33 | |
| 34 | const handleDelete = (id: string) => { |
| 35 | if (mods.length <= 1) return; |
| 36 | const items = { ...col.items }; |
| 37 | delete items[id]; |
| 38 | const newActiveId = col.activeId === id ? Object.keys(items)[0] : col.activeId; |
| 39 | setCol({ activeId: newActiveId, items }); |
| 40 | if (editingId === id) setEditingId(null); |
| 41 | }; |
| 42 | |
| 43 | const handleAdd = () => { |
| 44 | const id = generateModId(); |