diff --git a/apps/client/src/features/rundown/rundown-group/RundownGroup.tsx b/apps/client/src/features/rundown/rundown-group/RundownGroup.tsx index 69cc3f0ce..93ad11086 100644 --- a/apps/client/src/features/rundown/rundown-group/RundownGroup.tsx +++ b/apps/client/src/features/rundown/rundown-group/RundownGroup.tsx @@ -2,7 +2,7 @@ import { useSortable } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; import { EntryId, OntimeGroup } from 'ontime-types'; import { MILLIS_PER_MINUTE } from 'ontime-utils'; -import { MouseEvent, useRef } from 'react'; +import { MouseEvent, useCallback, useRef } from 'react'; import { IoChevronDown, IoChevronUp, @@ -12,6 +12,7 @@ import { IoReorderTwo, IoTrash, } from 'react-icons/io5'; +import { TbClockPin } from 'react-icons/tb'; import IconButton from '../../../common/components/buttons/IconButton'; import Tag from '../../../common/components/tag/Tag'; @@ -40,12 +41,16 @@ export default function RundownGroup({ data, hasCursor, collapsed, onCollapse }: 'use memo'; const handleRef = useRef(null); - const { clone, ungroup, deleteEntry } = useEntryActionsContext(); + const { clone, ungroup, deleteEntry, updateEntry } = useEntryActionsContext(); const selectSingleEntry = useEventSelection((state) => state.setSingleEntrySelection); const selectedEvents = useEventSelection((state) => state.selectedEvents); const entryCopyId = useEntryCopy((state) => state.entryCopyId); + const matchDuration = useCallback(() => { + updateEntry({ id: data.id, targetDuration: data.duration }); + }, [data.duration, data.id, updateEntry]); + const [onContextMenu] = useContextMenu(() => [ { type: 'item', @@ -62,6 +67,13 @@ export default function RundownGroup({ data, hasCursor, collapsed, onCollapse }: disabled: data.entries.length === 0, }, { type: 'divider' }, + { + type: 'item', + label: 'Match Content Duration', + icon: TbClockPin, + onClick: matchDuration, + }, + { type: 'divider' }, { type: 'item', label: 'Delete Group',