22 lines
524 B
TypeScript
22 lines
524 B
TypeScript
'use client'
|
|
|
|
import { signOut } from 'next-auth/react'
|
|
import { LogOut } from 'lucide-react'
|
|
|
|
export default function LogoutButton() {
|
|
const handleLogout = async () => {
|
|
await signOut({ callbackUrl: '/auth/login' })
|
|
}
|
|
|
|
return (
|
|
<button
|
|
onClick={handleLogout}
|
|
className="flex items-center gap-2 px-3 py-2 text-sm text-red-600 hover:text-red-700 hover:bg-red-50 rounded-lg transition-colors"
|
|
aria-label="Log out"
|
|
>
|
|
<LogOut size={16} />
|
|
<span>Log out</span>
|
|
</button>
|
|
)
|
|
}
|