import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
import { Box } from "@chakra-ui/react";
import { useParams } from "react-router-dom";
import { SourceContext } from "./SourceContext";
import ActivePage from "./ActivePage";
import ToastNotification from "./ToastNotification";
import GroupComponentsContext from "./GroupComponentsContext";
import QRScannerAction from "./QRScanner.action";
import { usePageSource } from "./hooks/usePageSource";
import ModalPageProvider from "./ModalPageProvider";
import ModalPage from "./ModalPage";
import { ParamsProvider } from "./ParamsProvider";
import RefreshDataProvider from "./hooks/useRefreshData";
import { PageSuspense } from "./components/PageSuspense";
export default function ActivePageContainer() {
    const params = useParams();
    const { page, source } = usePageSource();
    return (_jsx(SourceContext.Provider, Object.assign({ value: source }, { children: _jsx(ParamsProvider, { children: _jsxs(RefreshDataProvider, { children: [_jsx(GroupComponentsContext.Provider, { children: _jsx(Box, Object.assign({ position: "relative", width: "100%", height: "100%", bg: "#f6f6f6" }, { children: _jsx(PageSuspense, { children: page && (_jsx(ActivePage, { page: page }, `${params.page}`)) }) })) }), _jsx(ModalPageProvider, { children: _jsx(ModalPage, {}) }), _jsx(ToastNotification, {}), _jsx(QRScannerAction, {})] }) }) })));
}
//# sourceMappingURL=ActivePageContainer.js.map