index.js 878 字节
Newer Older
1
import React from 'react';
N
niko 已提交
2
import { Tooltip } from 'antd';
3 4 5

import styles from './index.less';

6 7 8 9 10 11
const MiniProgress = ({
  targetLabel,
  target,
  color = 'rgb(19, 194, 194)',
  strokeWidth,
  percent,
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
}) => {
  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,
          }}
        />
N
nikogu 已提交
30
      </div>
31
    </div>
32 33
  );
};
34 35

export default MiniProgress;