import React from 'react'; import { ColorTokens } from '../../foundation/Colors'; import { TypographyTokens } from '../../foundation/Typography'; import { Typography } from '../Typography'; import { TypographyWithTooltip, TypographyWithTooltipProps } from '../TypographyWithTooltip'; import { AttentionIndicatorStyled } from './TooltipLabel.styled'; type TooltipLabelProps = { attentionIndicatorColorToken?: ColorTokens; 'data-testid'?: string; label?: React.ComponentProps['children']; labelColorToken?: ColorTokens; labelTypographyToken?: TypographyTokens; tooltip?: TypographyWithTooltipProps['tooltip']; tooltipColorToken?: ColorTokens; }; export const TooltipLabel: React.FC = ({ tooltip, label, labelColorToken, tooltipColorToken, labelTypographyToken, 'data-testid': dataTestId, attentionIndicatorColorToken, }) => { if (tooltip && label && labelColorToken && labelTypographyToken) { return ( {attentionIndicatorColorToken ? ( ) : null} {label} ); } if (label && labelColorToken && labelTypographyToken) { return ( {attentionIndicatorColorToken ? ( ) : null} {label} ); } return null; };