mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 20:33:47 +00:00
c4e6215b29
* test views test timeline * timeline show seconds when less than 2m * fix: countown typings * refactor: backstage schedule item * chore: lint
43 lines
1.0 KiB
TypeScript
43 lines
1.0 KiB
TypeScript
import { cx } from '../../../common/utils/styleUtils';
|
|
|
|
import { useSchedule } from './ScheduleContext';
|
|
import ScheduleItem from './ScheduleItem';
|
|
|
|
import './Schedule.scss';
|
|
|
|
interface ScheduleProps {
|
|
className?: string;
|
|
}
|
|
|
|
export default function Schedule({ className }: ScheduleProps) {
|
|
const { events, containerRef } = useSchedule();
|
|
|
|
if (events?.length < 1) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<ul className={cx(['schedule', className])} ref={containerRef}>
|
|
{events.map((event) => {
|
|
return (
|
|
<ScheduleItem
|
|
key={event.id}
|
|
timeStart={event.timeStart}
|
|
dayOffset={event.dayOffset}
|
|
delay={event.delay}
|
|
totalGap={event.totalGap}
|
|
isLinkedToLoaded={event.isLinkedToLoaded}
|
|
countToEnd={event.countToEnd}
|
|
duration={event.duration}
|
|
colour={event.colour}
|
|
skip={event.skip}
|
|
title={event.title}
|
|
timeEnd={event.timeEnd}
|
|
cue={event.cue}
|
|
/>
|
|
);
|
|
})}
|
|
</ul>
|
|
);
|
|
}
|