mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
29 lines
618 B
JavaScript
29 lines
618 B
JavaScript
import React from 'react'
|
|
import { useNProgress } from '@tanem/react-nprogress'
|
|
import PropTypes from 'prop-types'
|
|
|
|
import Bar from './Bar'
|
|
import Container from './Container'
|
|
|
|
|
|
const Progress = ({
|
|
isAnimating,
|
|
minimum = 0.2
|
|
}) => {
|
|
const { animationDuration, isFinished, progress } = useNProgress({
|
|
isAnimating, minimum,
|
|
});
|
|
|
|
return (
|
|
<Container isFinished={isFinished} animationDuration={animationDuration}>
|
|
<Bar progress={progress} animationDuration={animationDuration} />
|
|
</Container>
|
|
)
|
|
}
|
|
|
|
Progress.propTypes = {
|
|
isAnimating: PropTypes.bool.isRequired,
|
|
};
|
|
|
|
export default Progress;
|