import React from "react"; import { signOut, useSession } from "next-auth/react"; import Image from "next/image"; import { Popover } from "@headlessui/react"; import { AnimatePresence, motion } from "framer-motion"; import { FaCog, FaSignOutAlt, FaGithub } from "react-icons/fa"; export function Avatar() { const { data: session } = useSession(); if (!session) { return <>; } if (session && session.user) { const displayName = session.user.name || session.user.email; const accountOptions = [ { name: "Account Settings", href: "#", desc: "Account Settings", icon: FaCog, //For future use }, ]; return ( {({ open }) => ( <>
Profile Picture

{displayName}

{/* Will be changed to username once it is implemented */}
{open && ( <>
{accountOptions.map((item) => (

{item.name}

))} signOut()} >

Sign Out

)}
)}
); } } export default Avatar;