Fix jwt-token
This commit is contained in:
@@ -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 */}
|
||||
|
||||
Reference in New Issue
Block a user