@extends('layouts.app') @section('title', 'Lead β€” ' . ($lead->consumer_name ?? 'Unknown')) @section('topbar-actions') ← Back to Leads @endsection @section('content')
{{-- Lead Details --}}
Lead Details
@if($lead->isCall() && $lead->call_recording_url) πŸŽ™ Recording @endif
@php $rows = [ 'Type' => match($lead->lead_type) { 'PHONE_CALL' => 'πŸ“ž Phone Call', 'MESSAGE' => 'πŸ’¬ Message', 'BOOKING' => 'πŸ“… Booking', default => $lead->lead_type, }, 'Status' => $lead->lead_status, 'Consumer' => $lead->consumer_name ?? 'β€”', 'Phone' => $lead->consumer_phone_number ?? 'β€”', 'Business' => $lead->business_name ?? 'β€”', 'Location' => $lead->geo_location ?? 'β€”', 'Locale' => $lead->locale ?? 'β€”', 'Created' => $lead->lead_created_at?->format('M j, Y g:i A') ?? 'β€”', ]; if ($lead->isCall()) { $rows['Call Duration'] = $lead->formatted_duration; } if ($lead->charge_amount) { $rows['Charge'] = $lead->currency_code . ' ' . number_format($lead->charge_amount, 2); } @endphp @foreach($rows as $label => $value) @endforeach
{{ $label }} {{ $value }}
@if($lead->message_text)
Message

{{ $lead->message_text }}

@endif @if($lead->note)
Note

{{ $lead->note }}

@endif {{-- Update Status Form --}}
Update Status
@csrf @method('PATCH')
{{-- Conversations --}}
Conversations ({{ $lead->conversations->count() }})
@forelse($lead->conversations->sortBy('event_at') as $conv)
@if($conv->type === 'PHONE_CALLING') πŸ“ž @elseif($conv->type === 'MESSAGE') πŸ’¬ @else πŸ“§ @endif {{ $conv->participant_type ?? 'Unknown' }}
{{ $conv->event_at?->format('M j, Y g:i A') ?? 'β€”' }}
@if($conv->message_text)

{{ $conv->message_text }}

@elseif($conv->call_duration_seconds)

⏱ {{ gmdate('i:s', $conv->call_duration_seconds) }} call

@if($conv->call_recording_url) πŸŽ™ Listen @endif @else

No content

@endif
@empty

No conversations recorded for this lead.

@endforelse
@endsection