30 lines
691 B
TypeScript
30 lines
691 B
TypeScript
'use client'
|
|
|
|
import { createAuthClient } from 'better-auth/react'
|
|
import { useRouter } from 'next/navigation'
|
|
|
|
const authClient = createAuthClient()
|
|
|
|
export function Header() {
|
|
const router = useRouter()
|
|
|
|
async function handleSignOut() {
|
|
await authClient.signOut()
|
|
router.push('/login')
|
|
}
|
|
|
|
return (
|
|
<header className="h-14 bg-white border-b flex items-center justify-between px-6 flex-shrink-0">
|
|
<div />
|
|
<div className="flex items-center gap-4">
|
|
<button
|
|
onClick={handleSignOut}
|
|
className="text-sm text-gray-600 hover:text-gray-900 transition-colors"
|
|
>
|
|
Abmelden
|
|
</button>
|
|
</div>
|
|
</header>
|
|
)
|
|
}
|