(exampleConfig: Record<string, ServerConfig>)
| 96 | }, [agentState]); |
| 97 | |
| 98 | const handleExampleConfig = (exampleConfig: Record<string, ServerConfig>) => { |
| 99 | // Merge the example with existing configs or replace them based on user preference |
| 100 | if (Object.keys(configs).length > 0) { |
| 101 | const shouldReplace = window.confirm( |
| 102 | "Do you want to replace your current configuration with this example? Click 'OK' to replace, or 'Cancel' to merge." |
| 103 | ); |
| 104 | |
| 105 | if (shouldReplace) { |
| 106 | setConfigs(exampleConfig); |
| 107 | } else { |
| 108 | setConfigs({ ...configs, ...exampleConfig }); |
| 109 | } |
| 110 | } else { |
| 111 | setConfigs(exampleConfig); |
| 112 | } |
| 113 | |
| 114 | // Close the examples panel after selection |
| 115 | setShowExampleConfigs(false); |
| 116 | }; |
| 117 | |
| 118 | const addConfig = () => { |
| 119 | if (!serverName) return; |
nothing calls this directly
no test coverage detected