import React from 'react'; import { createRoot, hydrateRoot } from 'react-dom/client'; import { BrowserRouter } from 'react-router-dom'; import 'bootstrap/dist/css/bootstrap.min.css'; import './styles/tokens.css'; import './styles/site.css'; import './styles/admin.css'; import './styles/workspace.css'; import './styles/care.css'; import './styles/doctor.css'; import './styles/clinical-assistant.css'; import './styles/responsive.css'; import App from './App'; import { cloudMode } from './services/backend/config'; const root = document.getElementById('root'); const app = ( ); const currentPath = window.location.pathname.replace(/\/+$/, '') || '/'; const renderedPath = root.dataset.renderedPath; const matches = renderedPath === currentPath; if (!cloudMode() && root.hasChildNodes() && matches) hydrateRoot(root, app); else createRoot(root).render(app);