From 0e1a42bbb1b560bf11223df4eaa80bb87a7fe822 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Thu, 25 Sep 2025 07:49:17 +0200 Subject: [PATCH] Update AutomationRun.tsx --- .../components/tools/automate/AutomationRun.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/tools/automate/AutomationRun.tsx b/frontend/src/components/tools/automate/AutomationRun.tsx index d8f1e1a4e..b425e5776 100644 --- a/frontend/src/components/tools/automate/AutomationRun.tsx +++ b/frontend/src/components/tools/automate/AutomationRun.tsx @@ -12,7 +12,12 @@ import { useResourceCleanup } from "../../../utils/resourceManager"; interface AutomationRunProps { automation: AutomationConfig; onComplete: () => void; - automateOperation?: any; // TODO: Type this properly when available + automateOperation?: { + isLoading: boolean; + files: File[]; + downloadUrl: string | null; + executeOperation: (params: any, files: File[]) => Promise; + }; } export default function AutomationRun({ automation, onComplete, automateOperation }: AutomationRunProps) { @@ -27,12 +32,12 @@ export default function AutomationRun({ automation, onComplete, automateOperatio // Use the operation hook's loading state const isExecuting = automateOperation?.isLoading ?? false; - const hasResults = automateOperation?.files.length > 0 || automateOperation?.downloadUrl !== null; + const hasResults = (automateOperation?.files?.length ?? 0) > 0 || automateOperation?.downloadUrl !== null; // Initialize execution steps from automation React.useEffect(() => { if (automation?.operations) { - const steps = automation.operations.map((op: any, index: number) => { + const steps = automation.operations.map((op: { operation: string }, index: number) => { const tool = toolRegistry[op.operation as keyof typeof toolRegistry]; return { id: `${op.operation}-${index}`, @@ -193,8 +198,8 @@ export default function AutomationRun({ automation, onComplete, automateOperatio