From c8bae76121a7ff5a81773c74676d8895385b28c6 Mon Sep 17 00:00:00 2001 From: Carlos Valente Date: Mon, 11 May 2026 20:03:44 +0200 Subject: [PATCH] refactor: add empty state for autoamtion form --- .../entry-editor/composite/EventEditorTriggers.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/client/src/features/rundown/entry-editor/composite/EventEditorTriggers.tsx b/apps/client/src/features/rundown/entry-editor/composite/EventEditorTriggers.tsx index eae835caa..893cce880 100644 --- a/apps/client/src/features/rundown/entry-editor/composite/EventEditorTriggers.tsx +++ b/apps/client/src/features/rundown/entry-editor/composite/EventEditorTriggers.tsx @@ -26,7 +26,7 @@ export default function EventEditorTriggers({ triggers, eventId }: EventEditorTr value: id, label: title, })); - + const hasAutomationOptions = allAutomationOptions.length > 0; const triggerOptions = eventTriggerOptions.map((cycle) => ({ value: cycle, label: cycle })); const duplicateIds = new Set(); @@ -41,7 +41,7 @@ export default function EventEditorTriggers({ triggers, eventId }: EventEditorTr } const handleAdd = () => { - if (allAutomationOptions.length === 0) return; + if (!hasAutomationOptions) return; updateEntry({ id: eventId, triggers: [ @@ -65,6 +65,12 @@ export default function EventEditorTriggers({ triggers, eventId }: EventEditorTr {automationsEnabled === false && ( Automations are disabled. Event triggers stay configured, but they will not run until enabled. )} + {automationsEnabled && !hasAutomationOptions && ( + + No automations available + Create an automation before attaching it to this event. + + )} {triggers.length > 0 && (
@@ -110,7 +116,7 @@ export default function EventEditorTriggers({ triggers, eventId }: EventEditorTr * Duplicate combinations will only fire once per lifecycle event. )} - {allAutomationOptions.length > 0 && ( + {hasAutomationOptions && (