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