All files / atom/progressBar/src index.js

100% Statements 6/6
100% Branches 6/6
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34            1x 9x   1x       8x       1x   1x                            
import PropTypes from 'prop-types'
 
import ProgressBarCircle from './ProgressBarCircle/index.js'
import ProgressBarLine from './ProgressBarLine/index.js'
import {LINE_CAPS, SIZES, STATUS, STROKE_SIZES, TYPES} from './settings.js'
 
const AtomProgressBar = ({type = TYPES.LINE, status = STATUS.PROGRESS, size, ...props}) => {
  switch (type) {
    case TYPES.CIRCLE:
      return <ProgressBarCircle size={size} status={status} {...props} />
    case TYPES.LINE:
    case TYPES.LINE_DOUBLE_BAR:
    default:
      return <ProgressBarLine size={size} status={status} {...props} />
  }
}
 
AtomProgressBar.displayName = 'AtomProgressBar'
 
AtomProgressBar.propTypes = {
  type: PropTypes.oneOf(Object.values(TYPES)),
  size: PropTypes.oneOf(Object.values(SIZES)),
  status: PropTypes.oneOf(Object.values(STATUS))
}
 
export default AtomProgressBar
export {
  LINE_CAPS as atomProgressBarLineCaps,
  STROKE_SIZES as atomProgressBarStrokeSizes,
  SIZES as atomProgressBarSizes,
  STATUS as atomProgressBarStatus,
  TYPES as atomProgressBarTypes
}