mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 22:24:11 +00:00
feat: timer overview shows waiting timer
This commit is contained in:
committed by
Carlos Valente
parent
dddeefd544
commit
f1a8db9649
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user