Fix jwt-token

This commit is contained in:
2025-09-01 07:24:36 +02:00
parent 8c4fc4f62b
commit e312c61b56
6 changed files with 507 additions and 3 deletions

View File

@@ -12,11 +12,12 @@ import {
Bars3Icon,
XMarkIcon,
SignalIcon,
WifiIcon
WifiIcon,
BugAntIcon
} from '@heroicons/react/24/outline';
import classNames from 'classnames';
const navigation = [
const baseNavigation = [
{ name: 'Dashboard', href: '/', icon: HomeIcon },
{ name: 'Map View', href: '/map', icon: MapIcon },
{ name: 'Devices', href: '/devices', icon: ServerIcon },
@@ -24,12 +25,21 @@ const navigation = [
{ name: 'Alerts', href: '/alerts', icon: BellIcon },
];
const adminNavigation = [
{ name: 'Debug', href: '/debug', icon: BugAntIcon },
];
const Layout = () => {
const [sidebarOpen, setSidebarOpen] = useState(false);
const { user, logout } = useAuth();
const { connected, recentDetections } = useSocket();
const location = useLocation();
// Build navigation based on user role
const navigation = user?.role === 'admin'
? [...baseNavigation, ...adminNavigation]
: baseNavigation;
return (
<div className="min-h-screen flex bg-gray-100">
{/* Mobile sidebar */}