@extends('layouts.dental') @section('title', 'Lead — '.$lead->name) @section('content') @php $statusLabels = ['novo'=>'Novo','contatado'=>'Contatado','agendado'=>'Agendado','compareceu'=>'Compareceu','orcamento_enviado'=>'Orçamento Enviado','fechado'=>'Fechado','perdido'=>'Perdido']; $statusColors = ['novo'=>'#6366f1','contatado'=>'#f59e0b','agendado'=>'#3b82f6','compareceu'=>'#8b5cf6','orcamento_enviado'=>'#f97316','fechado'=>'#22c55e','perdido'=>'#ef4444']; $procedureLabels = ['implante'=>'Implante','clareamento'=>'Clareamento','ortodontia'=>'Ortodontia','protese'=>'Prótese','canal'=>'Canal','outro'=>'Outro']; $typeLabels = ['whatsapp'=>'WhatsApp','ligacao'=>'Ligação','email'=>'Email','presencial'=>'Presencial','sistema'=>'Sistema']; @endphp
← Voltar ao CRM {{-- Header --}}

{{ $lead->name }}

{{ $statusLabels[$lead->status] }} {{ $procedureLabels[$lead->procedure] ?? $lead->procedure }} {{ ucfirst($lead->origin) }}
@if($lead->patient_id) 👤 Ver Paciente @else
@csrf
@endif 💬 WhatsApp
TELEFONE
{{ $lead->phone }}
@if($lead->email)
EMAIL
{{ $lead->email }}
@endif @if($lead->campaign)
CAMPANHA
{{ $lead->campaign->name }}
@endif
ENTRADA
{{ $lead->created_at->format('d/m/Y H:i') }}
@if($lead->next_contact_at)
PRÓX. CONTATO
{{ $lead->next_contact_at->format('d/m/Y H:i') }}
@endif
@if($lead->notes)
{{ $lead->notes }}
@endif
{{-- Mover de status --}}
Mover para
@foreach($statusLabels as $s => $l) @if($s !== $lead->status)
@csrf @method('PATCH')
@endif @endforeach
{{-- Histórico de interações --}}
Histórico de Contatos
@forelse($lead->interactions->sortByDesc('created_at') as $i)
{{ ['whatsapp'=>'💬','ligacao'=>'📞','email'=>'📧','presencial'=>'🤝','sistema'=>'⚙️'][$i->type] ?? '📌' }}
{{ $typeLabels[$i->type] }} — {{ $i->result }} {{ $i->created_at->format('d/m H:i') }}
@if($i->notes)
{{ $i->notes }}
@endif @if($i->next_contact_at)
📅 Próx: {{ $i->next_contact_at->format('d/m/Y H:i') }}
@endif
por {{ $i->user->name }}
@empty
Nenhum contato registrado ainda
@endforelse
{{-- Conversa BIA --}} @if($conversations->count() > 0)
🤖 Conversa com a BIA
@foreach($conversations as $msg) @if($msg->role === 'user')
{{ $msg->message }}
{{ $msg->created_at->format('d/m H:i') }}
@else
B
{{ $msg->message }}
{{ $msg->created_at->format('d/m H:i') }}
@endif @endforeach
@endif
{{-- Modal Interação --}} @endsection