@extends(auth()->user()->isAdmin() ? 'admin.layouts.app' : (auth()->user()->isCoach() ? 'coach.layouts.app' : 'athlete.layouts.app'))

@section('title', 'اعلان‌ها')

@section('content')
    <h1 class="text-xl font-bold mb-6">اعلان‌ها</h1>

    <div class="space-y-2">
        @forelse($notifications as $notification)
            <a href="{{ $notification->action_url ?: '#' }}"
               class="block bg-white rounded-xl shadow-sm p-4 {{ $notification->isRead() ? '' : 'border-r-4 border-blue-500' }}">
                <div class="font-medium text-sm">{{ $notification->title }}</div>
                @if($notification->body)
                    <div class="text-gray-500 text-sm mt-1">{{ $notification->body }}</div>
                @endif
                <div class="text-gray-400 text-xs mt-2">{{ verta($notification->created_at)->format('Y/m/d H:i') }}</div>
            </a>
        @empty
            <p class="text-gray-400 text-center py-10">اعلانی وجود ندارد.</p>
        @endforelse
    </div>

    <div class="mt-4">{{ $notifications->links() }}</div>
@endsection
