shinkan-jinkendo/frontend/src/components/AdminPageNav.jsx
Lars 14884e6e55
Some checks failed
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 6s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Failing after 28s
UX. refactor: simplify AdminPageNav component by removing unused hooks and improving styling
- Removed the useLocation hook as it was unnecessary for the component's functionality.
- Updated the navigation styling to use CSS classes instead of inline styles, enhancing maintainability and readability.
- Improved accessibility by adding aria-labels to navigation elements.
2026-05-06 10:37:01 +02:00

37 lines
1.1 KiB
JavaScript

import { NavLink } from 'react-router-dom'
import { TreePine, FolderTree, Download, Grid3x3, Users } from 'lucide-react'
/**
* Admin-Seiten-Navigation (horizontal)
* Wechselt zwischen verschiedenen Admin-Seiten
*/
export default function AdminPageNav() {
const pages = [
{ to: '/admin/hierarchy', label: 'Hierarchie', icon: TreePine },
{ to: '/admin/users', label: 'Nutzer', icon: Users },
{ to: '/admin/maturity-models', label: 'Fähigkeitsmatrix', icon: Grid3x3 },
{ to: '/admin/catalogs', label: 'Kataloge', icon: FolderTree },
{ to: '/admin/mediawiki-import', label: 'Wiki-Import', icon: Download }
]
return (
<nav className="admin-top-nav" aria-label="Administration">
{pages.map((page) => {
const Icon = page.icon
return (
<NavLink
key={page.to}
to={page.to}
className={({ isActive }) =>
'admin-top-nav__link' + (isActive ? ' admin-top-nav__link--active' : '')
}
>
<Icon size={18} strokeWidth={2} aria-hidden />
<span>{page.label}</span>
</NavLink>
)
})}
</nav>
)
}