"use client"; import { useState } from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useAuth } from "@/hooks/use-auth"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Icons } from "@/components/icons"; import { Badge } from "@/components/ui/badge"; export function Navbar() { const pathname = usePathname(); const { user, logout } = useAuth(); const [notificationCount, setNotificationCount] = useState(3); const notifications = [ { id: 1, title: "New task assigned", description: "You have been assigned a new task", time: "5 minutes ago", read: false, }, { id: 2, title: "Task completed", description: "Your task 'Update documentation' has been completed", time: "1 hour ago", read: false, }, { id: 3, title: "Meeting reminder", description: "Team meeting starts in 30 minutes", time: "2 hours ago", read: false, }, ]; // eslint-disable-next-line @typescript-eslint/no-unused-vars const markAsRead = (id: number) => { setNotificationCount(Math.max(0, notificationCount - 1)); }; const markAllAsRead = () => { setNotificationCount(0); }; return (
Todo App
{/* Notifications Dropdown */} Notifications {notificationCount > 0 && ( )} {notifications.length === 0 ? (
No new notifications
) : ( notifications.map((notification) => ( markAsRead(notification.id)} >
{notification.title} {notification.time}

{notification.description}

)) )} View all notifications
{user?.username || "User"} Profile List View Kanban View Manage Tags Log out
); }