'use client'; import Image from 'next/image'; import { type Session } from 'next-auth'; import { signOut } from 'next-auth/react'; import { Button } from '@/components/ui/button'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { IconExternalLink } from '@/components/ui/icons'; export interface UserMenuProps { user: Session['user']; } function getUserInitials(name: string) { const [firstName, lastName] = name.split(' '); return lastName ? `${firstName[0]}${lastName[0]}` : firstName.slice(0, 2); } export function UserMenu({ user }: UserMenuProps) { return (
{user?.name}
{user?.email}
signOut({ callbackUrl: '/', }) } className="text-xs" > Log Out
); }