You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.tsx 1020B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import classNames from 'classnames';
  2. import { Handle, NodeProps, Position } from 'reactflow';
  3. import { NodeData } from '../../interface';
  4. import { LeftHandleStyle, RightHandleStyle } from './handle-icon';
  5. import styles from './index.less';
  6. import NodeHeader from './node-header';
  7. export function RagNode({
  8. id,
  9. data,
  10. isConnectable = true,
  11. selected,
  12. }: NodeProps<NodeData>) {
  13. return (
  14. <section
  15. className={classNames(styles.ragNode, {
  16. [styles.selectedNode]: selected,
  17. })}
  18. >
  19. <Handle
  20. id="c"
  21. type="source"
  22. position={Position.Left}
  23. isConnectable={isConnectable}
  24. className={styles.handle}
  25. style={LeftHandleStyle}
  26. ></Handle>
  27. <Handle
  28. type="source"
  29. position={Position.Right}
  30. isConnectable={isConnectable}
  31. className={styles.handle}
  32. id="b"
  33. style={RightHandleStyle}
  34. ></Handle>
  35. <NodeHeader id={id} name={data.name} label={data.label}></NodeHeader>
  36. </section>
  37. );
  38. }