/*
 * @Author: your name
 * @Date: 2022-04-02 11:19:40
 * @LastEditTime: 2022-04-11 14:37:51
 * @LastEditors: Nian Yi
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /easyvadmin/src/scripts/components/EasyvNodeCard/Endpoint.tsx
 */
import React from 'react';
import { Handle, Position } from '@easyv/react-flow-renderer';

function EasyvEndpoint({ nodeId, id, text, type }) {
  const isEvent = type === 'event';
  return (
    <li key={id}>
      {isEvent ? <span style={{ marginRight: 8 }}>{text}</span> : null}
      <Handle type={isEvent ? 'source' : 'target'} position={isEvent ? Position.Right : Position.Left} id={id}></Handle>
      {!isEvent ? <span style={{ marginLeft: 8 }}>{text}</span> : null}
    </li>
  );
}

export default EasyvEndpoint;
