{{-- CallInstitute — "Call Institute" channel card (embedded inside ContactHub). Dials a DSAR institution contact while the Client stays the communicable, so the call lands in the client's activity feed and ties to their claim. Device state is synced on mount from the global Twilio bootstrap (mirrors CallManager); the in-call UI is handled by the global CallOverlay. --}}
{{-- ── Header: icon + label + device badge ──────────────────────── --}}
Call Institute
@if($deviceRegistering) Connecting @elseif($deviceReady) Ready @else Offline @endif
{{-- ── Sub-label ──────────────────────────────────────────────────── --}}
{{ $this->isLocked() ? ($this->institutions->first()?->display_name ?? 'DSAR Institution') : 'DSAR Institution' }}
{{-- ── Selector: (institution →) contact / number ─────────────────── --}} @if($this->institutions->isEmpty())
{{ $this->isLocked() ? 'No institution is linked to this DSAR.' : 'No DSAR institutions linked to this client.' }}
@else {{-- In DSAR mode the institution is fixed, so only the number is chosen. --}} @unless($this->isLocked())
@endunless {{-- Always rendered (disabled until an institution is chosen) so the wire:model binding initialises on first render rather than after a morph; keyed by institution to force a clean re-init when the contact options change. --}}
@endif {{-- ── Error ──────────────────────────────────────────────────────── --}} @if($errorMessage)
{{ $errorMessage }}
@endif {{-- ── Call button (pushed to bottom of card) ─────────────────────── --}}
@can('communications.call.institution') @else @endcan