Skip to content

Commit 68d4a96

Browse files
author
Maddie
committed
remove source node on click, always active
1 parent 5147458 commit 68d4a96

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

frontend/components/nodes/source-node.tsx

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
import { useGlobalContext } from '@/context/GlobalContext';
22
import { Handle, Position } from '@xyflow/react';
3-
import { useState } from 'react';
43

54
export 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}

0 commit comments

Comments
 (0)