"use client"; import { useState } from "react"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { Button } from "@/components/ui/button"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { Inbox, Calendar, LayoutGrid, Heart, UserCog, Bell, Settings, LogOut, FileText, } from "lucide-react"; import { useAppTheme } from "@/components/ThemeProvider"; import { ThemeToggle } from "@/components/ThemeToggle"; import { useAuth } from "@/hooks/useAuth"; import { toast } from "sonner"; export function Header() { const pathname = usePathname(); const router = useRouter(); const [notificationsOpen, setNotificationsOpen] = useState(false); const [userMenuOpen, setUserMenuOpen] = useState(false); const { theme } = useAppTheme(); const isDark = theme === "dark"; const { logout } = useAuth(); const handleLogout = () => { setUserMenuOpen(false); logout(); toast.success("Logged out successfully"); router.push("/"); }; // Mock notifications data const notifications = [ { id: 1, title: "New appointment scheduled", message: "John Smith booked an appointment for tomorrow", time: "2 hours ago", type: "info", read: false, }, { id: 2, title: "Payment received", message: "Payment of $150 received from Jane Doe", time: "5 hours ago", type: "success", read: false, }, ]; const unreadCount = notifications.filter((n) => !n.read).length; return (
{/* Logo */}
{/* Navigation Links */} {/* Right Side Actions */}
{/* Thumbtack Design at Top Right */}

Notifications

{unreadCount > 0 && ( {unreadCount} new )}
{notifications.length === 0 ? (

No notifications

) : (
{notifications.map((notification) => { return (

{notification.title}

{!notification.read && ( )}

{notification.message}

{notification.time}

); })}
)}
setNotificationsOpen(false)} className={`block w-full text-center text-sm font-medium hover:underline transition-colors ${isDark ? "text-rose-300 hover:text-rose-200" : "text-rose-600 hover:text-rose-700"}`} > View all notifications
{/* Thumbtack Design at Top Right */}
); }