mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-27 01:49:10 +00:00
refactor: better description for event action
This commit is contained in:
@@ -118,6 +118,15 @@ export default function RundownEvent({
|
|||||||
|
|
||||||
const handleRef = useRef<null | HTMLSpanElement>(null);
|
const handleRef = useRef<null | HTMLSpanElement>(null);
|
||||||
|
|
||||||
|
const [enableMatchDuration, groupTargetDurationDescription] = (() => {
|
||||||
|
if (!parentGroup || parentGroup.targetDuration === null || parentGroup.duration === parentGroup.targetDuration)
|
||||||
|
return [false, ''];
|
||||||
|
const { targetDuration, duration } = parentGroup;
|
||||||
|
return targetDuration > duration
|
||||||
|
? [true, 'Increase event duration to fit the group target']
|
||||||
|
: [true, 'Decrease event duration to fit the group target'];
|
||||||
|
})();
|
||||||
|
|
||||||
const [onContextMenu] = useContextMenu<HTMLDivElement>(() =>
|
const [onContextMenu] = useContextMenu<HTMLDivElement>(() =>
|
||||||
selectedEvents.size > 1
|
selectedEvents.size > 1
|
||||||
? [
|
? [
|
||||||
@@ -179,16 +188,13 @@ export default function RundownEvent({
|
|||||||
{
|
{
|
||||||
type: 'item',
|
type: 'item',
|
||||||
label: 'Match Group Target Duration',
|
label: 'Match Group Target Duration',
|
||||||
description: 'Change event duration to fill the group target',
|
description: groupTargetDurationDescription,
|
||||||
icon: TbClockPin,
|
icon: TbClockPin,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
if (!parent) return;
|
if (!parent) return;
|
||||||
matchGroupDuration(eventId);
|
matchGroupDuration(eventId);
|
||||||
},
|
},
|
||||||
disabled:
|
disabled: !enableMatchDuration,
|
||||||
!parentGroup ||
|
|
||||||
parentGroup.targetDuration === null ||
|
|
||||||
parentGroup.duration === parentGroup.targetDuration,
|
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user