- Nueva página /chat/comprobantes: tabla paginada de solicitudes_recarga con búsqueda por email/nombre, filtros por estado y canal, botón "Ver chat" - ShowConversaciones: búsqueda también por email del usuario autenticado - ShowConversaciones: soporta ?conv=ID para abrir conversación desde comprobantes - Nav: reemplaza "Menús del Bot" (no funcional) por "Comprobantes" - SolicitudRecarga: relación user() agregada - ChatController: método comprobantes() agregado Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
100 lines
5.5 KiB
PHP
100 lines
5.5 KiB
PHP
<div class="p-6">
|
|
|
|
{{-- Filtros --}}
|
|
<div class="flex flex-wrap gap-3 mb-5">
|
|
<input wire:model.debounce.300ms="busqueda" type="text"
|
|
placeholder="Buscar por email o nombre..."
|
|
class="flex-1 min-w-[220px] bg-white border border-gray-200 rounded-lg px-4 py-2 text-sm shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500">
|
|
|
|
<select wire:model="filtroEstado"
|
|
class="bg-white border border-gray-200 rounded-lg px-3 py-2 text-sm shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500">
|
|
<option value="">Todos los estados</option>
|
|
<option value="pendiente">🟡 Pendiente</option>
|
|
<option value="confirmada">✅ Confirmada</option>
|
|
<option value="expirada">⛔ Expirada</option>
|
|
</select>
|
|
|
|
<select wire:model="filtroCanal"
|
|
class="bg-white border border-gray-200 rounded-lg px-3 py-2 text-sm shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500">
|
|
<option value="">Todos los canales</option>
|
|
<option value="web">🌐 Web</option>
|
|
<option value="telegram">✈️ Telegram</option>
|
|
</select>
|
|
</div>
|
|
|
|
{{-- Tabla --}}
|
|
<div class="bg-white rounded-xl shadow overflow-hidden">
|
|
<table class="w-full text-sm">
|
|
<thead class="bg-gray-50 border-b border-gray-100">
|
|
<tr>
|
|
<th class="text-left px-4 py-3 text-gray-500 font-medium">#</th>
|
|
<th class="text-left px-4 py-3 text-gray-500 font-medium">Fecha</th>
|
|
<th class="text-left px-4 py-3 text-gray-500 font-medium">Usuario</th>
|
|
<th class="text-left px-4 py-3 text-gray-500 font-medium">Canal</th>
|
|
<th class="text-left px-4 py-3 text-gray-500 font-medium">Titular</th>
|
|
<th class="text-right px-4 py-3 text-gray-500 font-medium">Monto</th>
|
|
<th class="text-center px-4 py-3 text-gray-500 font-medium">Estado</th>
|
|
<th class="text-center px-4 py-3 text-gray-500 font-medium">Chat</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-50">
|
|
@forelse($solicitudes as $s)
|
|
<tr class="hover:bg-gray-50 transition">
|
|
<td class="px-4 py-3 text-gray-400 text-xs">{{ $s->id }}</td>
|
|
<td class="px-4 py-3 text-gray-600 whitespace-nowrap">
|
|
{{ $s->created_at ? $s->created_at->format('d/m/y H:i') : '—' }}
|
|
</td>
|
|
<td class="px-4 py-3">
|
|
@if($s->user)
|
|
<p class="font-medium text-gray-800">{{ $s->user->name }}</p>
|
|
<p class="text-gray-400 text-xs">{{ $s->user->email }}</p>
|
|
@else
|
|
<span class="text-gray-400 text-xs">Usuario eliminado</span>
|
|
@endif
|
|
</td>
|
|
<td class="px-4 py-3">
|
|
@if($s->canal === 'telegram')
|
|
<span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-blue-100 text-blue-700">✈️ Telegram</span>
|
|
@else
|
|
<span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-emerald-100 text-emerald-700">🌐 Web</span>
|
|
@endif
|
|
</td>
|
|
<td class="px-4 py-3 text-gray-600 text-xs">{{ $s->nombre_remitente ?? '—' }}</td>
|
|
<td class="px-4 py-3 text-right font-semibold text-gray-800">
|
|
${{ number_format($s->monto) }}
|
|
</td>
|
|
<td class="px-4 py-3 text-center">
|
|
@if($s->estado === 'confirmada')
|
|
<span class="inline-block px-2.5 py-1 rounded-full text-xs font-semibold bg-green-100 text-green-700">✅ Confirmada</span>
|
|
@elseif($s->estado === 'pendiente')
|
|
<span class="inline-block px-2.5 py-1 rounded-full text-xs font-semibold bg-yellow-100 text-yellow-700">🟡 Pendiente</span>
|
|
@else
|
|
<span class="inline-block px-2.5 py-1 rounded-full text-xs font-semibold bg-red-100 text-red-700">⛔ Expirada</span>
|
|
@endif
|
|
</td>
|
|
<td class="px-4 py-3 text-center">
|
|
@if($s->user_id)
|
|
<button wire:click="verChat({{ $s->user_id }})"
|
|
class="text-xs px-3 py-1.5 bg-[#00a884] hover:bg-[#06cf9c] text-white rounded-lg transition font-medium">
|
|
Ver chat
|
|
</button>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="8" class="px-4 py-10 text-center text-gray-400">No hay registros</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
|
|
@if($solicitudes->hasPages())
|
|
<div class="px-4 py-3 border-t border-gray-100">
|
|
{{ $solicitudes->links() }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
</div>
|