mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 14:39:06 +00:00
feat: progress view
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { useClock } from '../../../common/hooks/useSocket';
|
||||
|
||||
import { getRelativePositionX } from './timelineUtils';
|
||||
|
||||
import style from './TimelineProgressBar.module.scss';
|
||||
|
||||
interface ProgressBarProps {
|
||||
startHour: number;
|
||||
endHour: number;
|
||||
}
|
||||
|
||||
export function ProgressBar(props: ProgressBarProps) {
|
||||
const { startHour, endHour } = props;
|
||||
const { clock } = useClock();
|
||||
|
||||
const left = getRelativePositionX(startHour, endHour, clock);
|
||||
|
||||
return <div className={style.progressBar} style={{ width: `${left}%` }} />;
|
||||
}
|
||||
Reference in New Issue
Block a user