import { Game, Resource } from "@incgame/engine"; import { GraphNode } from "../ui/graph"; type Props = { game: Game, from: { node: GraphNode, resource: Resource }, to: { node: GraphNode, resource: Resource }, } export const LinkLine = function ({ from, to }: Props) { const markerId = `node-line-arrow-${from.node.entity.id}-${to.node.entity.id}`.replace(/[^a-zA-Z0-9_-]/g, '_'); const fromSocket = from.node.entity.getDisplayInfo().sockets.find((s) => s.type === 'input' && s.resource == from.resource); const toSocket = to.node.entity.getDisplayInfo().sockets.find((s) => s.type === 'output' && s.resource == to.resource); if (!fromSocket || !toSocket) return null; return ( ); };