import { OntimeEntry, Rundown, isOntimeEvent, isOntimeGroup, isOntimeMilestone } from 'ontime-types'; import { useMemo } from 'react'; import EventEditor from './EventEditor'; import GroupEditor from './GroupEditor'; import MilestoneEditor from './MilestoneEditor'; import style from './EntryEditor.module.scss'; interface CuesheetEntryEditorProps { entryId: string; rundown: Rundown; } export default function CuesheetEntryEditor({ entryId, rundown }: CuesheetEntryEditorProps) { const entry = useMemo(() => { if (rundown.order.length === 0) { return null; } const event = rundown.entries[entryId]; return event ?? null; }, [entryId, rundown.entries, rundown.order.length]); if (isOntimeEvent(entry)) { return (
); } if (isOntimeMilestone(entry)) { return (
); } if (isOntimeGroup(entry)) { return (
); } return null; }