{{-- Activity Feed — Timeline-style activity log. Auto-refreshes every 60s. Layout breaks the page into three cards: stats row, filter bar, timeline — instead of dumping everything into one giant panel. --}}
{{-- Stats row — only on the dedicated /activity page, not embedded versions (e.g. dashboard widgets). --}} @if(request()->routeIs('activity'))
@php $s = $this->stats; @endphp
{{ __('Total events') }}
{{ number_format($s['total']) }}
{{ __('Today') }}
{{ number_format($s['today']) }}
{{ __('Last 7 days') }}
{{ number_format($s['week']) }}
{{ __('Active people') }}
{{ number_format($s['actors']) }}
@endif {{-- Filter card — only on the dedicated /activity page. --}} @if(request()->routeIs('activity'))
@if($search || $typeFilter) @endif
@endif {{-- Timeline card --}}
@if(count($this->groupedActivities) > 0)
@foreach($this->groupedActivities as $dateLabel => $activities)
{{-- Date group header --}}
{{ $dateLabel }} · {{ count($activities) }} {{ __('events') }}
{{-- Timeline items --}}
@foreach($activities as $activity) @php $meta = \App\Livewire\ActivityFeed::getMeta($activity); $iconSvg = \App\Livewire\ActivityFeed::getIconSvg($meta['icon']); $description = \App\Livewire\ActivityFeed::humanDescription($activity); $url = \App\Livewire\ActivityFeed::resourceUrl($activity); $colorMap = [ 'brand' => 'bg-brand/10 text-brand', 'success' => 'bg-success/10 text-success', 'danger' => 'bg-danger/10 text-danger', 'info' => 'bg-info/10 text-info', 'warning' => 'bg-warning/10 text-warning', 'accent' => 'bg-accent/15 text-accent', 'muted' => 'bg-surface text-muted', ]; $dotColor = [ 'brand' => 'bg-brand', 'success' => 'bg-success', 'danger' => 'bg-danger', 'info' => 'bg-info', 'warning' => 'bg-warning', 'accent' => 'bg-accent', 'muted' => 'bg-muted/60', ]; $iconClasses = $colorMap[$meta['color']] ?? $colorMap['muted']; $dotClass = $dotColor[$meta['color']] ?? $dotColor['muted']; @endphp @endforeach
@endforeach
{{-- Load more --}}
@else {{-- Empty state --}}

{{ __('No activity yet') }}

@if($search || $typeFilter) {{ __('No activities match your current filters. Try adjusting your search or filter.') }} @else {{ __('Connect an email account or send your first campaign — events will start streaming in here.') }} @endif

@if($search || $typeFilter) @else {{ __('Connect Email') }} @endif
@endif