helix/src/App.jsx

57 lines
1.4 KiB
React
Raw Normal View History

2025-08-01 08:00:35 +05:30
import React from 'react';
import { createRoot } from 'react-dom/client';
2025-08-11 19:16:17 +05:30
import Dashboard from './pages/Dashboard/Dashboard';
import Settings from './pages/Settings/Settings';
2025-08-18 01:04:04 +05:30
import Posts from './pages/Posts/Posts';
2025-08-01 08:00:35 +05:30
2025-08-11 01:56:57 +05:30
// Main App component for the dashboard page
2025-08-01 08:00:35 +05:30
export default function App() {
2025-08-11 01:56:57 +05:30
return <Dashboard />;
}
// Posts page component
function PostsApp() {
2025-08-18 01:04:04 +05:30
return <Posts />;
2025-08-11 01:56:57 +05:30
}
// Users page component
function UsersApp() {
return (
2025-08-11 01:56:57 +05:30
<div className="helix-page">
<h1>Users Management</h1>
<p>Users management interface will be implemented here.</p>
</div>
);
2025-08-01 08:00:35 +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 );
2025-08-11 01:56:57 +05:30
root.render( <PostsApp /> );
}
// Users page
const usersRoot = document.getElementById( 'helix-users-root' );
if ( usersRoot ) {
const root = createRoot( usersRoot );
2025-08-11 01:56:57 +05:30
root.render( <UsersApp /> );
}
} );