File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,31 @@ const ToolsTab = ({
174174 }
175175 className = "mt-1"
176176 />
177+ ) :
178+ /* @ts -expect-error value type is currently unknown */
179+ value . type === "object" ? (
180+ < Textarea
181+ id = { key }
182+ name = { key }
183+ // @ts -expect-error value type is currently unknown
184+ placeholder = { value . description }
185+ onChange = { ( e ) => {
186+ try {
187+ const parsed = JSON . parse ( e . target . value ) ;
188+ setParams ( {
189+ ...params ,
190+ [ key ] : parsed ,
191+ } ) ;
192+ } catch ( err ) {
193+ // If invalid JSON, store as string - will be validated on submit
194+ setParams ( {
195+ ...params ,
196+ [ key ] : e . target . value ,
197+ } ) ;
198+ }
199+ } }
200+ className = "mt-1"
201+ />
177202 ) : (
178203 < Input
179204 // @ts -expect-error value type is currently unknown
You can’t perform that action at this time.
0 commit comments