2026-01-06 04:37:45 +00:00
|
|
|
import { auth } from "@/auth";
|
|
|
|
|
import LogoutButton from "@/components/LogoutButton";
|
|
|
|
|
import Image from "next/image";
|
2026-01-06 02:40:21 +00:00
|
|
|
|
2026-01-06 04:37:45 +00:00
|
|
|
// import { getServerSession } from "next-auth/next"
|
2026-01-06 02:40:21 +00:00
|
|
|
|
2026-01-06 04:37:45 +00:00
|
|
|
async function Profile() {
|
|
|
|
|
const session = await auth();
|
|
|
|
|
|
|
|
|
|
console.log(session)
|
|
|
|
|
//console.trace(session)
|
2026-01-06 02:40:21 +00:00
|
|
|
return (
|
2026-01-06 04:37:45 +00:00
|
|
|
<div className="flex items-center justify-center min-h-[90vh]">
|
|
|
|
|
<div className="p-5 shadow-2xl rounded-md min-w-[30%] max-w-[50%] flex gap-5 flex-col items-center">
|
|
|
|
|
{session?.user?.image ? (
|
|
|
|
|
<Image
|
|
|
|
|
width={100}
|
|
|
|
|
height={100}
|
|
|
|
|
alt={session?.user?.name || ""}
|
|
|
|
|
src={session?.user?.image || ""}
|
|
|
|
|
className="w-20 h-20 rounded-full border border-yellow-500 shadow-md"
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="w-20 h-20 rounded-full border border-yellow-500 shadow-md bg-green-600 flex items-center justify-center">
|
|
|
|
|
{session?.user?.name?.charAt(0).toUpperCase()}
|
|
|
|
|
{session?.user?.name?.split(" ")[1]?.charAt(0).toUpperCase()}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
<div className="text-center text-sm">
|
|
|
|
|
<p>{session?.user?.name}</p>
|
|
|
|
|
<p>{session?.user?.email}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<LogoutButton />
|
|
|
|
|
</div>
|
2026-01-06 02:40:21 +00:00
|
|
|
</div>
|
2026-01-06 04:37:45 +00:00
|
|
|
);
|
2026-01-06 02:40:21 +00:00
|
|
|
}
|
|
|
|
|
|
2026-01-06 04:37:45 +00:00
|
|
|
export default Profile;
|