All files / src/components/mcp/chat-display McpDisplayModeDropdown.tsx

28.57% Statements 4/14
100% Branches 0/0
0% Functions 0/1
28.57% Lines 4/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30  1x 1x                     1x                             1x  
import { McpDisplayMode } from "@shared/McpDisplayMode"
import { VSCodeDropdown, VSCodeOption } from "@vscode/webview-ui-toolkit/react"
import React from "react"
 
interface McpDisplayModeDropdownProps {
	value: McpDisplayMode
	onChange: (mode: McpDisplayMode) => void
	id?: string
	className?: string
	style?: React.CSSProperties
	onClick?: (e: React.MouseEvent) => void
}
 
const McpDisplayModeDropdown: React.FC<McpDisplayModeDropdownProps> = ({ value, onChange, id, className, style, onClick }) => {
	const handleChange = (e: any) => {
		const newMode = e.target.value as McpDisplayMode
		onChange(newMode)
	}
 
	return (
		<VSCodeDropdown className={className} id={id} onChange={handleChange} onClick={onClick} style={style} value={value}>
			<VSCodeOption value="plain">Plain Text</VSCodeOption>
			<VSCodeOption value="rich">Rich Display</VSCodeOption>
			<VSCodeOption value="markdown">Markdown</VSCodeOption>
		</VSCodeDropdown>
	)
}
 
export default McpDisplayModeDropdown