{{-- resources/views/livechat/index.blade.php --}} @extends('layouts.apps') @section('title', 'الدردشة المباشرة') @section('content')

الدردشة المباشرة

إدارة المحادثات المباشرة مع العملاء

{{ $activeChats->count() }}

محادثات نشطة

{{ $closedChats->count() }}

محادثات مغلقة اليوم

{{ $activeChats->sum(fn($chat) => $chat->getUnreadMessagesCount()) }}

رسائل غير مقروءة

{{ $activeChats->unique('visitor_id')->count() }}

زوار متصلون
المحادثات النشطة
{{ $activeChats->count() }}
@forelse($activeChats as $chat)
{{ strtoupper(substr($chat->visitor_name ?? 'الزائر', 0, 1)) }}
{{ $chat->visitor_name ?? 'زائر غير معروف' }} @if($chat->getUnreadMessagesCount() > 0) {{ $chat->getUnreadMessagesCount() }} @endif
@if($chat->latestMessage)

{{ Str::limit($chat->latestMessage->message, 60) }}

@endif
{{ $chat->last_activity_at->diffForHumans() }} {{ $chat->facebookPage->name }}
@empty
لا توجد محادثات نشطة

ستظهر المحادثات الجديدة هنا تلقائياً

@endforelse
محادثات مغلقة مؤخراً
@forelse($closedChats as $chat)
{{ strtoupper(substr($chat->visitor_name ?? 'ز', 0, 1)) }}
{{ $chat->visitor_name ?? 'زائر غير معروف' }}
{{ $chat->closed_at->diffForHumans() }}
المدة: {{ $chat->duration }}
@empty

لا توجد محادثات مغلقة

@endforelse
إحصائيات سريعة
متوسط وقت الاستجابة
2 دقيقة
معدل الرضا
94%
@endsection @push('scripts') @endpush @push('styles') @endpush