File size: 982 Bytes
dcce454 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
import { useCallback } from 'react';
import { Handle, NodeProps, Position } from 'reactflow';
import styles from './index.less';
const handleStyle = { left: 10 };
export function TextUpdaterNode({
data,
isConnectable = true,
}: NodeProps<{ value: number }>) {
const onChange = useCallback((evt) => {
console.log(evt.target.value);
}, []);
return (
<div className={styles.textUpdaterNode}>
<Handle
type="target"
position={Position.Top}
isConnectable={isConnectable}
/>
<Handle
type="source"
position={Position.Bottom}
// style={handleStyle}
isConnectable={isConnectable}
/>
<div>
<label htmlFor="text">Text:</label>
<input id="text" name="text" onChange={onChange} className="nodrag" />
</div>
{/* <Handle
type="source"
position={Position.Bottom}
id="b"
isConnectable={isConnectable}
/> */}
</div>
);
}
|