@@ -21,7 +21,7 @@ import { RadioGroup, RadioGroupItem } from "./components/ui/radio-group"
21
21
import { Label } from "./components/Label/Label" ;
22
22
import { Checkbox } from "./components/Checkbox/Checkbox" ;
23
23
import { Textarea } from "./components/Textarea/Textarea" ;
24
-
24
+ import { Badge } from "./components/Badge/Badge" ;
25
25
export function DynamicForm ( ) {
26
26
const serverAddress = "localhost:8100" ;
27
27
const [ user , setUser ] = useState < string > ( "" ) ;
@@ -189,8 +189,9 @@ export function DynamicForm() {
189
189
return (
190
190
< div key = { param . name } className = "flex flex-col gap-2 items-center" >
191
191
< label >
192
- { param . display_name || param . name }
193
192
{ param . icon && < img src = { param . icon } alt = "" style = { { marginLeft : 6 } } /> }
193
+ < span className = "mr-2" > { param . display_name || param . name } </ span >
194
+ { ! param . mutable && < Badge variant = "warning" size = "sm" > Immutable</ Badge > }
194
195
</ label >
195
196
{ param . description && < div className = "text-sm" > { param . description } </ div > }
196
197
< Controller
@@ -225,8 +226,9 @@ export function DynamicForm() {
225
226
return (
226
227
< div key = { param . name } className = "flex flex-col gap-2 items-center" >
227
228
< label >
228
- { param . display_name || param . name }
229
229
{ param . icon && < img src = { param . icon } alt = "" style = { { marginLeft : 6 } } /> }
230
+ < span className = "mr-2" > { param . display_name || param . name } </ span >
231
+ { ! param . mutable && < Badge variant = "warning" size = "sm" > Immutable</ Badge > }
230
232
</ label >
231
233
{ param . description && < div className = "text-sm" > { param . description } </ div > }
232
234
< Controller
@@ -268,8 +270,9 @@ export function DynamicForm() {
268
270
< div key = { param . name } className = "flex flex-col gap-2 items-center" >
269
271
< div className = "flex items-center justify-between gap-2" >
270
272
< label >
271
- { param . display_name || param . name }
272
273
{ param . icon && < img src = { param . icon } alt = "" style = { { marginLeft : 6 } } /> }
274
+ < span className = "mr-2" > { param . display_name || param . name } </ span >
275
+ { ! param . mutable && < Badge variant = "warning" size = "sm" > Immutable</ Badge > }
273
276
</ label >
274
277
< output className = "text-sm font-medium tabular-nums" > { parameterValue ( param . value ) } </ output >
275
278
</ div >
@@ -295,8 +298,9 @@ export function DynamicForm() {
295
298
< div key = { param . name } className = "flex flex-col gap-2 items-center" >
296
299
< div className = "flex items-center justify-between gap-2" >
297
300
< label >
298
- { param . display_name || param . name }
299
301
{ param . icon && < img src = { param . icon } alt = "" style = { { marginLeft : 6 } } /> }
302
+ < span className = "mr-2" > { param . display_name || param . name } </ span >
303
+ { ! param . mutable && < Badge variant = "warning" size = "sm" > Immutable</ Badge > }
300
304
</ label >
301
305
</ div >
302
306
{ param . description && < div className = "text-sm" > { param . description } </ div > }
@@ -326,8 +330,9 @@ export function DynamicForm() {
326
330
< div key = { param . name } className = "flex flex-col gap-2 items-center" >
327
331
< div className = "flex items-center justify-between gap-2" >
328
332
< label >
329
- { param . display_name || param . name }
330
333
{ param . icon && < img src = { param . icon } alt = "" style = { { marginLeft : 6 } } /> }
334
+ < span className = "mr-2" > { param . display_name || param . name } </ span >
335
+ { ! param . mutable && < Badge variant = "warning" size = "sm" > Immutable</ Badge > }
331
336
</ label >
332
337
</ div >
333
338
{ param . description && < div className = "text-sm" > { param . description } </ div > }
@@ -351,8 +356,9 @@ export function DynamicForm() {
351
356
< div key = { param . name } className = "flex flex-col gap-2 items-center" >
352
357
< div className = "flex items-center justify-between gap-2" >
353
358
< label >
354
- { param . display_name || param . name }
355
359
{ param . icon && < img src = { param . icon } alt = "" style = { { marginLeft : 6 } } /> }
360
+ < span className = "mr-2" > { param . display_name || param . name } </ span >
361
+ { ! param . mutable && < Badge variant = "warning" size = "sm" > Immutable</ Badge > }
356
362
</ label >
357
363
</ div >
358
364
{ param . description && < div className = "text-sm" > { param . description } </ div > }
@@ -372,8 +378,9 @@ export function DynamicForm() {
372
378
< div key = { param . name } className = "flex flex-col gap-2 items-center" >
373
379
< div className = "flex items-center justify-between gap-2" >
374
380
< label >
375
- { param . display_name || param . name }
376
381
{ param . icon && < img src = { param . icon } alt = "" style = { { marginLeft : 6 } } /> }
382
+ < span className = "mr-2" > { param . display_name || param . name } </ span >
383
+ { ! param . mutable && < Badge variant = "warning" size = "sm" > Immutable</ Badge > }
377
384
</ label >
378
385
</ div >
379
386
{ param . description && < div className = "text-sm" > { param . description } </ div > }
@@ -452,7 +459,6 @@ export function DynamicForm() {
452
459
} }
453
460
className = "w-[300px]"
454
461
type = { mapParamTypeToInputType ( param . type ) }
455
- // value={field.value}
456
462
defaultValue = { parameterValue ( param . default_value ) }
457
463
disabled = { ( param . form_type_metadata as { disabled ?: boolean } ) ?. disabled }
458
464
/>
0 commit comments