mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 02:13:48 +00:00
2e631194e1
Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
23 lines
590 B
TypeScript
23 lines
590 B
TypeScript
import { MaybeNumber } from 'ontime-types';
|
|
|
|
import { useAnimatedProgress } from '../../hooks/useAnimatedProgress';
|
|
|
|
import './ProgressBar.scss';
|
|
|
|
interface ProgressBarProps {
|
|
current: MaybeNumber;
|
|
duration: MaybeNumber;
|
|
className?: string;
|
|
}
|
|
|
|
export default function ProgressBar(props: ProgressBarProps) {
|
|
const { current, duration, className } = props;
|
|
const progress = useAnimatedProgress(current, duration);
|
|
|
|
return (
|
|
<div className={`progress-bar__bg ${className}`}>
|
|
<div className='progress-bar__indicator' style={{ width: `${progress}%` }} />
|
|
</div>
|
|
);
|
|
}
|