@extends('layouts.admin') @section('title', 'NPS & Avaliações') @section('breadcrumb')NPS & Avaliações@endsection @push('styles') @endpush @section('content') @php $periodLabels = ['30'=>'30 dias','90'=>'90 dias','180'=>'6 meses','365'=>'1 ano','all'=>'Tudo']; $filterLabels = [ '' => 'Todas', 'promoter' => '😊 Promotores', 'passive' => '😐 Passivos', 'detractor' => '😞 Detratores', ]; @endphp {{-- ══ Header ══ --}}

📊 NPS & Avaliações

Net Promoter Score · {{ $stats->totalReviews }} avaliações respondidas @if(!$stats->hasData()) · Sem dados no período@endif

{{-- Botão PDF --}} ↻ Atualizar
{{-- Modal PDF --}} {{-- ══ Filtros de Período ══ --}}
Período: @foreach($periodLabels as $key => $label) {{ $label }} @endforeach
{{-- ══ KPIs ══ --}}
{{-- Score NPS --}}
Score NPS
{{ $stats->scoreFormatted() }}
{{ $stats->scoreLabel() }}
-100 a +100
😊 Promotores
{{ $stats->promoters }}
{{ $stats->promoterPct }}% · notas 9–10
😐 Passivos
{{ $stats->passives }}
{{ $stats->passivePct }}% · notas 7–8
😞 Detratores
{{ $stats->detractors }}
{{ $stats->detractorPct }}% · notas 0–6
⭐ Avaliação Média
{{ $stats->avgOverall > 0 ? number_format($stats->avgOverall, 1) : '—' }}
de 5 estrelas
📩 Pendentes
{{ $statusCounts['pending'] }}
aguardando resposta
{{-- ══ Gráficos ══ --}} @if($stats->hasData())
{{-- Linha: NPS Mensal --}}
📈 Evolução NPS (12 meses)
{{-- Rosca: Promotor/Passivo/Detrator --}}
🍩 Distribuição NPS
{{-- Radar: Categorias --}}
🕸️ Notas por Categoria
{{-- Barras: Distribuição 0-10 --}}
📊 Distribuição de Notas (0–10)
@endif {{-- ══ Feed de Avaliações ══ --}}
@foreach($filterLabels as $key => $label) {{ $label }} @endforeach
Avaliações @if($filterNps) · {{ $filterLabels[$filterNps] ?? '' }} @endif {{ $reviews->total() }} total · página {{ $reviews->currentPage() }}
@forelse($reviews as $review) @php $catClass = match($review->npsCategory) { 'promoter' => 'badge-color-promoter', 'passive' => 'badge-color-passive', default => 'badge-color-detractor', }; $stars = str_repeat('★', $review->overall_rating ?? 0) . str_repeat('☆', 5 - ($review->overall_rating ?? 0)); @endphp
{{-- Nota NPS --}}
{{ $review->nps_score }}
{{-- Linha 1: guest + stars + data --}}
{{ $review->guest?->full_name ?? 'Anônimo' }} @if($review->overall_rating) {{ $stars }} @endif
{{ $review->submitted_at?->format('d/m/Y') }} Ver →
{{-- Título --}} @if($review->title)
"{{ $review->title }}"
@endif {{-- Comentário --}} @if($review->comment)
{{ Str::limit($review->comment, 180) }}
@endif {{-- Categorias --}} @php $cats = array_filter([ 'Limpeza' => $review->rating_cleanliness, 'Atend.' => $review->rating_service, 'Local.' => $review->rating_location, 'Custo' => $review->rating_value, 'Conforto'=> $review->rating_comfort, ]); @endphp @if(count($cats) > 0)
@foreach($cats as $cat => $val) {{ $cat }}: {{ $val }}★ @endforeach
@endif {{-- Meta --}}
@if($review->reservation) 🔖 {{ $review->reservation->locator }} @endif @if($review->guest?->vip_level && $review->guest->vip_level !== 'none') 💎 {{ ucfirst($review->guest->vip_level) }} @endif
@empty
📭
Nenhuma avaliação encontrada
As avaliações aparecem 24h após o checkout do hóspede.
@endforelse
{{-- Paginação --}} @if($reviews->hasPages())
@if($reviews->onFirstPage()) ‹ @else ‹ @endif @foreach($reviews->getUrlRange(max(1,$reviews->currentPage()-2),min($reviews->lastPage(),$reviews->currentPage()+2)) as $page => $url) {{ $page }} @endforeach @if($reviews->hasMorePages()) › @endif
@endif @endsection @push('scripts') @endpush