@php $state = $getState(); $state = is_array($state) ? $state : []; $connectionState = is_string($state['state'] ?? null) ? (string) $state['state'] : 'missing'; $ctaUrl = is_string($state['cta_url'] ?? null) ? (string) $state['cta_url'] : '#'; $needsDefaultConnection = (bool) ($state['needs_default_connection'] ?? false); $displayName = is_string($state['display_name'] ?? null) ? (string) $state['display_name'] : null; $provider = is_string($state['provider'] ?? null) ? (string) $state['provider'] : null; $consentStatus = is_string($state['consent_status'] ?? null) ? (string) $state['consent_status'] : null; $verificationStatus = is_string($state['verification_status'] ?? null) ? (string) $state['verification_status'] : null; $status = is_string($state['status'] ?? null) ? (string) $state['status'] : null; $healthStatus = is_string($state['health_status'] ?? null) ? (string) $state['health_status'] : null; $lastCheck = is_string($state['last_health_check_at'] ?? null) ? (string) $state['last_health_check_at'] : null; $lastErrorReason = is_string($state['last_error_reason_code'] ?? null) ? (string) $state['last_error_reason_code'] : null; $isMissing = $connectionState === 'missing'; $consentSpec = \App\Support\Badges\BadgeRenderer::spec(\App\Support\Badges\BadgeDomain::ProviderConsentStatus, $consentStatus); $verificationSpec = \App\Support\Badges\BadgeRenderer::spec(\App\Support\Badges\BadgeDomain::ProviderVerificationStatus, $verificationStatus); $legacyStatusSpec = \App\Support\Badges\BadgeRenderer::spec(\App\Support\Badges\BadgeDomain::ProviderConnectionStatus, $status); $legacyHealthSpec = \App\Support\Badges\BadgeRenderer::spec(\App\Support\Badges\BadgeDomain::ProviderConnectionHealth, $healthStatus); @endphp
Provider connection
@if ($isMissing)
Needs action: no Microsoft provider connection is configured.
@elseif ($needsDefaultConnection)
Needs action: set a default Microsoft provider connection.
@else
{{ $displayName ?? 'Unnamed connection' }}
@endif
Open Provider Connections
@unless ($isMissing) @if ($needsDefaultConnection && $displayName)
Current connection: {{ $displayName }}
@endif
Provider
{{ $provider ?? 'n/a' }}
Consent
{{ $consentSpec->label }}
Verification
{{ $verificationSpec->label }}
Last check
{{ $lastCheck ?? 'n/a' }}
Diagnostics
Legacy status
{{ $legacyStatusSpec->label }}
Legacy health
{{ $legacyHealthSpec->label }}
@if ($lastErrorReason)
Last error reason: {{ $lastErrorReason }}
@endif
@endunless