import { useWixPatternsContainer, useWixPatternsContainerOverrides, } from '@wix/bex-core/react';
import { useCallback } from 'react';
import { TableGridSwitchFoldersState } from '../state/TableGridSwitchFoldersState';
import { useOptionalCachedState } from './useOptionalCachedState';
export function useCreateTableGridSwitchFolders() {
    const container = useWixPatternsContainer();
    const containerOverrides = useWixPatternsContainerOverrides();
    return useCallback(({ items, folders }) => {
        return new TableGridSwitchFoldersState({
            items,
            folders,
            container,
            containerOverrides,
        });
    }, []);
}
export function useTableGridSwitchFolders(config) {
    const factory = useCreateTableGridSwitchFolders();
    const state = useOptionalCachedState(() => factory(config));
    return state;
}
//# sourceMappingURL=useTableGridSwitchFolders.js.map