{{ __('Call logs') }} #{{ $log->id }}
{{ $log->direction }} · {{ optional($log->started_at)->format('M d, Y · H:i') }}

{{ $log->caller_phone }}

@if ($log->assistant) {{-- Link the assistant name straight into the wizard so an operator can iterate on persona / model / voice without hunting through /ai-assistants list. --}} {{ $log->assistant->name }} @else {{ __('Unassigned') }} @endif · {{ $log->duration_display }} · {{ $log->status }} @if (!empty($log->cost_minor)) · {{ number_format($log->cost_minor / 100, 2) }} {{ $log->currency_code ?: 'USD' }} @endif

@if (!empty($log->failure_reason)) {{-- Surface the failure reason inline on failed/no-answer rows so the operator doesn't have to dig into the database to find why a call dropped. --}}
{{ $log->failure_reason }}
@endif
@if ($log->conversation_id) Open in inbox @endif @if ($log->recording_url_mixed) Play recording @endif
{{ __('Tokens (AI)') }}
{{ number_format($log->ai_tokens_in + $log->ai_tokens_out) }}
{{ number_format($log->ai_tokens_in) }} in / {{ number_format($log->ai_tokens_out) }} {{ __('out') }}
{{ __('STT seconds') }}
{{ number_format($log->stt_seconds) }}
{{ __('TTS chars') }}
{{ number_format($log->tts_chars) }}

{{ __('Transcript') }}

{{ count($log->transcript_json ?? []) }} {{ __('turns') }}
@forelse (($log->transcript_json ?? []) as $turn) @php $isAgent = ($turn['role'] ?? '') === 'agent'; @endphp
{{ $isAgent ? 'AI agent' : 'Caller' }}{{ isset($turn['t']) ? ' · ' . gmdate('i:s', (int) ($turn['t'] / 1000)) : '' }}
{{ $turn['text'] ?? '' }}
@empty
{{ __('No transcript captured for this call.') }}
@endforelse