@php /** @var \Illuminate\Support\Collection $broadcasts */ /** @var \Illuminate\Support\Collection $bots */ /** @var array $stats */ $tgGlyph = ''; $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
{{ __('Telegram') }} · {{ __('Broadcasts') }}

{{ __('Telegram') }} {{ __('broadcasts') }}

{{ __('Message everyone who has chatted with your bot, then track sent, failed and blocked per broadcast.') }}

{{ __('Bots') }} @unless ($bots->isEmpty()) {{ __('New broadcast') }} @endunless
@if (session('status') || session('success'))
{{ session('status') ?: session('success') }}
@endif @if (session('error') || $errors->any())
{{ session('error') ?: $errors->first() }}
@endif @if ($bots->isEmpty())
{!! $tgGlyph !!}

{{ __('Connect a Telegram bot first.') }}

{{ __('Connect a bot') }}
@else {{-- KPI cards --}}
{{ __('Sent') }}
{{ number_format($stats['sent']) }}
{{ number_format($stats['total']) }} {{ __('broadcasts') }}
{{ __('Audience') }}
{{ number_format($stats['audience']) }}
{{ __('total recipients') }}
{{ __('Failed') }}
{{ number_format($stats['failed']) }}
{{ __('delivery errors') }}
{{ __('Blocked') }}
{{ number_format($stats['blocked']) }}
{{ __('bot blocked by user') }}
{{ __('Sending') }}
{{ number_format($stats['sending']) }}
{{ __('in flight') }}
{{-- Broadcast table --}}
{{ __('Broadcast list') }}

{{ __('Recent broadcasts') }}

@forelse ($broadcasts as $b) @php [$cls, $lbl] = $statusPill($b->status); @endphp @empty @endforelse
{{ __('Broadcast') }} {{ __('Bot') }} {{ __('Recipients') }} {{ __('Progress') }} {{ __('Status') }} {{ __('Actions') }}
{{ $b->name }}
{{ $b->created_at?->format('d M Y · H:i') }}
@if($b->bot)@{{ ltrim((string) $b->bot->bot_username, '@') }}@else—@endif {{ number_format($b->total) }}
{{ $b->sent }} {{ __('sent') }} · {{ $b->failed }} {{ __('failed') }} · {{ $b->blocked }} {{ __('blocked') }}
{{ $lbl }}
@if (in_array($b->status, ['draft', 'sending'], true))
@csrf
@elseif ($b->status === 'failed' || ($b->failed + $b->blocked) > 0)
@csrf
@endif
@csrf @method('DELETE')
{{ __('No broadcasts yet.') }} {{ __('Create your first one') }}.
@endif