@extends('layouts.app') @section('title', 'الإشعارات') @php $totalNotif = $notifications->total(); $unreadCount = collect($notifications->items())->whereNull('read_at')->count(); @endphp @section('content') @if($unreadCount > 0) @endif

كل الإشعارات

@if($notifications->isEmpty())

لا توجد إشعارات

أي حدث جديد هيظهر هنا تلقائياً.

@else
@foreach($notifications as $n) @php $isUnread = ! $n->read_at; $isTelehealth = (bool) ($n->data['is_telehealth'] ?? false); $meetingUrl = $n->data['meeting_url'] ?? null; $minutesBefore = $n->data['minutes_before'] ?? null; // Avatar tone follows the same logic as the dropdown: // telehealth = green, urgent bucket = red, soon = amber. if ($isTelehealth) { $avatarBg = '#ecfdf5'; $avatarFg = '#059669'; } elseif ($minutesBefore !== null && $minutesBefore <= 2) { $avatarBg = '#fef2f2'; $avatarFg = '#dc2626'; } elseif ($minutesBefore !== null && $minutesBefore <= 5) { $avatarBg = '#fef3c7'; $avatarFg = '#b45309'; } else { $avatarBg = '#dbeafe'; $avatarFg = '#1e40af'; } @endphp
{{ $n->data['title'] ?? 'إشعار' }} @if($minutesBefore !== null) {{ $minutesBefore }} د @endif @if($isUnread) جديد @else مقروء @endif
{{ $n->created_at->diffForHumans() }}
@if(! empty($n->data['body']))
{{ $n->data['body'] }}
@endif @if($isTelehealth && $meetingUrl) ادخل على الاجتماع @endif
@if(! empty($n->data['url']) && ! $isTelehealth) عرض @endif
@endforeach
@if($notifications->hasPages()) @endif @endif
@endsection @push('scripts') @endpush