LabeledProgressBar.tsx 750 B

123456789101112131415161718192021222324252627282930313233
  1. import React from 'react';
  2. import { Progress } from 'reactstrap';
  3. type Props = {
  4. header: string,
  5. currentCount: number,
  6. totalCount: number,
  7. isInProgress?: boolean,
  8. }
  9. const LabeledProgressBar = (props: Props): JSX.Element => {
  10. const {
  11. header, currentCount, totalCount, isInProgress,
  12. } = props;
  13. const progressingColor = isInProgress ? 'info' : 'success';
  14. return (
  15. <>
  16. <h6 className="my-1">
  17. {header}
  18. <div className="float-end">{currentCount} / {totalCount}</div>
  19. </h6>
  20. <Progress multi>
  21. <Progress bar max={totalCount} color={progressingColor} striped={isInProgress} animated={isInProgress} value={currentCount} />
  22. </Progress>
  23. </>
  24. );
  25. };
  26. export default LabeledProgressBar;