import React, { ReactElement } from 'react'; import css from '../../utils/css'; import Icon from '../Icon'; import { CommonProps } from '../common'; import { Background, Info, ProgressPercentage, Wrapper, } from './StyledProgressBar'; export interface ProgressBarProps extends CommonProps { intent: 'primary' | 'danger' | 'success' | 'warning' | 'error'; size: 'small' | 'medium'; status: 'active' | 'exception' | 'custom'; value: number; withInfo: boolean; } const ProgressBar = ({ intent, size, status, withInfo, value, id, className, style, sx = {}, 'data-test-id': dataTestId, }: ProgressBarProps): ReactElement => { return ( {withInfo === true && ( {status === 'exception' && ( )} {status === 'active' && value === 100 && ( )} {((status === 'active' && value < 100) || status === 'custom') && `${value}%`} )} ); }; export default ProgressBar;