@extends('layouts.app') @section('content')

Automatic Calling — My Calling Screen

Manage your availability, device, and campaign calls.
@if(session('success'))
{{ session('success') }}
@endif @if(isset($error))
{{ $error }}
@endif @if(!$agent)
You are not assigned as a Call Centre agent. Contact your administrator.
@else
{{-- Left: Device + Status --}}
{{-- Device selection --}}
My Calling Device
@if(empty($devices))

No calling devices found for your extension.

@else
@csrf @foreach($devices as $d)
selected_device_ref === $d['ref'])>
@endforeach
@endif
{{-- Status --}}
Status
@php $statusLabels = ['offline'=>'Offline','available'=>'Available','paused'=>'Paused','reserved'=>'Reserved','calling'=>'Calling','on_call'=>'On Call','wrap_up'=>'Completing Notes']; $statusStyles = ['available'=>'text-success','on_call'=>'text-primary','paused'=>'text-warning','offline'=>'text-secondary']; @endphp
{{ $statusLabels[$session->status] ?? ucfirst($session->status) }}
@if($session->status !== 'available')
@csrf
@endif @if($session->status === 'available')
@csrf
@endif @if($session->status !== 'offline')
@csrf
@endif
{{-- Right: Contact + Actions --}}
@if($pendingOutcome) {{-- Outcome required before continuing --}}
Outcome Required

Please record the outcome of your last call before continuing.

Call Attempt #{{ $pendingOutcome->id }}

{{-- Outcome form would go here in the full implementation --}}
@elseif($nextContact) {{-- Contact to call --}}
Next Contact {{ $campaigns->first()?->name }}
Customer Name
{{ $nextContact->name }}
Telephone Number
{{ $nextContact->phone_e164 ?? $nextContact->phone_raw }}
@if($nextContact->extra) @foreach($nextContact->extra as $key => $val) @if($val)
{{ ucfirst(str_replace('_',' ',$key)) }}
{{ $val }}
@endif @endforeach @endif
@csrf
@elseif($session->status === 'available')
You are available for campaign calls.
The next contact will appear here when ready.
@else
Go available to start receiving campaign contacts.
@endif
@endif @endsection