BrowserRouter.jsxjavascript
import { BrowserRouter } from "react-router";
import Pages from "./Routes";
import { ContentProvider } from "./services/content";
import { ScreensaverProvider } from "./services/screensaver";
import { Screensaver } from "./components/Screensaver/Screensaver";
import { ErrorBoundary } from "./components/ErrorBoundary";
const basename = import.meta.env.VITE_BASE_URL || "/";
/**
* History-API router variant - use when the deploy path is known (basename
* from VITE_BASE_URL). App.jsx picks one of the two (HashRouter.jsx is the
* current default, this one is commented out there).
*
* Content + screensaver providers around the routes, pages guarded by the
* ErrorBoundary, same as HashRouter.jsx - but unlike HashRouter.jsx, this
* variant does NOT wrap the routes in {@link Stage} (the whole-app scale
* wrapper) and has no separate `/print-map` route. It has drifted out of
* sync with HashRouter.jsx's later additions; picking this variant today
* would run the kiosk unscaled and without the print-map dev tool.
*/
const Router = () => {
return (
<BrowserRouter basename={basename}>
<ContentProvider>
<ScreensaverProvider>
<ErrorBoundary>
<Pages />
</ErrorBoundary>
<Screensaver />
</ScreensaverProvider>
</ContentProvider>
</BrowserRouter>
);
};
export default Router;