1234567891011121314151617181920 |
- import React from 'react';
- import './index.less';
- function ProgressButton(props) {
- const { children, className = '', progress, width, onClick } = props;
- return (
- <div
- style={{ width: width || '' }}
- className={`progress-button ${className} ${progress > 0 ? 'theme' : 'default'}`}
- onClick={() => {
- if (onClick) onClick();
- }}
- >
- <div className="progress" style={{ width: `${progress}%` }} />
- <div className="progress-content">{children}</div>
- </div>
- );
- }
- ProgressButton.propTypes = {};
- export default ProgressButton;
|