mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
# Description of Changes Move frontend code into `core` folder and add infrastructure for `proprietary` folder to include premium, non-OSS features
18 lines
621 B
TypeScript
18 lines
621 B
TypeScript
import { useCallback } from 'react';
|
|
import { useFileActions } from '@app/contexts/FileContext';
|
|
|
|
export const useFileHandler = () => {
|
|
const { actions } = useFileActions();
|
|
|
|
const addFiles = useCallback(async (files: File[], options: { insertAfterPageId?: string; selectFiles?: boolean } = {}) => {
|
|
// Merge default options with passed options - passed options take precedence
|
|
const mergedOptions = { selectFiles: true, ...options };
|
|
// Let FileContext handle deduplication with quickKey logic
|
|
await actions.addFiles(files, mergedOptions);
|
|
}, [actions.addFiles]);
|
|
|
|
return {
|
|
addFiles,
|
|
};
|
|
};
|