File tree Expand file tree Collapse file tree 1 file changed +5
-19
lines changed
frontend/components/nodes Expand file tree Collapse file tree 1 file changed +5
-19
lines changed Original file line number Diff line number Diff line change 11import { useGlobalContext } from '@/context/GlobalContext' ;
22import { Handle , Position } from '@xyflow/react' ;
3- import { useState } from 'react' ;
43
54export default function SourceNode ( ) {
6- const [ isConnected , setIsConnected ] = useState ( false ) ;
75 const { dataStreaming } = useGlobalContext ( ) ;
86
9- const handleClick = ( ) => {
10- setIsConnected ( ( prev ) => ! prev ) ;
11- } ;
12-
137 return (
14- < div
15- onClick = { handleClick }
16- className = "relative w-[396px] h-[96px] flex bg-white rounded-[30px] border-2 border-[#D3D3D3] shadow-none p-0"
17- >
8+ < div className = "relative w-[396px] h-[96px] flex bg-white rounded-[30px] border-2 border-[#D3D3D3] shadow-none p-0" >
189 { /* Status dot */ }
1910 < span
20- className = { `absolute left-6 top-1/2 -translate-y-1/2 w-3 h-3 rounded-full ${ dataStreaming && isConnected ? 'bg-[#509693]' : 'bg-[#D3D3D3]' } ` }
11+ className = { `absolute left-6 top-1/2 -translate-y-1/2 w-3 h-3 rounded-full ${ dataStreaming ? 'bg-[#509693]' : 'bg-[#D3D3D3]' } ` }
2112 />
2213
2314 { /* Texts */ }
@@ -29,15 +20,10 @@ export default function SourceNode() {
2920 Headset_001
3021 </ span >
3122 </ div >
32- { /* Right circle */ }
33- < span
34- className = { `absolute right-6 top-1/2 -translate-y-1/2 w-6 h-6 rounded-full flex items-center justify-center border-[3px] ${ isConnected ? 'border-[#000000]' : ' border-[#D3D3D3]' } ` }
35- >
36- { isConnected && (
37- < span className = "w-3 h-3 rounded-full bg-white" />
38- ) }
3923
40- { /* Right source handle */ }
24+ { /* Right circle */ }
25+ < span className = "absolute right-6 top-1/2 -translate-y-1/2 w-6 h-6 rounded-full flex items-center justify-center border-[3px] border-[#000000]" >
26+ < span className = "w-3 h-3 rounded-full bg-white" />
4127 < Handle
4228 type = "source"
4329 position = { Position . Right }
You can’t perform that action at this time.
0 commit comments