'use strict'; var Progressline = require('rc-progress').Line; var Progresscircle = require('rc-progress').Circle; var React = require('react'); var assign = require('object-assign'); var Line = React.createClass({ getDefaultProps() { return { width: 300, percent: 0, strokeWidth: 3, status: 'normal' // exception }; }, render() { var statusColorMap = { 'normal': '#3FC7FA', 'exception': '#FE8C6A', 'success': '#85D262' }; var props = assign({}, this.props); if (parseInt(props.percent) === 100) { props.status = 'success'; } var style = { 'width': props.width }; var fontSize = (props.width / 100 * props.strokeWidth); var iconStyle = { 'fontSize': (fontSize < 12) ? 12 : fontSize }; var textStyle = { 'color': statusColorMap[props.status] }; var progressInfo; if (props.status === 'exception') { progressInfo = ( ); } else if (props.status === 'success') { progressInfo = ( ); } else { progressInfo = ( {props.percent}% ); } return (