import { validProgress } from './utils'; import { ProgressProps } from './progress'; const Line = { functional: true, render(h, context) { const { props, children } = context; const { prefixCls, percent, successPercent, strokeWidth, size, strokeColor, strokeLinecap, } = props; const percentStyle = { width: `${validProgress(percent)}%`, height: strokeWidth || (size === 'small' ? '6px' : '8px'), background: strokeColor, borderRadius: strokeLinecap === 'square' ? 0 : '100px', }; const successPercentStyle = { width: `${validProgress(successPercent)}%`, height: strokeWidth || (size === 'small' ? '6px' : '8px'), borderRadius: strokeLinecap === 'square' ? 0 : '100px', }; const successSegment = successPercent !== undefined ? (
) : null; return (
{successSegment}
{children}
); }, }; export default Line;