File size: 1,875 Bytes
64b1da0
 
 
 
4138aee
 
64b1da0
4138aee
64b1da0
4138aee
64b1da0
 
4138aee
 
64b1da0
e3b65ea
 
95ccaf9
e3b65ea
 
 
 
 
 
 
 
 
 
 
4138aee
 
e3b65ea
 
4138aee
 
e3b65ea
 
4138aee
 
e3b65ea
 
4138aee
 
e3b65ea
4138aee
 
 
 
 
 
 
 
 
 
 
b25a0c6
4138aee
 
 
b25a0c6
e3b65ea
64b1da0
e3b65ea
64b1da0
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { Flex } from 'antd';
import classNames from 'classnames';
import { Handle, NodeProps, Position } from 'reactflow';
import { NodeData } from '../../interface';
import { RightHandleStyle } from './handle-icon';
import NodePopover from './popover';

import { get } from 'lodash';
import styles from './index.less';
import NodeHeader from './node-header';

export function RelevantNode({ id, data, selected }: NodeProps<NodeData>) {
  const yes = get(data, 'form.yes');
  const no = get(data, 'form.no');
  return (
    <NodePopover nodeId={id}>
      <section
        className={classNames(styles.logicNode, {
          [styles.selectedNode]: selected,
        })}
      >
        <Handle
          type="target"
          position={Position.Left}
          isConnectable
          className={styles.handle}
          id={'a'}
        ></Handle>
        <Handle
          type="source"
          position={Position.Right}
          isConnectable
          className={styles.handle}
          id={'yes'}
          style={{ ...RightHandleStyle, top: 59 }}
        ></Handle>
        <Handle
          type="source"
          position={Position.Right}
          isConnectable
          className={styles.handle}
          id={'no'}
          style={{ ...RightHandleStyle, top: 112 }}
        ></Handle>
        <NodeHeader
          id={id}
          name={data.name}
          label={data.label}
          className={styles.nodeHeader}
        ></NodeHeader>

        <Flex vertical gap={10}>
          <Flex vertical>
            <div className={styles.relevantLabel}>Yes</div>
            <div className={styles.nodeText}>{yes}</div>
          </Flex>
          <Flex vertical>
            <div className={styles.relevantLabel}>No</div>
            <div className={styles.nodeText}>{no}</div>
          </Flex>
        </Flex>
      </section>
    </NodePopover>
  );
}