@php $totals = ['like_count'=>0,'retweet_count'=>0,'reply_count'=>0,'quote_count'=>0,'impression_count'=>0]; foreach ($metrics as $m) { foreach ($totals as $k=>$v) { $totals[$k] += (int)($m[$k] ?? 0); } } $labels = ['impression_count'=>__('Impressions'),'like_count'=>__('Likes'),'retweet_count'=>__('Reposts'),'reply_count'=>__('Replies'),'quote_count'=>__('Quotes')]; @endphp
{{ __('X / Insights') }}

{{ __('Post') }} {{ __('insights') }}.

{{ __('Engagement on your published tweets. These are metered X API reads, cached for 15 minutes.') }}

{{-- Totals --}}
@foreach ($labels as $k => $lbl)
{{ $lbl }}
{{ number_format($totals[$k]) }}
@endforeach
{{-- Per-post --}}
@forelse ($posts as $p) @php $m = $metrics[$p->provider_tweet_id] ?? []; @endphp @empty @endforelse
{{ __('Tweet') }} {{ __('Impr.') }} {{ __('Likes') }} {{ __('Reposts') }} {{ __('Replies') }} {{ __('Quotes') }}
{{ $p->text ?: '('.$p->media_type.')' }}
{{ $p->account?->label() }} ยท {{ $p->published_at?->format('M j, H:i') }}
{{ number_format((int)($m['impression_count'] ?? 0)) }} {{ number_format((int)($m['like_count'] ?? 0)) }} {{ number_format((int)($m['retweet_count'] ?? 0)) }} {{ number_format((int)($m['reply_count'] ?? 0)) }} {{ number_format((int)($m['quote_count'] ?? 0)) }}
{{ __('No published tweets yet.') }}