2
0

Add Graph draft

This commit is contained in:
Baptiste Arnaud
2021-12-16 10:43:49 +01:00
parent 0f85d2cd94
commit da9459edf3
35 changed files with 1938 additions and 116 deletions

View File

@@ -0,0 +1,26 @@
import { Box, BoxProps } from '@chakra-ui/react'
import React, { MouseEvent } from 'react'
export const SourceEndpoint = ({
onConnectionDragStart,
...props
}: BoxProps & {
onConnectionDragStart?: () => void
}) => {
const handleMouseDown = (e: MouseEvent<HTMLDivElement>) => {
if (!onConnectionDragStart) return
e.stopPropagation()
onConnectionDragStart()
}
return (
<Box
boxSize="15px"
rounded="full"
bgColor="gray.500"
onMouseDown={handleMouseDown}
cursor="pointer"
{...props}
/>
)
}