@@ -34,6 +34,36 @@ type ClientClaudeCodeProps = {
3434 mcpServer : MCPServer ;
3535} ;
3636
37+ // Drives the scope Select's items, options, config file, and help text.
38+ const SCOPE_OPTIONS = [
39+ {
40+ value : 'local' ,
41+ label : 'Local' ,
42+ configFile : '~/.claude.json' ,
43+ description : 'Configuration stored locally for this project only' ,
44+ } ,
45+ {
46+ value : 'user' ,
47+ label : 'User' ,
48+ configFile : '~/.claude.json' ,
49+ description : (
50+ < Text as = "span" >
51+ Configuration available across all your projects in < InlineCode > ~/.claude.json</ InlineCode >
52+ </ Text >
53+ ) ,
54+ } ,
55+ {
56+ value : 'project' ,
57+ label : 'Project' ,
58+ configFile : '.mcp.json' ,
59+ description : (
60+ < Text as = "span" >
61+ Configuration shared with team using < InlineCode > .mcp.json</ InlineCode > file in project
62+ </ Text >
63+ ) ,
64+ } ,
65+ ] as const ;
66+
3767export const ClientClaudeCode = ( { mcpServer } : ClientClaudeCodeProps ) => {
3868 const [ selectedScope , setSelectedScope ] = useState < string > ( 'local' ) ;
3969
@@ -56,6 +86,8 @@ export const ClientClaudeCode = ({ mcpServer }: ClientClaudeCodeProps) => {
5686 isServerless : config . isServerless ,
5787 } ) ;
5888
89+ const selectedScopeOption = SCOPE_OPTIONS . find ( ( option ) => option . value === selectedScope ) ;
90+
5991 return (
6092 < div className = "space-y-4" >
6193 < div className = "flex flex-col gap-4" >
@@ -74,32 +106,24 @@ export const ClientClaudeCode = ({ mcpServer }: ClientClaudeCodeProps) => {
74106 </ div >
75107 < Label className = "font-medium text-sm" > Scope</ Label >
76108 < div >
77- < Select onValueChange = { setSelectedScope } value = { selectedScope } >
109+ < Select items = { SCOPE_OPTIONS } onValueChange = { setSelectedScope } value = { selectedScope } >
78110 < SelectTrigger className = "w-[180px]" >
79111 < SelectValue placeholder = "Select scope" />
80112 </ SelectTrigger >
81113 < SelectContent >
82114 < SelectGroup >
83115 < SelectLabel > Configuration Scope</ SelectLabel >
84- < SelectItem value = "local" > Local</ SelectItem >
85- < SelectItem value = "user" > User</ SelectItem >
86- < SelectItem value = "project" > Project</ SelectItem >
116+ { SCOPE_OPTIONS . map ( ( option ) => (
117+ < SelectItem key = { option . value } value = { option . value } >
118+ { option . label }
119+ </ SelectItem >
120+ ) ) }
87121 </ SelectGroup >
88122 </ SelectContent >
89123 </ Select >
90124 </ div >
91125 < Text className = "text-muted-foreground" variant = "small" >
92- { selectedScope === 'local' && 'Configuration stored locally for this project only' }
93- { selectedScope === 'project' && (
94- < Text as = "span" >
95- Configuration shared with team using < InlineCode > .mcp.json</ InlineCode > file in project
96- </ Text >
97- ) }
98- { selectedScope === 'user' && (
99- < Text as = "span" >
100- Configuration available across all your projects in < InlineCode > ~/.claude.json</ InlineCode >
101- </ Text >
102- ) }
126+ { selectedScopeOption ?. description }
103127 </ Text >
104128 </ div >
105129 </ ListItem >
@@ -112,9 +136,7 @@ export const ClientClaudeCode = ({ mcpServer }: ClientClaudeCodeProps) => {
112136 < ListItem >
113137 < div className = "flex flex-wrap items-center gap-1" >
114138 < span > Alternatively, you can manually update</ span >
115- { selectedScope === 'local' && < InlineCode className = "whitespace-nowrap" > ~/.claude.json</ InlineCode > }
116- { selectedScope === 'user' && < InlineCode className = "whitespace-nowrap" > ~/.claude.json</ InlineCode > }
117- { selectedScope === 'project' && < InlineCode className = "whitespace-nowrap" > .mcp.json</ InlineCode > }
139+ < InlineCode className = "whitespace-nowrap" > { selectedScopeOption ?. configFile } </ InlineCode >
118140 < span > with:</ span >
119141 </ div >
120142 < DynamicCodeBlock code = { claudeCodeConfigJson } lang = "json" />
0 commit comments