- New ContentCreation.jsx: 3-column layout Left: object list + "+ Objekt hinzufügen" button Center: dual-mode canvas (draw OR highlight) Right: ObjectAddPanel (mode=add) or PairsPanel (mode=objectId) - After saving object → auto-switches to PairsPanel for that object - All ObjectCreation + StatementCreation logic merged into one page - All pictures loaded (no objects_created filter) - "Objekte abgeschlossen" button marks picture (visual badge) - ContentHub: 2 tiles (Content Erstellen + Veröffentlichen placeholder) - App.jsx: /content/creation route, old /content/objects + /content/statements removed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
1.2 KiB
JavaScript
31 lines
1.2 KiB
JavaScript
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
|
|
import { getUser } from './lib/api';
|
|
import Login from './pages/Login';
|
|
import Dashboard from './pages/Dashboard';
|
|
import DatabaseAdmin from './pages/DatabaseAdmin';
|
|
import TableView from './pages/TableView';
|
|
import ContentHub from './pages/ContentHub';
|
|
import ContentCreation from './pages/ContentCreation';
|
|
|
|
function RequireAuth({ children }) {
|
|
const user = getUser();
|
|
if (!user) return <Navigate to="/login" replace />;
|
|
return children;
|
|
}
|
|
|
|
export default function App() {
|
|
return (
|
|
<BrowserRouter>
|
|
<Routes>
|
|
<Route path="/login" element={<Login />} />
|
|
<Route path="/" element={<RequireAuth><Dashboard /></RequireAuth>} />
|
|
<Route path="/db" element={<RequireAuth><DatabaseAdmin /></RequireAuth>} />
|
|
<Route path="/db/:tableKey" element={<RequireAuth><TableView /></RequireAuth>} />
|
|
<Route path="/content" element={<RequireAuth><ContentHub /></RequireAuth>} />
|
|
<Route path="/content/creation" element={<RequireAuth><ContentCreation /></RequireAuth>} />
|
|
<Route path="*" element={<Navigate to="/" replace />} />
|
|
</Routes>
|
|
</BrowserRouter>
|
|
);
|
|
}
|