{{-- Fila de un misil dentro del panel del Closer. Variables esperadas: $m — MissileDraft con outreach_attempts_count + latestAttempt cargados $mode — 'ready' (launched, con demo) | 'pending' (sin provisionar todavía) --}} @php [$tempKey, $tempEmoji, $tempLabel, $tempClass] = $m->lead_temp; $hasOutreach = $m->outreach_attempts_count > 0; $lastAttempt = $m->latestAttempt ?? null; $nextFollowup = $lastAttempt?->next_followup_at; $domain = $m->launchedProject?->domain ?: ($m->subdomain ? $m->subdomain . '.bewpro.com' : null); // Badge "proyecto activo" si el TP ya está live $tpAlive = $m->launchedProject && in_array($m->launchedProject->pipeline_status, ['active','on_development'], true); $tpDead = $m->launchedProject && !$tpAlive; // WhatsApp link con mensaje pre-escrito $whatsappLink = null; $whatsappPhoneClean = null; if (!empty($m->prospect_phone)) { $phone = preg_replace('/[^0-9]/', '', (string) $m->prospect_phone); if (strlen($phone) >= 8) { $whatsappPhoneClean = $phone; $closer = auth()->user(); $closerNm = trim(($closer?->first_name ?? '') . ' ' . ($closer?->last_name ?? '')) ?: 'el equipo de BewPro'; $leadNm = $m->prospect_name ?: $m->project_name ?: 'Hola'; $demoUrl = $domain ? "https://{$domain}" : null; $msg = "Hola {$leadNm}, te habla {$closerNm} de BewPro 👋\n\n"; if ($mode === 'ready' && $demoUrl) { $msg .= "Te preparé una propuesta digital pensada para vos. Echale un vistazo:\n👉 {$demoUrl}\n\n"; $msg .= "¿Tenés 5 minutos esta semana para charlarlo?"; } else { $msg .= "Estoy preparando una propuesta digital pensada para vos. ¿Cuándo podemos charlar 5 minutos?"; } $whatsappLink = "https://wa.me/{$phone}?text=" . rawurlencode($msg); } } @endphp
{{-- Emoji avatar --}}
{{ $tempEmoji }}
{{-- Datos del misil --}}
{{ $m->project_name ?: $m->prospect_name ?: 'Sin nombre' }} @if($mode === 'ready') {{ $tempEmoji }} {{ $tempLabel }} @if(!$hasOutreach) sin contactar @endif @if($tpAlive) Proyecto activo #{{ $m->launchedProject->id }} @endif @if($tpDead) {{ $m->launchedProject->pipeline_status }} @endif @else {{ ucfirst($m->status) }} @endif
@if($m->prospect_email) {{ $m->prospect_email }} @endif @if($m->prospect_name && $m->prospect_name !== $m->project_name) {{ $m->prospect_name }} @endif @if($mode === 'ready' && $domain) {{ $domain }} @elseif($mode === 'pending' && $m->subdomain) {{ $m->subdomain }}.bewpro.com (sin provisionar) @endif @if($mode === 'ready' && $lastAttempt) Último contacto: {{ $lastAttempt->attempted_at?->diffForHumans() }} @endif @if($mode === 'ready' && $nextFollowup) Follow-up: {{ $nextFollowup->format('d/m H:i') }} @if($nextFollowup->isPast())(vencido)@endif @endif
{{-- Acciones (varían por modo) --}}
@if($mode === 'ready') @if($domain) @endif @if($whatsappLink) @endif @if($m->prospect_email) @endif {{-- Dropdown quick-state estilo Tokko --}} @else {{-- Mode = pending: CTA para solicitar lanzamiento (pre-fill datos) --}} Solicitar lanzamiento @endif