(name: string)
| 38 | }; |
| 39 | |
| 40 | const handleToggle = async (name: string) => { |
| 41 | try { |
| 42 | await togglePlugin(name); |
| 43 | const plugin = plugins.find(p => p.name === name); |
| 44 | toast.success(`${name} ${plugin?.enabled ? "disabled" : "enabled"}`); |
| 45 | } catch (err: any) { |
| 46 | const msg = err.response?.data?.error || err.message || "Unknown error"; |
| 47 | toast.error(`Failed to toggle plugin: ${msg}`); |
| 48 | } |
| 49 | }; |
| 50 | |
| 51 | const handleDelete = async (name: string, type: 'file' | 'npm') => { |
| 52 | if (!confirm(`Delete ${name}?`)) return; |
no test coverage detected