feat(core): add connection status to connection lines
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { ConnectionMode } from '~/types'
|
||||
import type {
|
||||
Actions,
|
||||
Connection,
|
||||
ConnectionStatus,
|
||||
GraphEdge,
|
||||
GraphNode,
|
||||
HandleType,
|
||||
@@ -160,3 +161,15 @@ export function getHandleType(edgeUpdaterType: HandleType | undefined, handleDom
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export function getConnectionStatus(isInsideConnectionRadius: boolean, isHandleValid: boolean) {
|
||||
let connectionStatus: ConnectionStatus | null = null
|
||||
|
||||
if (isHandleValid) {
|
||||
connectionStatus = 'valid'
|
||||
} else if (isInsideConnectionRadius && !isHandleValid) {
|
||||
connectionStatus = 'invalid'
|
||||
}
|
||||
|
||||
return connectionStatus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user