refactor: unify progress bar logic

This commit is contained in:
Carlos Valente
2024-08-09 19:59:15 +02:00
committed by Carlos Valente
parent c3fb3061f6
commit 347f333b3e
9 changed files with 49 additions and 74 deletions
@@ -11,13 +11,12 @@ interface StatusBarProgressProps {
export default function StatusBarProgress(props: StatusBarProgressProps) {
const { viewSettings } = props;
const { addedTime, current, duration, timeWarning, timeDanger } = useProgressData();
const totalTime = (duration ?? 0) + (addedTime ?? 0);
const { current, duration, timeWarning, timeDanger } = useProgressData();
return (
<MultiPartProgressBar
now={current}
complete={totalTime}
complete={duration}
normalColor={viewSettings.normalColor}
warning={timeWarning}
warningColor={viewSettings.warningColor}