"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = PostsApp;
var _router = require("@wordpress/router");
var _data = require("@wordpress/data");
var _layout = _interopRequireDefault(require("../layout"));
var _postsAppRoutes = require("../posts-app-routes");
var _lockUnlock = require("../../lock-unlock");
var _store = require("../../store");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const {
  RouterProvider
} = (0, _lockUnlock.unlock)(_router.privateApis);
function PostsApp() {
  (0, _postsAppRoutes.useRegisterPostsAppRoutes)();
  const routes = (0, _data.useSelect)(select => {
    return (0, _lockUnlock.unlock)(select(_store.store)).getRoutes();
  }, []);
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(RouterProvider, {
    routes: routes,
    pathArg: "p",
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_layout.default, {})
  });
}
//# sourceMappingURL=index.js.map