102 lines
6.2 KiB
PHP
102 lines
6.2 KiB
PHP
<x-filament-panels::page>
|
|
<div class="space-y-4">
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
|
<div>
|
|
<div class="text-lg font-semibold text-slate-900">Regia comunicazioni</div>
|
|
<div class="text-sm text-slate-600">Vista unica per amministratore: protocollo per stabile, casistiche di studio e messaggi che devono ancora diventare ticket o lavorazione.</div>
|
|
</div>
|
|
<div class="flex flex-wrap gap-2">
|
|
<select wire:model.live="stabileId" class="rounded-lg border-slate-300 text-sm">
|
|
<option value="">Tutti gli stabili</option>
|
|
@foreach($stabileOptions as $id => $label)
|
|
<option value="{{ $id }}">{{ $label }}</option>
|
|
@endforeach
|
|
</select>
|
|
<select wire:model.live="channel" class="rounded-lg border-slate-300 text-sm">
|
|
<option value="all">Tutti i canali</option>
|
|
<option value="email">Email</option>
|
|
<option value="phone">Telefono</option>
|
|
<option value="whatsapp">WhatsApp</option>
|
|
</select>
|
|
<select wire:model.live="queue" class="rounded-lg border-slate-300 text-sm">
|
|
<option value="all">Tutto</option>
|
|
<option value="attenzione">Da lavorare</option>
|
|
<option value="ticket">Con ticket</option>
|
|
<option value="studio">Solo studio</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid gap-4 md:grid-cols-4">
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="text-xs uppercase tracking-wide text-slate-500">Totale</div>
|
|
<div class="mt-2 text-2xl font-semibold text-slate-900">{{ $stats['totale'] }}</div>
|
|
</div>
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="text-xs uppercase tracking-wide text-slate-500">Email</div>
|
|
<div class="mt-2 text-2xl font-semibold text-slate-900">{{ $stats['email'] }}</div>
|
|
</div>
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="text-xs uppercase tracking-wide text-slate-500">Da lavorare</div>
|
|
<div class="mt-2 text-2xl font-semibold text-slate-900">{{ $stats['attenzione'] }}</div>
|
|
</div>
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="text-xs uppercase tracking-wide text-slate-500">Studio</div>
|
|
<div class="mt-2 text-2xl font-semibold text-slate-900">{{ $stats['studio'] }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="rounded-xl border bg-white overflow-hidden">
|
|
<div class="border-b px-4 py-3 text-sm font-semibold text-slate-900">Ultime comunicazioni</div>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-slate-200 text-sm">
|
|
<thead class="bg-slate-50">
|
|
<tr>
|
|
<th class="px-4 py-3 text-left font-medium text-slate-600">Protocollo</th>
|
|
<th class="px-4 py-3 text-left font-medium text-slate-600">Stabile</th>
|
|
<th class="px-4 py-3 text-left font-medium text-slate-600">Canale</th>
|
|
<th class="px-4 py-3 text-left font-medium text-slate-600">Mittente</th>
|
|
<th class="px-4 py-3 text-left font-medium text-slate-600">Messaggio</th>
|
|
<th class="px-4 py-3 text-left font-medium text-slate-600">Stato</th>
|
|
<th class="px-4 py-3 text-left font-medium text-slate-600">Ticket</th>
|
|
<th class="px-4 py-3 text-left font-medium text-slate-600">Ricevuto</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-slate-100 bg-white">
|
|
@forelse($rows as $row)
|
|
<tr>
|
|
<td class="px-4 py-3 align-top font-mono text-xs text-slate-700">{{ $row['protocol_number'] }}</td>
|
|
<td class="px-4 py-3 align-top">
|
|
@if($row['stabile_url'])
|
|
<a href="{{ $row['stabile_url'] }}" class="text-primary-600 hover:underline">{{ $row['stabile_label'] }}</a>
|
|
@else
|
|
<span class="text-slate-500">{{ $row['stabile_label'] }}</span>
|
|
@endif
|
|
</td>
|
|
<td class="px-4 py-3 align-top">{{ strtoupper($row['channel']) }}</td>
|
|
<td class="px-4 py-3 align-top">{{ $row['sender_name'] }}</td>
|
|
<td class="px-4 py-3 align-top text-slate-600">{{ $row['message_text'] }}</td>
|
|
<td class="px-4 py-3 align-top">{{ $row['status'] }}</td>
|
|
<td class="px-4 py-3 align-top">
|
|
@if($row['ticket_url'])
|
|
<a href="{{ $row['ticket_url'] }}" class="text-primary-600 hover:underline">#{{ $row['ticket_id'] }}</a>
|
|
@else
|
|
<span class="text-slate-500">-</span>
|
|
@endif
|
|
</td>
|
|
<td class="px-4 py-3 align-top text-slate-500">{{ $row['received_at'] }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="8" class="px-4 py-10 text-center text-sm text-slate-500">Nessuna comunicazione trovata con i filtri attivi.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-filament-panels::page>
|