@extends('layouts.dashboard') @section('title', 'لوحة التحكم') @section('content')

📊 توزيع القنوات

@php $totalChannels = array_sum($stats['channel_stats']); @endphp @foreach($stats['channel_stats'] as $channel => $count) @php $percentage = $totalChannels > 0 ? ($count / $totalChannels) * 100 : 0; $config = $channelConfig[$channel] ?? ['icon' => '📩', 'name' => $channel, 'color' => 'bg-gray-500']; @endphp
{{ $config['icon'] }} {{ $config['name'] }} {{ number_format($count) }} ({{ number_format($percentage, 1) }}%)
@endforeach

🎯 أكثر النوايا شيوعاً

@forelse($stats['top_intents'] as $intent => $count)
{{ $intentNames[$intent] ?? $intent }} {{ number_format($count) }}
@empty

لا توجد بيانات بعد

@endforelse

🔥 عملاء محتملين ساخنين

عرض الكل
@forelse($hotLeads as $lead)

{{ $lead->display_name }}

{{ $channelConfig[$lead->channel]['icon'] ?? '📩' }} {{ $channelConfig[$lead->channel]['name'] ?? $lead->channel }} • {{ $lead->last_contact_date->diffForHumans() }}

{{ $lead->lead_score }}
@empty

لا توجد عملاء ساخنين حالياً

@endforelse

💬 آخر المحادثات

مباشر عرض الكل
@forelse($recentConversations as $conversation)

{{ Str::limit($conversation->text, 50) }}

{{ $channelConfig[$conversation->channel]['icon'] ?? '📩' }} {{ $conversation->created_at->diffForHumans() }} @if($conversation->detected_intent) • {{ $intentNames[$conversation->detected_intent] ?? $conversation->detected_intent }} @endif

@if($conversation->sent) @else @endif
@empty

لا توجد محادثات بعد

@endforelse

⚡ إجراءات سريعة

@endsection @push('scripts') @endpush