feat: add dashboard navigation to AccountSwitcher component

This commit is contained in:
2025-12-28 14:43:12 +01:00
parent 1972c1e27c
commit 462741c3bd

View File

@@ -1,7 +1,8 @@
// NOTE: This file is stable and usually should not be modified.
// It is important that all functionality in this file is preserved, and should only be modified if explicitly requested.
import { ChevronDown, LogOut, UserIcon, UserPlus, Wallet, Wifi, X } from 'lucide-react';
import { ChevronDown, LayoutDashboard, LogOut, UserIcon, UserPlus, Wallet, Wifi, X } from 'lucide-react';
import { useNavigate } from 'react-router-dom';
import {
DropdownMenu,
DropdownMenuContent,
@@ -31,6 +32,7 @@ interface AccountSwitcherProps {
export function AccountSwitcher({ onAddAccountClick }: AccountSwitcherProps) {
const { currentUser, otherUsers, setLogin, removeLogin } = useLoggedInAccounts();
const navigate = useNavigate();
if (!currentUser) return null;
@@ -71,6 +73,13 @@ export function AccountSwitcher({ onAddAccountClick }: AccountSwitcherProps) {
</DropdownMenuItem>
))}
<DropdownMenuSeparator />
<DropdownMenuItem
className='flex items-center gap-2 cursor-pointer p-2 rounded-md'
onClick={() => navigate('/dashboard')}
>
<LayoutDashboard className='w-4 h-4' />
<span>Dashboard</span>
</DropdownMenuItem>
<Drawer>
<DrawerTrigger asChild>
<DropdownMenuItem