@extends('layouts.app') @section('title', 'Notifications') @section('content')

Notifications

{{ $unreadCount > 0 ? $unreadCount . ' unread' : "You're all caught up." }}

@if($unreadCount > 0)
@csrf @method('PATCH')
@endif
@if($notifications->isEmpty())

No notifications yet. We'll let you know when something about your crop plans changes.

@else @foreach($notifications as $notification) @php $iconMap = [ 'info' => ['icon' => 'bi-info-circle', 'color' => '#3d6b8c'], 'warning' => ['icon' => 'bi-exclamation-triangle', 'color' => '#c9a227'], 'critical' => ['icon' => 'bi-exclamation-octagon', 'color' => '#a13d2e'], ]; $sev = $iconMap[$notification->severity] ?? $iconMap['info']; @endphp
{{ $notification->title }} {{ $notification->created_at->diffForHumans() }}

{{ $notification->message }}

@if($notification->crop_plan_id) View Plan @endif @if(!$notification->is_read)
@csrf @method('PATCH')
@else Read @endif
@endforeach
{{ $notifications->links() }}
@endif
@endsection