@extends('student.layouts.app') @section('title', __('dashboard.Notifications')) @section('content') @php $isArabic = app()->getLocale() === 'ar'; $notificationItems = $notifications->getCollection(); $unreadCount = $notificationItems->whereNull('seen_at')->count(); $generalCount = $notificationItems->where('kind', 'general')->count(); $directCount = $notificationItems->where('kind', 'system')->count(); @endphp
{{ $isArabic ? 'مركز إشعارات الطالب' : 'Student notification center' }}

{{ $isArabic ? 'كل الإشعارات في مكان واحد' : 'All notifications in one place' }}

{{ $isArabic ? 'تابع الرسائل المباشرة والتنبيهات العامة، واعرف ما الجديد بدون ازدحام أو تشتت.' : 'Review direct messages and general alerts in one cleaner, more focused page.' }}

{{ $isArabic ? 'غير المقروءة' : 'Unread' }}
{{ $unreadCount }}
{{ $isArabic ? 'إشعارات عامة' : 'General' }}
{{ $generalCount }}
{{ $isArabic ? 'مباشرة' : 'Direct' }}
{{ $directCount }}

{{ $isArabic ? 'إدارة سريعة' : 'Quick controls' }}

{{ $isArabic ? 'اجعل الصفحة أخف بتنظيف الإشعارات غير المقروءة أو افتح أحدث العناصر مباشرة.' : 'Keep the page light by clearing unread alerts or opening recent items directly.' }}

@if ($notificationItems->isNotEmpty()) @php $latestNotification = $notificationItems->first(); @endphp
{{ $isArabic ? 'فتح أحدث إشعار' : 'Open latest notification' }}
{{ $latestNotification->title }}
@endif

{{ $isArabic ? 'سجل الإشعارات' : 'Notification feed' }}

{{ $isArabic ? 'العناصر الأحدث أولاً، مع تمييز واضح للرسائل غير المقروءة.' : 'Newest items first, with a clearer unread state.' }}

{{ $isArabic ? 'إشعار' : 'notifications' }}
{{-- Filter Tabs --}}
@if ($notificationItems->isNotEmpty()) @foreach ($notificationItems as $notification) @php $isUnread = $notification->seen_at === null; $kindLabel = $notification->kind === 'general' ? ($isArabic ? 'عام' : 'General') : ($isArabic ? 'مباشر' : 'Direct'); @endphp
@if ($isUnread) @endif
{{ $notification->title }}
{{ $kindLabel }} @if ($isUnread) {{ $isArabic ? 'غير مقروء' : 'Unread' }} @endif
{{ $notification->created_at->diffForHumans() }} {{-- زر mark as read (للإشعارات المباشرة غير المقروءة فقط) --}} @if ($notification->kind === 'system' && $isUnread) @endif {{-- زر الحذف (للإشعارات المباشرة فقط) --}} @if ($notification->kind === 'system') @endif

{{ $notification->body }}

@endforeach {{-- رسالة عند عدم وجود نتائج للفلتر --}}

{{ $isArabic ? 'لا توجد إشعارات في هذا التصنيف' : 'No notifications in this filter' }}

@else

{{ $isArabic ? 'لا توجد إشعارات حالياً' : 'No notifications right now' }}

{{ $isArabic ? 'عند وصول أي تنبيه جديد سيظهر هنا مباشرة.' : 'Any new alert will appear here as soon as it arrives.' }}

@endif
@if ($notifications->hasPages())
{{ $notifications->links() }}
@endif
@endsection