@@ -52,22 +52,24 @@ export default function ContextFiltersButton(props: {
52
52
: "Set context filters" }
53
53
</ Button >
54
54
</ DialogTrigger >
55
- < ContextFilterDialogContent
56
- contextFilters = { props . contextFilters }
57
- isPending = { updateMutation . isPending }
58
- updateFilters = { async ( data ) => {
59
- const promise = updateMutation . mutateAsync ( data ) ;
60
- toast . promise ( promise , {
61
- success : "Context filters updated" ,
62
- error : "Failed to update context filters" ,
63
- } ) ;
55
+ < DialogContent className = "p-0" >
56
+ < ContextFilterDialogContent
57
+ contextFilters = { props . contextFilters }
58
+ isPending = { updateMutation . isPending }
59
+ updateFilters = { async ( data ) => {
60
+ const promise = updateMutation . mutateAsync ( data ) ;
61
+ toast . promise ( promise , {
62
+ success : "Context filters updated" ,
63
+ error : "Failed to update context filters" ,
64
+ } ) ;
64
65
65
- promise . then ( ( ) => {
66
- props . setContextFilters ( data ) ;
67
- setIsOpen ( false ) ;
68
- } ) ;
69
- } }
70
- />
66
+ promise . then ( ( ) => {
67
+ props . setContextFilters ( data ) ;
68
+ setIsOpen ( false ) ;
69
+ } ) ;
70
+ } }
71
+ />
72
+ </ DialogContent >
71
73
</ Dialog >
72
74
) ;
73
75
}
@@ -137,76 +139,74 @@ function ContextFilterDialogContent(props: {
137
139
}
138
140
139
141
return (
140
- < DialogContent className = "p-0" >
141
- < Form { ...form } >
142
- < DialogHeader className = "px-6 pt-6 pb-1" >
143
- < DialogTitle className = "font-semibold text-xl" >
144
- Context Filters
145
- </ DialogTitle >
146
- < DialogDescription className = "text-muted-foreground" >
147
- Provide context information to Nebula for your prompts
148
- </ DialogDescription >
149
- </ DialogHeader >
142
+ < Form { ...form } >
143
+ < DialogHeader className = "px-6 pt-6 pb-1" >
144
+ < DialogTitle className = "font-semibold text-xl" >
145
+ Context Filters
146
+ </ DialogTitle >
147
+ < DialogDescription className = "text-muted-foreground" >
148
+ Provide context information to Nebula for your prompts
149
+ </ DialogDescription >
150
+ </ DialogHeader >
150
151
151
- < form onSubmit = { form . handleSubmit ( onSubmit ) } >
152
- < div className = "flex flex-col gap-5 px-6" >
153
- < FormField
154
- control = { form . control }
155
- name = "chainIds"
156
- render = { ( ) => (
157
- < FormItem >
158
- < FormLabel > Chain IDs</ FormLabel >
159
- < FormControl >
160
- < MultiNetworkSelector
161
- selectedChainIds = { form
162
- . watch ( )
163
- . chainIds . split ( "," )
164
- . filter ( Boolean )
165
- . map ( Number ) }
166
- onChange = { ( values ) => {
167
- console . log ( "values" , values ) ;
168
- form . setValue ( "chainIds" , values . join ( "," ) ) ;
169
- } }
170
- />
171
- </ FormControl >
172
- < FormMessage />
173
- </ FormItem >
174
- ) }
175
- />
152
+ < form onSubmit = { form . handleSubmit ( onSubmit ) } >
153
+ < div className = "flex flex-col gap-5 px-6" >
154
+ < FormField
155
+ control = { form . control }
156
+ name = "chainIds"
157
+ render = { ( ) => (
158
+ < FormItem >
159
+ < FormLabel > Chain IDs</ FormLabel >
160
+ < FormControl >
161
+ < MultiNetworkSelector
162
+ selectedChainIds = { form
163
+ . watch ( )
164
+ . chainIds . split ( "," )
165
+ . filter ( Boolean )
166
+ . map ( Number ) }
167
+ onChange = { ( values ) => {
168
+ console . log ( "values" , values ) ;
169
+ form . setValue ( "chainIds" , values . join ( "," ) ) ;
170
+ } }
171
+ />
172
+ </ FormControl >
173
+ < FormMessage />
174
+ </ FormItem >
175
+ ) }
176
+ />
176
177
177
- < FormField
178
- control = { form . control }
179
- name = "contractAddresses"
180
- render = { ( { field } ) => (
181
- < FormItem >
182
- < FormLabel > Contract Addresses</ FormLabel >
183
- < FormControl >
184
- < AutoResizeTextarea
185
- { ...field }
186
- placeholder = "0x123..., 0x456..."
187
- className = "min-h-[32px] resize-none"
188
- />
189
- </ FormControl >
190
- < FormDescription >
191
- Comma separated list of contract addresses
192
- </ FormDescription >
193
- < FormMessage />
194
- </ FormItem >
195
- ) }
196
- />
197
- </ div >
178
+ < FormField
179
+ control = { form . control }
180
+ name = "contractAddresses"
181
+ render = { ( { field } ) => (
182
+ < FormItem >
183
+ < FormLabel > Contract Addresses</ FormLabel >
184
+ < FormControl >
185
+ < AutoResizeTextarea
186
+ { ...field }
187
+ placeholder = "0x123..., 0x456..."
188
+ className = "min-h-[32px] resize-none"
189
+ />
190
+ </ FormControl >
191
+ < FormDescription >
192
+ Comma separated list of contract addresses
193
+ </ FormDescription >
194
+ < FormMessage />
195
+ </ FormItem >
196
+ ) }
197
+ />
198
+ </ div >
198
199
199
- < div className = "mt-10 flex justify-end gap-3 border-t bg-muted/50 p-6" >
200
- < DialogClose asChild >
201
- < Button variant = "outline" > Cancel</ Button >
202
- </ DialogClose >
203
- < Button className = "min-w-28 gap-2" type = "submit" >
204
- { props . isPending && < Spinner className = "size-4" /> }
205
- Update
206
- </ Button >
207
- </ div >
208
- </ form >
209
- </ Form >
210
- </ DialogContent >
200
+ < div className = "mt-10 flex justify-end gap-3 border-t bg-muted/50 p-6" >
201
+ < DialogClose asChild >
202
+ < Button variant = "outline" > Cancel</ Button >
203
+ </ DialogClose >
204
+ < Button className = "min-w-28 gap-2" type = "submit" >
205
+ { props . isPending && < Spinner className = "size-4" /> }
206
+ Update
207
+ </ Button >
208
+ </ div >
209
+ </ form >
210
+ </ Form >
211
211
) ;
212
212
}
0 commit comments