@extends('layouts.admin.master') @section('content') @php $activeContact = $activeConversation?->otherParticipantFor($viewer); $isActiveGroup = $activeConversation && $activeConversation->type !== 'direct'; $activeConversationAvatar = $activeConversation?->avatarUrlFor($viewer) ?: $viewer->avatarUrl(); @endphp
@if ($activeConversation)
{{ $activeConversation->displayNameFor($viewer) }}
{{ $activeConversation->displayNameFor($viewer) }} {{ data_get($activeConversationStatus, 'label', $isActiveGroup ? $activeConversation->participants->count() . ' anggota' : ($activeContact?->email ?? 'Percakapan langsung')) }}
Polling aktif
@csrf
@csrf
@csrf
@if ($isActiveGroup)
Grup anggota {{ $activeConversation->displayNameFor($viewer) }} @if (filled($activeConversation->description)) {{ \Illuminate\Support\Str::limit($activeConversation->description, 96) }} @else {{ $activeConversation->participants->count() }} anggota @if ($activeConversation->creator) · dibuat oleh {{ $activeConversation->creator->chatLabel() }} @endif @endif
@endif @endif
@if ($activeConversation) @php($previousMessageDate = null) @forelse ($messages as $item) @php($isMine = $item->user_id === $viewer->id) @php($messageDateKey = optional($item->created_at)->format('Y-m-d')) @php( $messageDateLabel = $item->created_at?->isToday() ? 'Hari ini' : ($item->created_at?->isYesterday() ? 'Kemarin' : $item->created_at?->translatedFormat('d M Y')) ) @if ($messageDateKey && $messageDateKey !== $previousMessageDate)
{{ $messageDateLabel }}
@php($previousMessageDate = $messageDateKey) @endif
@unless ($isMine) {{ $item->user?->chatLabel() ?? 'Anggota' }} @endunless
{{ $isMine ? 'Anda' : ($item->user?->chatLabel() ?? 'Anggota') }}
@if (data_get($item->meta, 'edited_at')) Diedit @endif @if ($isMine)
@endif

{{ $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 di obrolan ini.

Kirim sapaan pertama dari kolom bawah. Pesan masuk dan balasan akan langsung tampil di area ini.

@endforelse @else

Belum ada obrolan yang dibuka.

Pilih riwayat dari sidebar kiri, cari anggota, atau buat grup baru untuk mulai ngobrol.

@endif
@include('pages.admin.member.partials.account-modals', [ 'anggota' => $anggota, 'user' => $user, 'viewer' => $viewer, ]) @if ($isActiveGroup) @include('pages.admin.member.partials.manage-group-modal', [ 'activeConversation' => $activeConversation, 'activeConversationAvatar' => $activeConversationAvatar, 'viewer' => $viewer, 'canManageActiveGroup' => $canManageActiveGroup, 'isActiveGroupOwner' => $isActiveGroupOwner, 'activeGroupRole' => $activeGroupRole, 'availableGroupMembers' => $availableGroupMembers, 'pendingOutgoingGroupInvites' => $pendingOutgoingGroupInvites, ]) @endif @endsection @section('stylesheet') @endsection @section('javascript') @endsection