2025-08-01 08:00:35 +05:30
|
|
|
import React from 'react';
|
2025-08-11 01:38:33 +05:30
|
|
|
import { createRoot } from 'react-dom/client';
|
2025-08-01 08:00:35 +05:30
|
|
|
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
|
|
|
|
import Dashboard from './pages/Dashboard';
|
|
|
|
import Settings from './pages/Settings';
|
|
|
|
import TwoFA from './pages/TwoFA';
|
|
|
|
|
|
|
|
export default function App() {
|
2025-08-11 01:38:33 +05:30
|
|
|
return (
|
|
|
|
<Router>
|
|
|
|
<Routes>
|
|
|
|
<Route path="/" element={ <Dashboard /> } />
|
|
|
|
<Route path="/settings" element={ <Settings /> } />
|
|
|
|
<Route path="/2fa" element={ <TwoFA /> } />
|
|
|
|
</Routes>
|
|
|
|
</Router>
|
|
|
|
);
|
2025-08-01 08:00:35 +05:30
|
|
|
}
|
2025-08-11 01:38:33 +05:30
|
|
|
|
|
|
|
// Mount components based on container element
|
|
|
|
document.addEventListener( 'DOMContentLoaded', function () {
|
|
|
|
// Main Helix app
|
|
|
|
const helixRoot = document.getElementById( 'helix-root' );
|
|
|
|
if ( helixRoot ) {
|
|
|
|
const root = createRoot( helixRoot );
|
|
|
|
root.render( <App /> );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Settings page
|
|
|
|
const settingsRoot = document.getElementById( 'helix-settings-root' );
|
|
|
|
if ( settingsRoot ) {
|
|
|
|
const root = createRoot( settingsRoot );
|
|
|
|
root.render( <Settings /> );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Posts page
|
|
|
|
const postsRoot = document.getElementById( 'helix-posts-root' );
|
|
|
|
if ( postsRoot ) {
|
|
|
|
const root = createRoot( postsRoot );
|
|
|
|
root.render( <Dashboard /> ); // For now, render Dashboard
|
|
|
|
}
|
|
|
|
|
|
|
|
// Users page
|
|
|
|
const usersRoot = document.getElementById( 'helix-users-root' );
|
|
|
|
if ( usersRoot ) {
|
|
|
|
const root = createRoot( usersRoot );
|
|
|
|
root.render( <Dashboard /> ); // For now, render Dashboard
|
|
|
|
}
|
|
|
|
} );
|