File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
webview-ui/src/components/mcp Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 11import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
2+ import { FormEvent } from "react"
23import { useExtensionState } from "../../context/ExtensionStateContext"
34import { vscode } from "../../utils/vscode"
45
56const McpEnabledToggle = ( ) => {
67 const { mcpEnabled, setMcpEnabled } = useExtensionState ( )
78
9+ const handleChange = ( e : Event | FormEvent < HTMLElement > ) => {
10+ const target = ( 'target' in e ? e . target : null ) as HTMLInputElement | null
11+ if ( ! target ) return
12+ setMcpEnabled ( target . checked )
13+ vscode . postMessage ( { type : "mcpEnabled" , bool : target . checked } )
14+ }
15+
816 return (
917 < div style = { { marginBottom : "20px" } } >
1018 < VSCodeCheckbox
1119 checked = { mcpEnabled }
12- onChange = { ( e : any ) => {
13- setMcpEnabled ( e . target . checked )
14- vscode . postMessage ( { type : "mcpEnabled" , bool : e . target . checked } )
15- } } >
20+ onChange = { handleChange } >
1621 < span style = { { fontWeight : "500" } } > Enable MCP Servers</ span >
1722 </ VSCodeCheckbox >
1823 < p style = { {
You can’t perform that action at this time.
0 commit comments