@php /** @var \Illuminate\Support\Collection $channels */ $ch = $channel ?? null; $maxV = collect($rows)->map(fn ($r) => $r['in'] + $r['out'])->max() ?: 1; $pct = fn ($n, $d) => $d > 0 ? round($n / $d * 100) : 0; @endphp
{{ __('Viber') }} · {{ __('Insights') }}

{{ __('Engagement') }} {{ __('insights') }}

{{ __('Message volume, active users and delivery/seen rates over the last 7 days.') }}

@if ($channels->count() > 1)
@endif
@if ($channels->isEmpty())
V

{{ __('Connect a Viber channel first.') }}

{{ __('Connect a channel') }}
@else
{{ __('Active users (7d)') }}
{{ number_format($totals['users']) }}
{{ __('Received (7d)') }}
{{ number_format($totals['in']) }}
{{ __('Sent (7d)') }}
{{ number_format($totals['out']) }}
{{ $pct($totals['seen'], $totals['out']) }}% {{ __('seen') }} · {{ $pct($totals['delivered'], $totals['out']) }}% {{ __('delivered') }}
{{ __('Failed (7d)') }}
{{ number_format($totals['failed']) }}
@if (! empty($rows))
{{ __('Daily volume') }}
@foreach ($rows as $r)
{{ $r['date'] }} ↓{{ $r['in'] }} · ↑{{ $r['out'] }}
@endforeach
@endif @endif