File tree Expand file tree Collapse file tree
web/src/components/workflow/widgets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export class RadioGroupNode extends ExecutableNode {
5656
5757 async execute ( context : NodeContext ) : Promise < NodeExecution > {
5858 try {
59+ console . log ( context . inputs ) ;
5960 const options = context . inputs . options as RadioOption [ ] ;
6061 const value = context . inputs . value as string ;
6162
Original file line number Diff line number Diff line change 1+ import { useState } from "react" ;
2+
13import { Label } from "@/components/ui/label" ;
24import { RadioGroup , RadioGroupItem } from "@/components/ui/radio-group" ;
35import { cn } from "@/utils/utils" ;
@@ -23,15 +25,20 @@ export function RadioGroupWidget({
2325 className,
2426 compact = false ,
2527} : RadioGroupWidgetProps ) {
28+ const [ value , setValue ] = useState ( config . value ) ;
29+
2630 return (
2731 < div className = { cn ( "space-y-2" , className ) } >
2832 < RadioGroup
29- value = { config . value }
30- onValueChange = { onChange }
33+ value = { value }
34+ onValueChange = { ( value ) => {
35+ setValue ( value ) ;
36+ onChange ( value ) ;
37+ } }
3138 className = { cn ( "flex flex-col gap-2" , compact && "gap-1" ) }
3239 >
33- { config . options . map ( ( option ) => (
34- < div key = { option . value } className = "flex items-center space-x-2" >
40+ { config . options . map ( ( option , i ) => (
41+ < div key = { i } className = "flex items-center space-x-2" >
3542 < RadioGroupItem value = { option . value } id = { option . value } />
3643 < Label htmlFor = { option . value } > { option . label } </ Label >
3744 </ div >
You can’t perform that action at this time.
0 commit comments