mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 14:37:13 +01:00
21 lines
446 B
TypeScript
21 lines
446 B
TypeScript
import { useSession, signOut } from 'next-auth/react'
|
|
|
|
export default function User() {
|
|
const { data, status } = useSession()
|
|
|
|
if (status === 'loading' || !data?.user?.email) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<div className="font-extrabold bg-red-400 px-2 py-1 mr-3 rounded-sm">
|
|
{data.user.email}
|
|
</div>
|
|
<button onClick={() => signOut()} className="btn btn-blue">
|
|
Logout
|
|
</button>
|
|
</>
|
|
)
|
|
}
|