2
0
Files
bot/apps/builder/components/board/graph/BlockNode/StepNode/SourceEndpoint.tsx
Baptiste Arnaud da9459edf3 Add Graph draft
2021-12-16 10:51:59 +01:00

27 lines
557 B
TypeScript

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}
/>
)
}