import { forwardRef } from 'react'; import { css } from '@patternfly/react-styles'; import styles from '../../../css/topology-components'; interface LabelIconProps { className?: string; x: number; y: number; width: number; height: number; padding?: number; iconClass?: string; icon?: React.ReactNode; innerRef?: React.Ref; } const LabelIcon = forwardRef( ({ className, x, y, width, height, iconClass, icon, padding = 4, innerRef }, circleRef) => { const radius = width / 2; const cx = x - radius; const cy = y + height / 2; const innerX = x - width + padding + 1; const innerY = y + padding + 1; const innerWidth = width - padding * 2 - 2; // -2 for 1px border on each side const innerHeight = height - padding * 2 - 2; // -2 for 1px border on each side return ( {icon ? ( {icon} ) : ( )} ); } ); export default LabelIcon;