feat: timer overview shows waiting timer

This commit is contained in:
Carlos Valente
2025-08-06 06:28:34 +02:00
committed by Carlos Valente
parent dddeefd544
commit f1a8db9649
9 changed files with 37 additions and 79 deletions
@@ -1,33 +1,12 @@
import { isPlaybackActive } from 'ontime-utils';
import { ClockOverview, TimerOverview } from '../../overview/composite/TimeElements';
import { useClock, useTimer } from '../../../common/hooks/useSocket';
import { cx } from '../../../common/utils/styleUtils';
import ClockTime from '../../viewers/common/clock-time/ClockTime';
import RunningTime from '../../viewers/common/running-time/RunningTime';
import styles from './StatusBar.module.scss';
import style from './StatusBar.module.scss';
export default function StatusBarTimers() {
const timer = useTimer();
const { clock } = useClock();
const playbackActive = isPlaybackActive(timer.playback);
return (
<div className={styles.timers}>
<div className={styles.runningTimer}>
<span className={styles.label}>Running timer</span>
<RunningTime
className={cx([styles.timer, playbackActive && styles.active])}
value={timer.current}
hideLeadingZero
/>
</div>
<div className={styles.timeNow}>
<span className={styles.label}>Time now</span>
<ClockTime className={styles.timer} value={clock} />
</div>
<div className={style.timers}>
<TimerOverview className={style.runningTimer} />
<ClockOverview className={style.timeNow} />
</div>
);
}