import { css } from '@patternfly/react-styles'; import styles from '../../../css/topology-components'; import Point from '../../../geom/Point'; import { ConnectDragSource } from '../../../behavior/dnd-types'; import { getConnectorRotationAngle, getConnectorStartPoint } from './terminalUtils'; interface ConnectorCrossProps { startPoint: Point; endPoint: Point; className?: string; isTarget?: boolean; size?: number; dragRef?: ConnectDragSource; } const ConnectorCross: React.FunctionComponent = ({ startPoint, endPoint, className = '', isTarget = true, size = 14, dragRef }) => { if (!startPoint || !endPoint) { return null; } const width = size / 4; const yDelta = size / 2; const connectorStartPoint = getConnectorStartPoint(startPoint, endPoint, size); const angleDeg = getConnectorRotationAngle(startPoint, endPoint); const classNames = css( styles.topologyConnectorArrow, styles.topologyConnectorCross, className, !isTarget && 'pf-m-source', dragRef && 'pf-m-draggable' ); return ( {isTarget ? ( <> ) : ( )} ); }; export default ConnectorCross;