import { useWixPatternsContainer } from '@wix/bex-core/react';
import { useCallback } from 'react';
import { GridFoldersState } from '../state/GridFoldersState';
import { useOptionalCachedState } from './useOptionalCachedState';
export function useCreateGridFolders() {
    const container = useWixPatternsContainer();
    return useCallback(({ items, folders }) => {
        return new GridFoldersState({
            items,
            folders,
            container,
        });
    }, []);
}
export function useGridFolders(config) {
    const createGridFolders = useCreateGridFolders();
    const state = useOptionalCachedState(() => createGridFolders(config));
    return state;
}
//# sourceMappingURL=useGridFolders.js.map