{{-- Breadcrumb --}} @if (session()->has('alert')) @endif {{-- Lead Header Info --}}
{{ $lead->contact_name ?: __('Unknown Name') }}
{{ $lead->contact_number }} @if($lead->source_keyword)  ·  {{ $lead->source_keyword }} @endif @if($lead->form)  ·  {{ $lead->form->name }} @endif
{{-- Lead Answers Summary --}} @if($lead->answers->count())
@foreach($lead->answers->take(3) as $answer) {{ $answer->label }}: {{ Str::limit($answer->answer, 30) }} @endforeach @if($lead->answers->count() > 3) +{{ $lead->answers->count() - 3 }} {{ __('more') }} @endif
@endif
{{ \Plugins\LeadFollower\Models\LeadFollowup::allStatuses()[$currentStatus] ?? ucfirst($currentStatus) }} {{ $totalFollowups }} {{ __('followups') }}
{{-- Status Progress Bar --}} @php $progressStatuses = ['new', 'contacted', 'interested', 'negotiating', 'converted']; $isFinal = in_array($currentStatus, ['converted', 'lost', 'junk']); $currentIndex = array_search($currentStatus, $progressStatuses); @endphp
@foreach($progressStatuses as $i => $step) @php $isDone = $currentIndex !== false && $i < $currentIndex; $isActive = $currentStatus === $step; $cls = $isActive ? 'active' : ($isDone ? 'done' : ''); if ($currentStatus === 'converted' && $step === 'converted') $cls = 'converted-done'; @endphp
@if($isDone || $isActive) ✓ @endif {{ \Plugins\LeadFollower\Models\LeadFollowup::allStatuses()[$step] ?? ucfirst($step) }}
@endforeach @if($currentStatus === 'lost')
✗ {{ __('Lost') }}
@endif
{{-- Timeline (left) --}}
{{ __('Followup Timeline') }}
{{ $totalFollowups }} {{ __('total') }}
@if($followups->isEmpty())
{{ __('No followups yet. Add the first one →') }}
@else
@foreach($followups as $fu) @php $typeColor = \Plugins\LeadFollower\Models\LeadFollowup::typeColor($fu->followup_type); $typeIcon = \Plugins\LeadFollower\Models\LeadFollowup::typeIcon($fu->followup_type); $statusBadge = \Plugins\LeadFollower\Models\LeadFollowup::statusBadgeClass($fu->lead_status); @endphp
{{ \Plugins\LeadFollower\Models\LeadFollowup::allTypes()[$fu->followup_type] ?? $fu->followup_type }} {{ \Plugins\LeadFollower\Models\LeadFollowup::allStatuses()[$fu->lead_status] ?? ucfirst($fu->lead_status) }} @if($fu->wa_sent) {{ __('WA Sent') }} @endif
{{ $fu->created_at->diffForHumans() }}
{{-- Message --}}

{{ $fu->message }}

{{-- WA Message if sent --}} @if($fu->wa_message)
{{ __('WhatsApp Message Sent') }} {{ $fu->wa_message }}
@endif {{-- Next Reminder --}} @if($fu->next_followup_at) @php $isOverdue = $fu->next_followup_at < now() && !$fu->reminder_sent; $isToday = $fu->next_followup_at->isToday(); @endphp
{{ __('Next followup:') }} {{ $fu->next_followup_at->format('d M Y, h:i A') }} @if($isOverdue) — {{ __('Overdue!') }} @elseif($isToday) — {{ __('Today') }} @endif
@endif
@endforeach
@endif
{{-- Sidebar: Add Followup Form --}}
{{-- Add Followup Card --}}
{{ __('Add New Followup') }}
@csrf {{-- Followup Type --}}
@foreach(\Plugins\LeadFollower\Models\LeadFollowup::allTypes() as $typeKey => $typeLabel) @php $color = \Plugins\LeadFollower\Models\LeadFollowup::typeColor($typeKey); @endphp
@endforeach
{{-- Message / Note --}}
{{-- Current Status --}}
{{ __('Update the current stage of this lead') }}
{{-- WhatsApp Message (shown when type=whatsapp) --}}
@if($devices->isEmpty())
{{ __('No connected device. Connect a device to send WhatsApp.') }}
@else @endif {{ __('This will be sent via WhatsApp to: ') }}{{ $lead->contact_number }}
{{-- Next Followup Reminder --}}
{{-- Followup Date/Time --}}
{{-- WA Reminder Box --}}
{{ __('Auto WhatsApp Reminder') }}
{{-- Recipient Number --}}
{{ __('Leave blank to skip WA reminder.') }}
{{-- Reminder Device --}} @if(!$devices->isEmpty())
@endif {{-- Time Before --}}
{{-- Custom Reminder Message --}}
{{ __('Placeholders:') }} @foreach(['{name}','{number}','{status}','{followup_time}','{form}','{note}'] as $ph) {{ $ph }} @endforeach
{{ __('WA reminder will auto-send before the followup time.') }}
{{-- Quick WhatsApp Send --}}
{{ __('Quick WhatsApp') }}
@if($devices->isEmpty())
{{ __('No connected device available.') }}
@else @endif
{{-- Lead full answers accordion --}} @if($lead->answers->count())
{{ __('Lead Answers') }}
@foreach($lead->answers as $answer)
{{ $answer->label }}
{{ $answer->answer ?: '—' }}
@endforeach
@endif
{{-- Delete Confirmation Modal --}}