{{-- Stat tiles --}}
@php $tiles = [ ['label' => __('Total'), 'value' => $total, 'color' => 'brand'], ['label' => __('New'), 'value' => $counts[\App\Models\HomepageLead::STATUS_NEW] ?? 0, 'color' => 'info'], ['label' => __('Contacted'), 'value' => $counts[\App\Models\HomepageLead::STATUS_CONTACTED] ?? 0, 'color' => 'warning'], ['label' => __('Qualified'), 'value' => $counts[\App\Models\HomepageLead::STATUS_QUALIFIED] ?? 0, 'color' => 'success'], ['label' => __('Closed'), 'value' => $counts[\App\Models\HomepageLead::STATUS_CLOSED] ?? 0, 'color' => 'muted'], ]; @endphp @foreach($tiles as $t)

{{ $t['label'] }}

{{ number_format((int) $t['value']) }}

@endforeach
{{-- Filters + search --}}
@if($search !== '' || $status !== '') {{ __('Reset') }} @endif
{{ __('Export CSV') }}
{{-- Leads table --}}
@if($leads->isEmpty())

{{ __('No leads yet') }}

{{ __('Visitors who chat with the AI agent on your homepage will appear here. Make sure the Agent Homepage theme is active under Frontend Settings.') }}

{{ __('Open Frontend Settings') }} →
@else
@foreach($leads as $lead) @php $statusColors = [ 'new' => 'bg-info/10 text-info', 'contacted' => 'bg-warning/10 text-warning', 'qualified' => 'bg-success/10 text-success', 'closed' => 'bg-surface-2 text-muted', 'spam' => 'bg-danger/10 text-danger', ]; $statusClass = $statusColors[$lead->status] ?? 'bg-surface-2 text-muted'; @endphp @endforeach
{{ __('Visitor') }} {{ __('Use case') }} {{ __('First message') }} {{ __('Msgs') }} {{ __('Status') }} {{ __('When') }} {{ __('Action') }}
{{ $lead->display_name }}

{{ $lead->email ?: '—' }} @if($lead->company) · {{ $lead->company }} @endif

{{ $lead->use_case ? ucfirst($lead->use_case) : '—' }}

{{ \Illuminate\Support\Str::limit($lead->first_message ?: '—', 90) }}

{{ $lead->message_count }} {{ $lead->status }} {{ $lead->created_at?->diffForHumans() }} {{ __('Open') }} →
{{ $leads->links() }}
@endif