// frontend/src/App.tsx - KORRIGIERT MIT LAYOUT import React from 'react'; import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; import { AuthProvider, useAuth } from './contexts/AuthContext'; import { NotificationProvider } from './contexts/NotificationContext'; import NotificationContainer from './components/Notification/NotificationContainer'; import Layout from './components/Layout/Layout'; import Login from './pages/Auth/Login'; import Dashboard from './pages/Dashboard/Dashboard'; import ShiftPlanList from './pages/ShiftPlans/ShiftPlanList'; import ShiftPlanCreate from './pages/ShiftPlans/ShiftPlanCreate'; import EmployeeManagement from './pages/Employees/EmployeeManagement'; import Settings from './pages/Settings/Settings'; import Help from './pages/Help/Help'; import Setup from './pages/Setup/Setup'; // Protected Route Component const ProtectedRoute: React.FC<{ children: React.ReactNode; roles?: string[] }> = ({ children, roles = ['admin', 'instandhalter', 'user'] }) => { const { user, loading, hasRole } = useAuth(); if (loading) { return (
Sie haben keine Berechtigung für diese Seite.