"use strict";

exports.__esModule = true;
exports.useCreateTableGridSwitchFolders = useCreateTableGridSwitchFolders;
exports.useTableGridSwitchFolders = useTableGridSwitchFolders;
var _react = require("@wix/bex-core/react");
var _react2 = require("react");
var _TableGridSwitchFoldersState = require("../state/TableGridSwitchFoldersState");
var _useOptionalCachedState = require("./useOptionalCachedState");
function useCreateTableGridSwitchFolders() {
  const container = (0, _react.useWixPatternsContainer)();
  const containerOverrides = (0, _react.useWixPatternsContainerOverrides)();
  return (0, _react2.useCallback)(({
    items,
    folders
  }) => {
    return new _TableGridSwitchFoldersState.TableGridSwitchFoldersState({
      items,
      folders,
      container,
      containerOverrides
    });
  }, []);
}
function useTableGridSwitchFolders(config) {
  const factory = useCreateTableGridSwitchFolders();
  const state = (0, _useOptionalCachedState.useOptionalCachedState)(() => factory(config));
  return state;
}
//# sourceMappingURL=useTableGridSwitchFolders.js.map