/********************************************************************* * © Copyright IBM Corp. 2024 *********************************************************************/ import React from 'react' import PropTypes from 'prop-types' import {IconsGeneralColor, Impediment} from '@targetprocess/css-variables' export const Types = { RELATION: 'relation', DEPENDENCY: 'dependency', DUPLICATE: 'duplicate', BLOCKER: 'blocker', LINK: 'link' } as const export const RelationIcon = ({ color = IconsGeneralColor, type = Types.RELATION as typeof Types[keyof typeof Types] }) => ( {type === Types.RELATION && ( )} {type === Types.DEPENDENCY && ( )} {type === Types.BLOCKER && ( )} {type === Types.DUPLICATE && ( )} {type === Types.LINK && ( )} ) RelationIcon.category = 'Entity' RelationIcon.propTypes = { // hasOwnProperty explicitly called here // eslint-disable-next-line security/detect-object-injection type: PropTypes.oneOf(Object.keys(Types).map(key => Types[key])), color: PropTypes.string } RelationIcon.Types = Types