"use strict";

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