5 lines
1.3 KiB
PHP
5 lines
1.3 KiB
PHP
<div class="space-y-4">
|
|
<div class="flex justify-end"><button wire:click="markAllAsRead" class="rounded-xl border border-slate-300 px-3 py-2 text-sm">Отметить все как прочитанные</button></div>
|
|
<div class="card overflow-hidden"><table class="min-w-full text-sm"><thead class="bg-slate-50"><tr><th class="px-3 py-2 text-left">Уведомление</th><th class="px-3 py-2 text-left">Дата</th><th></th></tr></thead><tbody>@forelse($notifications as $notification)<tr class="border-t border-slate-100 {{ $notification->read_at ? '' : 'bg-blue-50' }}"><td class="px-3 py-2"><p class="font-medium">{{ $notification->data['title'] ?? 'Событие' }}</p><p class="text-xs text-slate-500">{{ $notification->data['message'] ?? '' }}</p></td><td class="px-3 py-2">{{ $notification->created_at?->format('d.m.Y H:i') }}</td><td class="px-3 py-2 text-right">@if(!$notification->read_at)<button wire:click="markAsRead('{{ $notification->id }}')" class="text-xs">Прочитано</button>@endif @if(!empty($notification->data['url']))<a href="{{ $notification->data['url'] }}" class="text-xs ml-2 text-slate-700">Открыть</a>@endif</td></tr>@empty<tr><td colspan="3" class="px-3 py-8 text-center text-slate-500">Нет уведомлений</td></tr>@endforelse</tbody></table><div class="p-4">{{ $notifications->links() }}</div></div>
|
|
</div>
|