@extends('layouts.app') @section('title', 'Histórico de Notificações') @section('content')

Histórico de Notificações

Acompanhe todas as notificações enviadas para sua conta

Total de Notificações

{{ $notificacoes->total() }}

Configurações
@php $stats = [ 'total' => $notificacoes->total(), 'enviadas' => $notificacoes->where('status', 'enviado')->count() + $notificacoes->where('status', 'entregue')->count(), 'falhadas' => $notificacoes->where('status', 'falhado')->count(), 'pendentes' => $notificacoes->where('status', 'pendente')->count() ]; $taxaEntrega = $stats['total'] > 0 ? round(($stats['enviadas'] / $stats['total']) * 100, 1) : 0; @endphp

Total

{{ $stats['total'] }}

Todas as notificações

Enviadas

{{ $stats['enviadas'] }}

{{ $taxaEntrega }}% do total

Falhadas

{{ $stats['falhadas'] }}

Requer atenção

Pendentes

{{ $stats['pendentes'] }}

Aguardando envio

Notificações Enviadas

@if($notificacoes->count() > 0)
@foreach($notificacoes as $notificacao)
@if($notificacao->tipo === 'sms')
@else
@endif
@php $categoriaColors = [ 'emergencia' => 'bg-red-100 text-red-800', 'alerta' => 'bg-orange-100 text-orange-800', 'resolucao' => 'bg-green-100 text-green-800', 'escalacao' => 'bg-purple-100 text-purple-800' ]; $categoriaColor = $categoriaColors[$notificacao->categoria] ?? 'bg-gray-100 text-gray-800'; @endphp @if($notificacao->categoria === 'emergencia') 🚨 Emergência @elseif($notificacao->categoria === 'alerta') 🔔 Alerta @elseif($notificacao->categoria === 'resolucao') ✅ Resolução @elseif($notificacao->categoria === 'escalacao') ⚠️ Escalação @else {{ ucfirst($notificacao->categoria) }} @endif @php $statusColors = [ 'pendente' => 'bg-yellow-100 text-yellow-800', 'enviado' => 'bg-blue-100 text-blue-800', 'entregue' => 'bg-green-100 text-green-800', 'falhado' => 'bg-red-100 text-red-800' ]; $statusColor = $statusColors[$notificacao->status] ?? 'bg-gray-100 text-gray-800'; @endphp {{ ucfirst($notificacao->status) }}

@if($notificacao->alerta) {{ $notificacao->alerta->titulo }} @else Notificação do Sistema @endif

{{ Str::limit($notificacao->conteudo, 150) }}

@if(strlen($notificacao->conteudo) > 150) @endif
{{ $notificacao->created_at->format('d/m/Y H:i') }} {{ $notificacao->destinatario }} @if($notificacao->alerta) {{ $notificacao->alerta->getNomeInfrastrutura() }} @endif
@if($notificacao->status === 'falhado')
@csrf
@endif @if($notificacao->external_id) ID: {{ Str::limit($notificacao->external_id, 8) }} @endif
@if($notificacao->status === 'falhado' && $notificacao->erro_detalhes)
Erro: {{ $notificacao->erro_detalhes }}
@endif
@endforeach
{{ $notificacoes->links() }}
@else

Nenhuma notificação encontrada

Você ainda não recebeu nenhuma notificação do sistema.

Configurar Notificações
@endif
@push('scripts') @endpush @push('styles') @endpush @endsection