"use client"; import { useState } from "react"; import { Bell, X, Pill, Calendar, AlertCircle, Info, CheckCheck, } from "lucide-react"; import type { Notification } from "@/lib/hooks/useNotifications"; interface NotificationCenterProps { notifications: Notification[]; count: number; onDismiss: (id: string) => void; onDismissAll: () => void; } /** * Notification bell + dropdown panel. * * Shows a badge with the active notification count. Clicking the bell * opens a dropdown listing overdue medications, upcoming appointments, * and health reminders. Each notification can be dismissed individually * or all at once. * * Desktop: dropdown positioned below the bell. * Mobile: also a dropdown (could be upgraded to a sheet later). */ export function NotificationBell({ notifications, count, onDismiss, onDismissAll, }: NotificationCenterProps) { const [open, setOpen] = useState(false); return (
{/* Bell button */} {/* Dropdown panel */} {open && ( <> {/* Backdrop — closes on click */}
setOpen(false)} />
{/* Header */}

Notifications

{count > 0 && ( )}
{/* Notification list */}
{notifications.length === 0 ? (

All caught up!

No pending reminders right now

) : ( notifications.map((n) => (
{n.title} {n.message}
)) )}
)}
); } function NotificationIcon({ type, urgent, }: { type: Notification["type"]; urgent: boolean; }) { const iconMap = { medication: Pill, appointment: Calendar, reminder: AlertCircle, info: Info, }; const Icon = iconMap[type] || Info; return (
); }