@props(['data']) @php $hasAlerts = ($data['count'] ?? 0) > 0; $showMoreCount = ($data['total_unpaid'] ?? 0) - ($data['count'] ?? 0); // Calculate insights $orders = $data['orders'] ?? []; $highPriority = array_filter($orders, fn($o) => (float) $o['total'] > 500); $largestOrder = max(array_map(fn($o) => (float) $o['total'], $orders ?: [0])); $totalOwing = $data['total_owing'] ?? 0; @endphp @if($hasAlerts)
Unpaid Phone Orders
Action required • showing {{ $data['count'] ?? 0 }} of {{ $data['total_unpaid'] ?? 0 }}
${{ number_format($totalOwing, 0) }} due @if(count($highPriority) > 0) {{ count($highPriority) }} over $500 @endif View all →
@foreach($orders as $o) @php $amount = floatval($o['total']); if ($amount > 500) { $badge = 'badge-critical'; $label = 'High Value'; } elseif ($amount > 250) { $badge = 'badge-high'; $label = 'Medium'; } else { $badge = 'badge-medium'; $label = 'Pending'; } @endphp
{{ $o['customer_name'] }}
{{ $o['created_at'] }}
${{ number_format($o['total'], 2) }}
@endforeach
@if($showMoreCount > 0)
+{{ $showMoreCount }} more • View all
@endif
@endif