import * as React from 'react'; import { validProgress } from './utils'; import { ProgressProps } from './progress'; interface LineProps extends ProgressProps { prefixCls: string; children: React.ReactNode; } const Line: React.SFC = props => { const { prefixCls, percent, successPercent, strokeWidth, size, strokeColor, strokeLinecap, children, } = props; const percentStyle = { width: `${validProgress(percent)}%`, height: strokeWidth || (size === 'small' ? 6 : 8), background: strokeColor, borderRadius: strokeLinecap === 'square' ? 0 : '100px', }; const successPercentStyle = { width: `${validProgress(successPercent)}%`, height: strokeWidth || (size === 'small' ? 6 : 8), borderRadius: strokeLinecap === 'square' ? 0 : '100px', }; const successSegment = successPercent !== undefined ? (
) : null; return (
{successSegment}
{children}
); }; export default Line;