import {StrictMode} from 'react'; import {createRoot} from 'react-dom/client'; import App from './App.tsx'; import './index.css'; import { ThemeProvider } from './context/ThemeContext'; import { ErrorBoundary } from './components/ui/ErrorBoundary'; import { ErrorPage } from './components/ui/ErrorPage'; import { tx } from './i18n/tx'; import { registerServiceWorker } from './registerServiceWorker'; // Register service worker for offline catalogue access registerServiceWorker(); // The app has one address ("/"). Any other address is a wrong or old link. // Development only: /?preview=crash shows the crash page so it can be looked at const previewCrash = import.meta.env.DEV && new URLSearchParams(window.location.search).get('preview') === 'crash'; const Boom = () => { throw new Error('Preview of the crash page'); }; const unknownAddress = !['/', '/index.html'].includes(window.location.pathname); createRoot(document.getElementById('root')!).render( {previewCrash ? : unknownAddress ? window.location.assign('/')} /> : } , );