import * as React from 'react' import styled from 'styled-components' import type { IconProps } from '@planview/pv-icons' import { Help } from '@planview/pv-icons' import { Tooltip } from '@planview/pv-uikit' import { theme, iconSizes } from '@planview/pv-utilities' const LabelIcon = styled.span` display: inline-block; vertical-align: middle; /* This prevents the icon from changing the height of the label wrapper */ margin: -2px 0 0; position: relative; top: 1px; ` const Icon = ({ icon, tooltip, }: { icon?: React.ReactElement tooltip?: string }) => ( {icon ? ( React.cloneElement(icon, { size: iconSizes.SIZE_XSMALL, color: icon.props.color || theme.iconNormal, }) ) : ( )} ) export default Icon