()
| 202 | const [resetting, setResetting] = useState(null); |
| 203 | |
| 204 | const handleCreate = async () => { |
| 205 | if (!newName.trim()) { |
| 206 | showToast('Enter a collection name', 'error'); |
| 207 | return; |
| 208 | } |
| 209 | setCreating(true); |
| 210 | try { |
| 211 | await collectionsApi.create(newName.trim()); |
| 212 | showToast(`Collection "${newName}" created`, 'success'); |
| 213 | setNewName(''); |
| 214 | onRefresh(); |
| 215 | } catch (err) { |
| 216 | showToast(err.message || 'Failed to create collection', 'error'); |
| 217 | } finally { |
| 218 | setCreating(false); |
| 219 | } |
| 220 | }; |
| 221 | |
| 222 | const handleReset = async (name) => { |
| 223 | if (!confirm(`Reset collection "${name}"? This removes all entries and cannot be undone.`)) return; |
no test coverage detected
searching dependent graphs…