48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
"use client"
|
|
|
|
import { Button } from "@/components/ui/button"
|
|
import { Bell, LogOut } from "lucide-react"
|
|
import { logoutAction } from "@/lib/actions/auth.actions"
|
|
import { useRouter } from "next/navigation"
|
|
import { AIChatToggle } from "@/components/ai/ai-chat-toggle"
|
|
|
|
interface AdminHeaderProps {
|
|
user: {
|
|
firstName: string
|
|
lastName: string
|
|
}
|
|
}
|
|
|
|
export function AdminHeader({ user }: AdminHeaderProps) {
|
|
const router = useRouter()
|
|
|
|
const handleLogout = async () => {
|
|
await logoutAction()
|
|
router.push("/login")
|
|
router.refresh()
|
|
}
|
|
|
|
return (
|
|
<header className="h-16 border-b bg-card flex items-center justify-between px-6">
|
|
<div>
|
|
<h1 className="text-2xl font-bold">Adminisztráció</h1>
|
|
<p className="text-sm text-muted-foreground">Üdvözöljük, {user.firstName}!</p>
|
|
</div>
|
|
|
|
<div className="flex items-center gap-4">
|
|
<AIChatToggle variant="icon" showBadge />
|
|
|
|
<Button variant="ghost" size="icon" className="relative">
|
|
<Bell className="w-5 h-5" />
|
|
<span className="absolute top-1 right-1 w-2 h-2 bg-red-500 rounded-full" />
|
|
</Button>
|
|
|
|
<Button variant="outline" size="sm" onClick={handleLogout}>
|
|
<LogOut className="w-4 h-4 mr-2" />
|
|
Kijelentkezés
|
|
</Button>
|
|
</div>
|
|
</header>
|
|
)
|
|
}
|