'use client'; import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import { Bell, CheckCircle, XCircle, Calendar, MessageCircle } from 'lucide-react'; import AuthService from '@/app/services/AuthService'; import { useNotifications } from '@/app/contexts/NotificationsContext'; export default function NotificationsPage() { const router = useRouter(); const { notifications, unreadCount, isLoading } = useNotifications(); const [error, setError] = useState(null); useEffect(() => { if (!AuthService.isAuthenticated()) { router.push('/login'); return; } }, [router]); const markAsRead = (id) => { // This will be handled by context if needed }; const markAllAsRead = () => { // This will be handled by context if needed }; if (isLoading) { return (
جاري التحميل...
{error}
{unreadCount > 0 ? `لديك ${unreadCount} إشعار غير مقروء` : 'جميع الإشعارات مقروءة'}
ستظهر هنا الإشعارات المتعلقة بحجوزاتك ومدفوعاتك
{notification.message}
)} {notification.date && ({notification.date}
)}