feat: progress view

This commit is contained in:
Carlos Valente
2024-06-21 15:10:38 +02:00
parent b7c48f38a9
commit 8aeb4c7a01
20 changed files with 736 additions and 1 deletions
@@ -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}%` }} />;
}