V2 results flow (#4196)

Better tool flow for reusability
Pinning 
Styling of tool flow
consumption of files after tooling

---------

Co-authored-by: Connor Yoh <[email protected]>
Co-authored-by: James Brunton <[email protected]>
This commit is contained in:
ConnorYoh
2025-08-15 14:43:30 +01:00
committed by GitHub
co-authored by Connor Yoh James Brunton
parent 1468df3e21
commit 4c17c520d7
40 changed files with 1474 additions and 1274 deletions
@@ -5,7 +5,7 @@ import type { ProcessingProgress } from './useToolState';
export interface ApiCallsConfig<TParams = void> {
endpoint: string | ((params: TParams) => string);
buildFormData: (file: File, params: TParams) => FormData;
buildFormData: (params: TParams, file: File) => FormData;
filePrefix: string;
responseHandler?: ResponseHandler;
}
@@ -34,7 +34,7 @@ export const useToolApiCalls = <TParams = void>() => {
onStatus(`Processing ${file.name} (${i + 1}/${total})`);
try {
const formData = config.buildFormData(file, params);
const formData = config.buildFormData(params, file);
const endpoint = typeof config.endpoint === 'function' ? config.endpoint(params) : config.endpoint;
const response = await axios.post(endpoint, formData, {
responseType: 'blob',