diff --git a/app/src/components/nav/UserMenu.tsx b/app/src/components/nav/UserMenu.tsx new file mode 100644 index 0000000..6fcf5a4 --- /dev/null +++ b/app/src/components/nav/UserMenu.tsx @@ -0,0 +1,72 @@ +import { + HStack, + Icon, + Image, + VStack, + Text, + Popover, + PopoverTrigger, + PopoverContent, + Link, + type StackProps, +} from "@chakra-ui/react"; +import { type Session } from "next-auth"; +import { signOut } from "next-auth/react"; +import { BsBoxArrowRight, BsChevronRight, BsPersonCircle } from "react-icons/bs"; +import NavSidebarOption from "./NavSidebarOption"; + +export default function UserMenu({ user, ...rest }: { user: Session } & StackProps) { + const profileImage = user.user.image ? ( + profile picture + ) : ( + + ); + + return ( + <> + + + + + {profileImage} + + + {user.user.name} + + + {/* {user.user.email} */} + + + + + + + + + {/* sign out */} + { + signOut().catch(console.error); + }} + px={4} + py={2} + spacing={4} + color="gray.500" + fontSize="sm" + > + + Sign out + + + + + + ); +}