-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfileButton.tsx
More file actions
51 lines (48 loc) Β· 1.41 KB
/
ProfileButton.tsx
File metadata and controls
51 lines (48 loc) Β· 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
import type { User } from '@/types/auth';
interface ProfileButtonProps {
user: User;
handleLogout: () => void;
}
export default function ProfileButton({
user,
handleLogout,
}: ProfileButtonProps) {
const goToProfileEdit = () => {
// TODO: Implement navigation to profile edit page
console.info('Navigating to profile edit page...');
};
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button>
<Avatar className="border-2">
<AvatarImage src={user.profileImage} />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
</button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-40" align="end">
<DropdownMenuLabel>
<span className="font-bold">{user.name}</span> λ
</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuItem onClick={goToProfileEdit}>
νλ‘ν μμ
</DropdownMenuItem>
<DropdownMenuItem onClick={handleLogout}>λ‘κ·Έμμ</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
);
}