import React from 'react'; import type { NsGraph } from '@antv/xflow'; import type { RelationCanvasModel } from '../interface'; import { Popover, Popconfirm, Tooltip } from 'antd'; import { ScissorOutlined } from '@ant-design/icons'; import _ from 'lodash'; import './Relation.less'; interface OwnProps { deleteRelation: Function; } type Props = OwnProps & NsGraph.IReactEdgeProps; const Relation = (props: Props) => { const relation: RelationCanvasModel = props?.data; const renderRelationOperationItem = (relation: RelationCanvasModel) => { const sourcePropertyName = relation?.source; const targetPropertyName = relation?.target; return (
{sourcePropertyName} (N:1) {targetPropertyName}
{ props?.deleteRelation(relation.id); }} >
); }; const renderPopoverContent = () => { return (
{renderRelationOperationItem(relation)}
); }; return (
{1}
); }; export default Relation;