@extends('layouts.app') @section('title', 'Transcript Detail') @section('page-title', 'Transcript Detail') @section('topbar-actions') Back @endsection @section('content') @php $analysis = $conversation['analysis'] ?? []; $sentiment = $analysis['user_sentiment'] ?? null; $summary = $analysis['transcript_summary'] ?? null; $duration = $conversation['metadata']['call_duration_secs'] ?? $conversation['call_duration_secs'] ?? 0; $mins = intdiv($duration, 60); $secs = $duration % 60; $startTime = $conversation['start_time_unix_secs'] ?? null; @endphp
{{-- Conversation Info --}}
Conversation Info
Conversation ID {{ $conversationId }}
Status @php $status = $conversation['status'] ?? 'unknown'; @endphp @if($status === 'done' || $status === 'completed') Completed @elseif($status === 'failed') Failed @else {{ ucfirst($status) }} @endif
Duration {{ $duration > 0 ? $mins.'m '.$secs.'s' : '—' }}
Date {{ $startTime ? \Carbon\Carbon::createFromTimestamp($startTime)->format('d M Y, h:i A') : '—' }}
Sentiment @if($sentiment === 'positive') Positive @elseif($sentiment === 'negative') Negative @elseif($sentiment === 'neutral') Neutral @else @endif
{{-- Customer Info --}}
Customer
@if($call && $call->customer)
{{ strtoupper(substr($call->customer->customer_name, 0, 1)) }}
{{ $call->customer->customer_name }}
{{ $call->customer->phone_number }}
Product {{ $call->customer->product_name }}
Language {{ $call->customer->language ?? 'English' }}
@else
Customer info not available
@endif
{{-- Summary --}} @if($summary)
AI Summary

{{ $summary }}

@endif {{-- Transcript --}}
Full Transcript {{ count($transcript) }} messages
@if(count($transcript) > 0) @foreach($transcript as $msg) @php $role = $msg['role'] ?? 'unknown'; $message = $msg['message'] ?? $msg['content'] ?? ''; $time = $msg['time_in_call_secs'] ?? null; $isAgent = in_array(strtolower($role), ['agent', 'assistant', 'ai']); @endphp
@if($isAgent) AI Agent @else Customer @endif @if($time !== null) {{ intdiv($time, 60) }}:{{ str_pad($time % 60, 2, '0', STR_PAD_LEFT) }} @endif
{{ $message }}
@endforeach @else
No transcript available for this conversation.
@endif
@endsection