"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UILibRoutes = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const react_redux_1 = require("react-redux");
const react_router_dom_v5_compat_1 = require("react-router-dom-v5-compat");
const clusters_1 = require("./clusters");
const ui_1 = require("./ui");
const store_1 = require("../store");
const use_feature_detection_1 = require("../hooks/use-feature-detection");
require("./Routes.css");
const UILibRoutes = ({ allEnabledFeatures, children, history, basename, }) => {
    (0, use_feature_detection_1.useFeatureDetection)(allEnabledFeatures);
    const routes = (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement(react_router_dom_v5_compat_1.Routes, null,
            react_1.default.createElement(react_router_dom_v5_compat_1.Route, { path: "assisted-installer/clusters", element: react_1.default.createElement(react_router_dom_v5_compat_1.Outlet, null) },
                react_1.default.createElement(react_router_dom_v5_compat_1.Route, { path: "~new", element: react_1.default.createElement(clusters_1.NewClusterPage, null) }),
                react_1.default.createElement(react_router_dom_v5_compat_1.Route, { path: ":clusterId", element: react_1.default.createElement(clusters_1.ClusterPage, null) }),
                react_1.default.createElement(react_router_dom_v5_compat_1.Route, { index: true, element: react_1.default.createElement(clusters_1.Clusters, null) })),
            children,
            react_1.default.createElement(react_router_dom_v5_compat_1.Route, { path: "*", element: react_1.default.createElement(react_router_dom_v5_compat_1.Navigate, { to: "assisted-installer/clusters" }) }))));
    return (react_1.default.createElement(react_redux_1.Provider, { store: store_1.storeDay1 },
        react_1.default.createElement(ui_1.AssistedUILibVersion, null),
        history ? (react_1.default.createElement(react_router_dom_v5_compat_1.unstable_HistoryRouter, { history: history, basename: basename || '/' }, routes)) : (routes)));
};
exports.UILibRoutes = UILibRoutes;
//# sourceMappingURL=Routes.js.map