@extends('layouts.app') @section('content') @php $modeLabels = ['preview'=>'Agent Calls Customer','direct_agent'=>'Automatic Calls for Available Agents','send_to_team'=>'Send Answered Customers to Team']; $stateStyles = ['running'=>'bg-primary-subtle text-primary','paused'=>'bg-warning-subtle text-warning','completed'=>'bg-success-subtle text-success','stopped'=>'bg-secondary-subtle text-secondary','draft'=>'bg-secondary-subtle text-secondary','needs_attention'=>'bg-danger-subtle text-danger','scheduled'=>'bg-info-subtle text-info','archived'=>'bg-secondary-subtle text-secondary']; @endphp

{{ $campaign->name }}

{{ ucfirst(str_replace('_',' ',$campaign->state)) }} {{ $modeLabels[$campaign->calling_mode] ?? $campaign->calling_mode }} @if($campaign->team) · {{ $campaign->team->name }} @endif
@if(in_array('running', $allowedTransitions))
@csrf
@endif @if(in_array('paused', $allowedTransitions))
@csrf
@endif @if(in_array('stopped', $allowedTransitions))
@csrf
@endif
@csrf
← Campaigns
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Metric cards --}}
@php $cards = [ ['Attempted', $metrics->attempts ?? 0, 'phone-outgoing'], ['Customer Answered', $metrics->customer_answered ?? 0, 'phone-incoming'], ['Agent Connected', $metrics->agent_connected ?? 0, 'user-check'], ['Not Connected', $metrics->not_connected ?? 0, 'phone-off'], ['Callbacks', $metrics->callbacks ?? 0, 'phone-call'], ['DNC Requests', $metrics->dnc_requests ?? 0, 'shield-off'], ['Avg Wait (s)', $metrics->avg_wait ? round($metrics->avg_wait) : '—', 'clock'], ['Avg Talk (s)', $metrics->avg_talk ? round($metrics->avg_talk) : '—', 'message-circle'], ]; @endphp @foreach($cards as [$label, $value, $icon])
{{ is_numeric($value) ? number_format($value) : $value }}
{{ $label }}
@endforeach
{{-- Contact stats + import --}}
Contacts
Total imported{{ $contactStats->total ?? 0 }}
Dialable (ready){{ $contactStats->dialable ?? 0 }}
Completed{{ $contactStats->completed ?? 0 }}
Invalid{{ $contactStats->invalid ?? 0 }}
Duplicate{{ $contactStats->duplicate ?? 0 }}
Do Not Call{{ $contactStats->dnc_excluded ?? 0 }}
Import Contacts
@if(session('import_summary')) @php $s = session('import_summary'); @endphp
Import Summary: {{ $s['importable'] }} ready, {{ $s['invalid'] }} invalid, {{ $s['duplicate'] }} duplicate, {{ $s['dnc'] }} blocked.
@csrf
@csrf
@else
@csrf
Required columns: Name, Phone. Optional: Account Number, Email, Notes, etc.
@endif
{{-- Campaign configuration summary --}}
Configuration
Calling Method
{{ $modeLabels[$campaign->calling_mode] ?? $campaign->calling_mode }}
Team
{{ $campaign->team?->name ?? '—' }}
Caller ID / Trunk
{{ $campaign->caller_id ?: '—' }} / {{ $campaign->trunk ?: '—' }}
Max Attempts
{{ $campaign->max_attempts }}
Retry Interval
{{ $campaign->retry_minutes }} min
Calling Window
{{ substr($campaign->calling_window_start,0,5) }} – {{ substr($campaign->calling_window_end,0,5) }}
Created
{{ $campaign->created_at?->format('Y-m-d H:i') }}
@endsection