@php /** @var \Illuminate\Support\Collection $broadcasts */ /** @var \Illuminate\Support\Collection $channels */ /** @var array $stats */ $statusPill = fn ($s) => match ($s) { 'sending' => ['bg-accent-amber/15 text-[#7B5A14]', __('Sending')], 'done' => ['bg-wa-mint text-wa-deep', __('Done')], 'failed' => ['bg-accent-coral/10 text-accent-coral', __('Failed')], default => ['bg-paper-100 text-ink-600', __('Draft')], }; @endphp
{{ __('Viber') }} · {{ __('Broadcasts') }}

{{ __('Viber') }} {{ __('broadcasts') }}

{{ __('Message subscribed users in batches of up to 300. Only users who have opened a chat with your account can be reached.') }}

{{ __('Channels') }} @unless ($channels->isEmpty()) {{ __('New broadcast') }} @endunless
@if (session('success'))
{{ session('success') }}
@endif @if (session('error') || $errors->any())
{{ session('error') ?: $errors->first() }}
@endif @if ($channels->isEmpty())
V

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

{{ __('Connect a channel') }}
@else
@foreach ([[__('Sent'), $stats['sent']], [__('Audience'), $stats['audience']], [__('Failed'), $stats['failed']], [__('Sending'), $stats['sending']]] as [$lbl, $val])
{{ $lbl }}
{{ number_format($val) }}
@endforeach
@forelse ($broadcasts as $b) @php [$cls, $lbl] = $statusPill($b->status); @endphp @empty @endforelse
{{ __('Broadcast') }} {{ __('Recipients') }} {{ __('Progress') }} {{ __('Status') }} {{ __('Actions') }}
{{ $b->name }}
{{ $b->created_at?->format('d M Y · H:i') }}
{{ number_format($b->total) }}
{{ $b->sent }} {{ __('sent') }} · {{ $b->failed }} {{ __('failed') }}
{{ $lbl }}
@if (in_array($b->status, ['draft', 'sending'], true))
@csrf
@elseif ($b->failed > 0)
@csrf
@endif
@csrf @method('DELETE')
{{ __('No broadcasts yet.') }} {{ __('Create your first one') }}.
@endif