import styled from 'styled-components'; import { spacing } from '../../spacing'; import { fontWeight } from '../../style/theme'; type TextBadgeVariant = | 'statusHealthy' | 'statusWarning' | 'statusCritical' | 'infoPrimary' | 'infoSecondary' | 'selectedActive'; const StyledTextBadge = styled.span<{ variant: TextBadgeVariant }>` ${({ theme, variant }) => ` background-color: ${theme[variant]}; color: ${ variant === 'infoSecondary' ? theme.textPrimary : theme.textReverse }; padding: 2px ${spacing.r4}; border-radius: 4px; font-size: 0.9rem; font-weight: ${fontWeight.bold}; margin: 0 ${spacing.r4} 0 ${spacing.r4}; `} `; type Props = { text: React.ReactNode; className?: string; variant?: TextBadgeVariant; } & React.HTMLAttributes; export function TextBadge({ text, variant = 'infoPrimary', className, ...rest }: Props) { return ( {text} ); }