"use client";
import { useState } from "react";
import { Button } from "@/components/ui/button";
import {
Bell,
X,
CheckCircle,
AlertCircle,
Info,
Calendar,
Clock,
} from "lucide-react";
import { cn } from "@/lib/utils";
import { useAppTheme } from "@/components/ThemeProvider";
export interface Notification {
id: string;
type: "success" | "warning" | "info" | "appointment";
title: string;
message: string;
time: string;
read: boolean;
}
interface NotificationsProps {
notifications: Notification[];
onMarkAsRead?: (id: string) => void;
onDismiss?: (id: string) => void;
onMarkAllAsRead?: () => void;
}
export function Notifications({
notifications,
onMarkAsRead,
onDismiss,
onMarkAllAsRead,
}: NotificationsProps) {
const unreadCount = notifications.filter((n) => !n.read).length;
const { theme } = useAppTheme();
const isDark = theme === "dark";
const getIcon = (type: Notification["type"]) => {
switch (type) {
case "success":
return ;
case "warning":
return ;
case "info":
return ;
case "appointment":
return ;
}
};
const getBgColor = (type: Notification["type"]) => {
switch (type) {
case "success":
return isDark ? "bg-green-500/10 border-green-500/30" : "bg-[#4A90A4]/10 border-[#4A90A4]/30";
case "warning":
return isDark ? "bg-rose-500/10 border-rose-400/40" : "bg-rose-100 border-rose-300";
case "info":
return isDark ? "bg-pink-500/10 border-pink-400/40" : "bg-pink-50 border-pink-200";
case "appointment":
return isDark ? "bg-rose-500/10 border-rose-400/40" : "bg-gradient-to-br from-rose-50 to-pink-50 border-rose-300";
}
};
return (
{/* Header */}
Notifications
{unreadCount > 0 && (
{unreadCount}
)}
{unreadCount > 0 && onMarkAllAsRead && (
)}
{/* Notifications List */}
{notifications.length === 0 ? (
) : (
notifications.map((notification) => (
{getIcon(notification.type)}
{notification.title}
{notification.message}
{notification.time}
{!notification.read && onMarkAsRead && (
)}
{onDismiss && (
)}
))
)}
);
}
// Notification Bell Component for Header
export function NotificationBell({
count,
onClick,
}: {
count: number;
onClick: () => void;
}) {
return (
);
}