wix-style-react
Version:
wix-style-react
24 lines • 912 B
JavaScript
import React from 'react';
import Text from '../../Text';
import { convertToPercentageString, } from './CircularProgressBarCore';
import { Size, sizesMap } from '../constants';
const labelSkinMap = {
standard: 'primary',
premium: 'premium',
success: 'success',
};
const labelSizeMap = {
small: undefined,
medium: 'tiny',
large: 'medium',
};
export const ProgressLabel = props => {
const [reversedSize] = Object.entries(sizesMap).find(([, numberSize]) => numberSize === props.size);
if (reversedSize === Size.small) {
return React.createElement(React.Fragment, null);
}
const labelSize = labelSizeMap[reversedSize];
const labelSkin = labelSkinMap[props['data-skin']];
return (React.createElement(Text, { skin: labelSkin, size: labelSize, weight: "bold" }, props.label || convertToPercentageString(props.value)));
};
//# sourceMappingURL=ProgressLabel.js.map