import { useRegistry, useDispatch } from "@wordpress/data";
import { useEffect } from "@wordpress/element";
import { unlock } from "../../lock-unlock";
import { store as siteEditorStore } from "../../store";
import { homeRoute } from "./home";
import { stylesRoute } from "./styles";
import { navigationRoute } from "./navigation";
import { navigationItemRoute } from "./navigation-item";
import { patternsRoute } from "./patterns";
import { patternItemRoute } from "./pattern-item";
import { templatePartItemRoute } from "./template-part-item";
import { templatesRoute } from "./templates";
import { templateItemRoute, staticTemplateItemRoute } from "./template-item";
import { pagesRoute } from "./pages";
import { pageItemRoute } from "./page-item";
import { stylebookRoute } from "./stylebook";
import { notFoundRoute } from "./notfound";
const routes = [
  pageItemRoute,
  pagesRoute,
  templateItemRoute,
  staticTemplateItemRoute,
  templatesRoute,
  templatePartItemRoute,
  patternItemRoute,
  patternsRoute,
  navigationItemRoute,
  navigationRoute,
  stylesRoute,
  homeRoute,
  stylebookRoute,
  notFoundRoute
];
function useRegisterSiteEditorRoutes() {
  const registry = useRegistry();
  const { registerRoute } = unlock(useDispatch(siteEditorStore));
  useEffect(() => {
    registry.batch(() => {
      routes.forEach(registerRoute);
    });
  }, [registry, registerRoute]);
}
export {
  useRegisterSiteEditorRoutes
};
//# sourceMappingURL=index.js.map
