/**
 * Created by geweimin on 17/5/31.
 */
import React from 'react';

export default class progressBar extends React.Component {

  render() {
    const progressStyle = {
      width: this.props.width ? this.props.width : 120
    };

    const progressPre = {
      width: this.props.pre + '%'
    };
    if (this.props.pre >= 99.9) {
      progressPre.background = '#85c440';
      progressPre.borderColor = '#78b337 #6ba031 #568128';
      progressPre.backgroundImage = 'linear-gradient(to bottom, #b7dc8e 0%, #99ce5f 70%, #85c440 100%)';
    }
    return (
      <div className="progress" style={progressStyle}>
        <span className="progress-pre" style={progressPre} />
      </div>
    );
  }

}
