@extends('layouts.app') @section('title', $campaign->name) @section('content') @php $counts = collect([ 'pending' => $campaign->recipients->where('status', 'pending')->count(), 'sent' => $campaign->recipients->where('status', 'sent')->count(), 'failed' => $campaign->recipients->where('status', 'failed')->count(), 'bounced' => $campaign->recipients->where('status', 'bounced')->count(), ]); $total = $counts->sum(); $delivered = $counts['sent'] + $counts['failed'] + $counts['bounced']; $progress = $total > 0 ? round(($delivered / $total) * 100, 1) : 0; $statusClass = match ($campaign->status) { 'running' => 'warn', 'completed' => 'ok', 'paused' => 'badge', default => 'muted', }; $statusLabel = match ($campaign->status) { 'running' => '● Running', 'completed' => 'Completed', 'paused' => 'Paused', default => 'Draft', }; @endphp @if ($campaign->status === 'running') @endif