Files
ontime/apps/client/src/features/timeline/Timeline/TimelineProgressBar.tsx
T
2024-06-22 20:16:09 +02:00

20 lines
519 B
TypeScript

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}%` }} />;
}