"use strict";

exports.__esModule = true;
exports.useCreateTableFolders = useCreateTableFolders;
exports.useTableFolders = useTableFolders;
var _react = require("@wix/bex-core/react");
var _react2 = require("react");
var _TableFoldersState = require("../state/TableFoldersState");
var _useOptionalCachedState = require("./useOptionalCachedState");
function useCreateTableFolders() {
  const container = (0, _react.useWixPatternsContainer)();
  return (0, _react2.useCallback)(({
    items,
    folders
  }) => {
    return new _TableFoldersState.TableFoldersState({
      items,
      folders,
      container
    });
  }, []);
}
function useTableFolders(config) {
  const createGridFolders = useCreateTableFolders();
  const state = (0, _useOptionalCachedState.useOptionalCachedState)(() => createGridFolders(config));
  return state;
}
//# sourceMappingURL=useTableFolders.js.map