@@ -20,7 +20,7 @@ import EditNodeDialog from '@/views/agentflowsv2/EditNodeDialog'
20
20
import { flowContext } from '@/store/context/ReactFlowContext'
21
21
22
22
// icons
23
- import { IconMagnetFilled , IconMagnetOff } from '@tabler/icons-react'
23
+ import { IconMagnetFilled , IconMagnetOff , IconArtboard , IconArtboardOff } from '@tabler/icons-react'
24
24
25
25
const nodeTypes = { agentFlow : AgentFlowNode , stickyNote : StickyNote , iteration : IterationNode }
26
26
const edgeTypes = { agentFlow : AgentFlowEdge }
@@ -42,6 +42,7 @@ const MarketplaceCanvasV2 = () => {
42
42
const [ editNodeDialogOpen , setEditNodeDialogOpen ] = useState ( false )
43
43
const [ editNodeDialogProps , setEditNodeDialogProps ] = useState ( { } )
44
44
const [ isSnappingEnabled , setIsSnappingEnabled ] = useState ( false )
45
+ const [ isBackgroundEnabled , setIsBackgroundEnabled ] = useState ( true )
45
46
46
47
const reactFlowWrapper = useRef ( null )
47
48
const { setReactFlowInstance } = useContext ( flowContext )
@@ -136,8 +137,18 @@ const MarketplaceCanvasV2 = () => {
136
137
>
137
138
{ isSnappingEnabled ? < IconMagnetFilled /> : < IconMagnetOff /> }
138
139
</ button >
140
+ < button
141
+ className = 'react-flow__controls-button react-flow__controls-interactive'
142
+ onClick = { ( ) => {
143
+ setIsBackgroundEnabled ( ! isBackgroundEnabled )
144
+ } }
145
+ title = 'toggle background'
146
+ aria-label = 'toggle background'
147
+ >
148
+ { isBackgroundEnabled ? < IconArtboard /> : < IconArtboardOff /> }
149
+ </ button >
139
150
</ Controls >
140
- < Background color = '#aaa' gap = { 16 } />
151
+ { isBackgroundEnabled && < Background color = '#aaa' gap = { 16 } /> }
141
152
< EditNodeDialog
142
153
show = { editNodeDialogOpen }
143
154
dialogProps = { editNodeDialogProps }
0 commit comments