Seitenleiste: direkt ins Projekt-Admin wechseln
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b8e4de97c7
commit
dddfb02d1d
3 files changed
+33
No files matched your search
@@ -13,13 +13,21 @@ import {
|
||||
IconLogout,
|
||||
IconLayoutSidebarLeftCollapse,
|
||||
IconLayoutSidebarLeftExpand,
|
||||
IconExternalLink,
|
||||
} from '@tabler/icons-react'
|
||||
import { openProjectAdmin } from '../lib/employeeAdminApi'
|
||||
|
||||
export default function Sidebar() {
|
||||
const { user, logout, isAdmin } = useAuth()
|
||||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
const [collapsed, setCollapsed] = useState(false)
|
||||
const [switching, setSwitching] = useState(false)
|
||||
|
||||
const handleProjectAdmin = async () => {
|
||||
setSwitching(true)
|
||||
await openProjectAdmin()
|
||||
}
|
||||
|
||||
const handleLogout = async () => {
|
||||
await logout()
|
||||
@@ -64,6 +72,16 @@ export default function Sidebar() {
|
||||
<span className="side-link-label">{link.label}</span>
|
||||
</Link>
|
||||
))}
|
||||
<button
|
||||
type="button"
|
||||
className="side-link side-link-button"
|
||||
onClick={handleProjectAdmin}
|
||||
disabled={switching}
|
||||
title="Projekt-Admin"
|
||||
>
|
||||
<IconExternalLink />
|
||||
<span className="side-link-label">Projekt-Admin</span>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
Reference in new issue
Block a user