@props([ 'postSummary', 'usdToTndRate' => 4, 'modern' => false, ]) @php $rows = $postSummary['rows'] ?? []; $totals = $postSummary['totals'] ?? ['spend' => 0, 'conversions' => 0, 'interactions' => 0]; $maxSpend = max(collect($rows)->pluck('spend')->all() ?: [1]); if ($maxSpend <= 0) { $maxSpend = 1; } @endphp @if ($modern) @forelse ($rows as $index => $row) @php $barWidth = max(6, (int) round(((float) $row['spend'] / $maxSpend) * 100)); $rowBg = $index % 2 === 0 ? '#ffffff' : '#f8fafc'; @endphp @empty @endforelse @if ($rows !== []) @endif
Publication Spend Couverture Interactions
{{ $row['post_name'] }}
   
{{ number_format($row['spend'], 2, ',', ' ') }} $
{{ number_format($row['spend'] * $usdToTndRate, 2, ',', ' ') }} TND
@if ($row['conversions'] > 0)
{{ number_format($row['conversions'], 0, ',', ' ') }}
@else
@endif
@if ($row['interactions'] > 0)
{{ number_format($row['interactions'], 0, ',', ' ') }}
@else
@endif
Aucune publication avec metriques pour cette selection.
Total
{{ number_format($totals['spend'], 2, ',', ' ') }} $
{{ number_format($totals['spend'] * $usdToTndRate, 2, ',', ' ') }} TND
{{ number_format($totals['conversions'], 0, ',', ' ') }} {{ number_format($totals['interactions'], 0, ',', ' ') }}
@else @forelse ($rows as $row) @empty @endforelse @if ($rows !== []) @endif
Publication Spend Couverture Interactions
{{ $row['post_name'] }} {{ number_format($row['spend'], 2, ',', ' ') }} $
{{ number_format($row['spend'] * $usdToTndRate, 2, ',', ' ') }} TND
{{ $row['conversions'] > 0 ? number_format($row['conversions'], 0, ',', ' ') : '—' }} {{ $row['interactions'] > 0 ? number_format($row['interactions'], 0, ',', ' ') : '—' }}
Aucune publication avec metriques pour cette selection.
Total {{ number_format($totals['spend'], 2, ',', ' ') }} $
{{ number_format($totals['spend'] * $usdToTndRate, 2, ',', ' ') }} TND
{{ number_format($totals['conversions'], 0, ',', ' ') }} {{ number_format($totals['interactions'], 0, ',', ' ') }}
@endif