index.js 463 B

1234567891011121314151617
  1. import React from 'react';
  2. import './index.less';
  3. function ProgressButton(props) {
  4. const { children, className = '', progress, width } = props;
  5. return (
  6. <div
  7. style={{ width: width || '' }}
  8. className={`progress-button ${className} ${progress > 0 ? 'theme' : 'default'}`}
  9. >
  10. <div className="progress" style={{ width: `${progress}%` }} />
  11. {children}
  12. </div>
  13. );
  14. }
  15. ProgressButton.propTypes = {};
  16. export default ProgressButton;