{{ t('waba') }} @php $wpSettings = tenant_settings_by_group('whatsapp'); $healthStatus = json_decode($wpSettings['wm_health_data']); $defaultPhoneNumberData = collect($phone_numbers)->firstWhere('id', $wpSettings['wm_default_phone_number_id']); @endphp

{{ t('whatsapp_business_account') }}

@if (checkPermission('tenant.connect_account.disconnect')) @endif

{{ t('access_token_info') }}

{{ t('access_token') }}

@if (checkPermission('tenant.connect_account.connect'))
@else
{{ t('not_allowed_to_view') }}
@endif

{{ t('permission_scopes') }}

@if (!empty($token_info['scopes']))
@foreach ($token_info['scopes'] as $scope) {{ $scope }} @endforeach
@endif

{{ t('issued') }}

{{ $token_info['issued_at'] ?? 'N/A' }}

{{ t('expiry') }}

{{ empty($token_info['expires_at']) ? 'N/A' : $token_info['expires_at'] ?? 'N/A' }}

{{ t('webhook_url') }}

@if (checkPermission('tenant.connect_account.connect'))
@else
{{ t('not_allowed_to_view') }}
@endif
@if (Auth::user()->is_admin)

{{ t('test_message') }}

{{ t('send_message') }}

{{ t('verify_webhook') }}

{{ t('verify_webhook') }}
@endif
@foreach ($phone_numbers as $phone) @php $isDefault = $phone['id'] == $wpSettings['wm_default_phone_number_id']; $qualityColor = match ($phone['quality_rating']) { 'GREEN' => 'text-success-500', 'YELLOW' => 'text-warning-500', 'RED' => 'text-danger-500', default => 'text-gray-500', }; $statusColor = match ($phone['code_verification_status']) { 'VERIFIED' => 'bg-success-50 text-success-700 ring-success-600/20 dark:bg-success-500/10 dark:text-success-400 dark:ring-success-500/20', 'EXPIRED' => 'bg-danger-50 text-danger-700 ring-danger-600/20 dark:bg-danger-500/10 dark:text-danger-400 dark:ring-danger-500/20', 'PENDING' => 'bg-warning-50 text-warning-700 ring-warning-600/20 dark:bg-warning-500/10 dark:text-warning-400 dark:ring-warning-500/20', default => 'bg-gray-50 text-gray-700 ring-gray-600/20 dark:bg-gray-500/10 dark:text-gray-400 dark:ring-gray-500/20', }; @endphp

{{ t('phone') }}

{{ $isDefault ? t('default_phone_number') : t('additional_phone_number') }}

{{ $phone['code_verification_status'] ?? '' }}

{{ t('display_phone_number') }}

{{ $phone['display_phone_number'] ?? '' }}

{{ t('verified_name') }}

{{ $phone['verified_name'] ?? '' }}

{{ t('number_id') }}

@if (checkPermission('tenant.connect_account.connect'))

{{ $phone['id'] ?? '' }}

@else
{{ t('not_allowed_to_view') }}
@endif

{{ t('quality') }}

{{ $phone['quality_rating'] ?? '' }}

{{ t('messaging_limit') }}

@php $phoneNumber = preg_replace('/\D/', '', $phone['display_phone_number']); $analytics = $message_details['analytics'] ?? []; $phoneNumbers = $analytics['phone_numbers'] ?? []; $dataPoints = $analytics['data_points'] ?? []; $index = array_search($phoneNumber, $phoneNumbers, true); $sentCount = $index !== false && isset($dataPoints[$index]['sent']) ? $dataPoints[$index]['sent'] : 0; $limit = !empty($message_details['limit_value'] ?? 1000) ? $message_details['limit_value'] : 1000; $percentage = ($sentCount / ($limit ?? 1000)) * 100; @endphp
{{ $percentage }}%

{{ $sentCount . '/' . $message_details['limit_value'] }} {{ t('messages_sent_today') }}

@if ($isDefault) {{ t('manage_phone_numbers') }} @else @endif @if ($phone['quality_rating'] == 'UNKNOWN' && Auth::user()->is_admin) @endif
@endforeach

{{ t('overall_health') }}

{{ t('last_checked') }} {{ $wpSettings['wm_health_check_time'] }}

{{ t('whatsapp_business_id') }}

@if (checkPermission('tenant.connect_account.connect'))

{{ $healthStatus->id }}

@else
{{ t('not_allowed_to_view') }}
@endif
{{ $healthStatus->health_status->can_send_message }}
@foreach ($healthStatus->health_status->entities as $entity)

{{ $entity->entity_type }}

@if (checkPermission('tenant.connect_account.connect'))

ID: {{ $entity->id }}

@else
{{ t('not_allowed_to_view') }}
@endif

{{ t('can_send_message') }}

{{ $entity->can_send_message ?? '' }}
@endforeach
{{ t('cancel') }} {{ t('disconnect') }}