Stirling-PDF/frontend/src/hooks/tools/automate/useAutomateOperation.ts
2025-08-19 12:46:09 +01:00

23 lines
897 B
TypeScript

import { useToolOperation } from '../shared/useToolOperation';
import { useCallback } from 'react';
interface AutomateParameters {
automationConfig?: any;
}
export function useAutomateOperation() {
const customProcessor = useCallback(async (params: AutomateParameters, files: File[]) => {
// For now, this is a placeholder - the automation execution will be implemented later
// This function would send the automation config to the backend pipeline endpoint
console.log('Automation execution not yet implemented', { params, files });
throw new Error('Automation execution not yet implemented');
}, []);
return useToolOperation<AutomateParameters>({
operationType: 'automate',
endpoint: '/api/v1/pipeline/handleData',
buildFormData: () => new FormData(), // Placeholder, not used with customProcessor
customProcessor,
filePrefix: 'automated_'
});
}