@extends('layouts.admin.master') @section('content') @php $viewerId = auth()->id(); @endphp

Total Obrolan

{{ number_format($stats['total_conversations']) }}

Total Pesan

{{ number_format($stats['total_messages']) }}

Pesan Hari Ini

{{ number_format($stats['messages_today']) }}

Daftar Blokir

{{ number_format($stats['blocked_members']) }}

{{ $conversation->type !== 'direct' && $conversation->name ? $conversation->name : ($conversation->participants->map(fn($participant) => $participant->chatLabel())->filter()->implode(' & ') ?: 'Percakapan baru') }}
{{ $conversation->type }} ID #{{ $conversation->id }}

{{ $conversation->participants->count() }} peserta, {{ number_format($messages->count()) }} pesan terakhir ditampilkan

@foreach ($conversation->participants as $participant)
{{ $participant->chatLabel() }}
{{ $participant->chatLabel() }} {{ $participant->email }}
{{ $participant->active ? 'Aktif' : 'Diblokir' }} @if ($participant->hasRole(config('app.super_admin_role'))) Admin @endif
@endforeach
@forelse ($messages as $item) @php $isMine = $item->user_id === $viewerId; $isAdminReply = (bool) data_get($item->meta, 'admin_reply', false); @endphp
{{ $item->user?->chatLabel() ?? 'Anggota' }}
{{ $isMine ? 'Anda' : ($item->user?->chatLabel() ?? 'Anggota') }} @if ($isAdminReply) Admin @endif
@if (data_get($item->meta, 'edited_at')) Diedit @endif {{ $item->created_at?->format('d M Y, H:i') }}

{{ $item->body }}

@php($messageAttachments = collect(data_get($item->meta, 'attachments', []))->filter(fn ($attachment) => filled(data_get($attachment, 'url')))) @if ($messageAttachments->isNotEmpty())
@foreach ($messageAttachments as $attachment) @php($attachmentType = data_get($attachment, 'type', 'document')) @if ($attachmentType === 'image') {{ data_get($attachment, 'name', 'Lampiran gambar') }} {{ data_get($attachment, 'name', 'Gambar') }} @elseif ($attachmentType === 'video') @else {{ data_get($attachment, 'name', 'Dokumen') }} @endif @endforeach
@endif @php($messageLocation = data_get($item->meta, 'location')) @if (is_array($messageLocation) && filled(data_get($messageLocation, 'maps_url'))) Lokasi dibagikan {{ data_get($messageLocation, 'lat') }}, {{ data_get($messageLocation, 'lng') }} @endif
@empty
Belum ada pesan.

Percakapan ini belum memiliki isi pesan untuk ditampilkan.

@endforelse
@endsection @section('stylesheet') @endsection @section('javascript') @endsection