index.js 877 Bytes
Newer Older
1
import React from 'react';
niko's avatar
niko committed
2
import { Tooltip } from 'antd';
3 4
import styles from './index.less';

5 6 7 8 9 10
const MiniProgress = ({
  targetLabel,
  target,
  color = 'rgb(19, 194, 194)',
  strokeWidth,
  percent,
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
}) => {
  return (
    <div className={styles.miniProgress}>
      <Tooltip title={targetLabel}>
        <div className={styles.target} style={{ left: target ? `${target}%` : null }}>
          <span style={{ backgroundColor: color || null }} />
          <span style={{ backgroundColor: color || null }} />
        </div>
      </Tooltip>
      <div className={styles.progressWrap}>
        <div
          className={styles.progress}
          style={{
            backgroundColor: color || null,
            width: percent ? `${percent}%` : null,
            height: strokeWidth || null,
          }}
        />
nikogu's avatar
nikogu committed
29
      </div>
30
    </div>
31 32
  );
};
33 34

export default MiniProgress;