"use strict";

exports.__esModule = true;
exports.usePatternsNavigate = void 0;
var _WixPatternsRouterProvider = require("../../providers/WixPatternsRouterProvider");
exports.useWixPatternsRouter = _WixPatternsRouterProvider.useWixPatternsRouter;
const usePatternsNavigate = () => {
  const router = (0, _WixPatternsRouterProvider.useWixPatternsRouter)();
  if (!router) {
    throw new Error('usePatternsNavigate must be used within PatternsRouter');
  }
  return {
    navigateToEntityPage: ({
      path,
      entity
    }) => {
      router.navigate(path, {
        state: {
          _chosenEntity: {
            entity
          }
        }
      });
    },
    navigateToCollectionPage: ({
      path
    }) => {
      router.navigate(path, {
        state: null
      });
    }
  };
};
exports.usePatternsNavigate = usePatternsNavigate;
//# sourceMappingURL=usePatternsNavigate.js.map