import React, { ReactElement } from 'react'; import css from '../../utils/css'; import { CommonProps } from '../common'; import { StatisticContainer, StyledTitleWrapper, StyledContentWrapper, StyledPrefixWrapper, StyledValueWrapper, StyledSuffixWrapper, } from './StyledStatistic'; export interface StatisticProps extends CommonProps { /** * Alignment between title and content. */ align?: 'left' | 'right'; /** * Text color of the content. */ intent?: 'text' | 'white' | 'inherit'; /** * The prefix element of value. */ prefix?: string | ReactElement; /** * The suffix element of value. */ suffix?: string | ReactElement; /** * Title of Statistic. */ title: string; /** * Value to be displayed. */ value: string | ReactElement; } const Statistic = ({ align = 'right', intent = 'text', suffix, prefix, title, value, id, className, style, sx = {}, 'data-test-id': dataTestId, }: StatisticProps): ReactElement => { return ( {title} {prefix !== undefined && ( {prefix} )} {value} {suffix !== undefined && ( {suffix} )} ); }; export default Statistic;