@if (session('user-error'))
{{ session('user-error') }}
@endif @if (session('user-status') === 'updated')
User updated.
@endif @if (session('user-status') === 'approved')
Registration approved. The user can sign in.
@endif @if (session('user-status') === 'deleted')
User account removed.
@endif @if ($this->pendingRegistrations->isNotEmpty())

Awaiting email confirmation ({{ $this->pendingRegistrations->count() }})

These users have not activated their account from the email link yet. Approve activates them manually; Reject blocks the account before they can sign in.

@endif @if ($this->viewedUser)

User details

Review details before approving or rejecting.

@if ($this->viewedUser->profile_photo_path)

Profile photo

Uploaded by the {{ $this->viewedUser->role === \App\Enums\UserRole::Agent ? 'agent' : 'customer' }}

@else @php($pillBg = $this->viewedUser->role === \App\Enums\UserRole::Agent ? 'bg-amber-200 text-amber-900' : 'bg-gray-200 text-gray-500')
{{ strtoupper(substr($this->viewedUser->name, 0, 1)) }}

No profile photo uploaded yet.

@endif

Name

{{ $this->viewedUser->name }}

Email

{{ $this->viewedUser->email }}

Role

{{ $this->viewedUser->role->label() }}

Approval status

{{ $this->viewedUser->approval_status->label() }}

@if ($this->viewedUser->role === \App\Enums\UserRole::Agent)

Agency name

{{ $this->viewedUser->agency_name ?? '—' }}

License number

{{ $this->viewedUser->license_number ?? '—' }}

Mobile number

{{ $this->viewedUser->whatsapp ?? '—' }}

Business certificate

@php($certUrl = $this->certificateUrlFor($this->viewedUser)) @if ($certUrl) View / download certificate (opens new tab) @else

@endif
@else

WhatsApp

{{ $this->viewedUser->whatsapp ?? '—' }}

@endif
@if ($this->viewedUser->isPendingApproval())
@endif
@endif @if ($this->isAgentView()) {{-- Agent summary cards --}}
@foreach ($this->agentCards as $card) @php($c = $this->agentPalette[$card['color']])

{{ $card['label'] }}

{{ number_format($card['value']) }}

{{ $card['sub'] }}

@endforeach
{{-- All agents table --}}

All Agents

@forelse ($this->users as $u) @empty @endforelse
Agent Agency Total Apps Approved Rejected Pending Status Actions
@if ($u->profile_photo_path) @else {{ strtoupper(substr($u->name, 0, 1)) }} @endif {{ $u->name }} {{ $u->email }} {{ $u->agency_name ?: '—' }} @if ($u->license_number) Lic. {{ $u->license_number }} @endif {{ number_format($u->applications_total) }} {{ number_format($u->applications_approved) }} {{ number_format($u->applications_rejected) }} {{ number_format($u->applications_pending) }} @if ($u->isPendingApproval()) Pending @elseif ($u->isApproved()) Approved @else Rejected @endif @if ($u->id === auth()->id()) @elseif ($u->isPendingApproval())
@elseif ($u->isApproved()) @else
@endif
No agents found.

@if ($this->users->total()) Showing {{ $this->users->firstItem() }} to {{ $this->users->lastItem() }} of {{ $this->users->total() }} agents @else Showing 0 agents @endif

{{ $this->users->onEachSide(1)->links() }}
@else
@if ($role !== 'agent') @endif @foreach ($this->users as $u) @if ($role !== 'agent') @endif @endforeach
NameEmailRole Details Status Actions
@if ($u->profile_photo_path) @else @php($initialBg = $u->role === \App\Enums\UserRole::Agent ? 'bg-amber-100 text-amber-800 ring-amber-200' : 'bg-indigo-100 text-indigo-800 ring-indigo-200') {{ strtoupper(substr($u->name, 0, 1)) }} @endif {{ $u->name }}
{{ $u->email }}{{ $u->role->label() }} @if ($u->role === \App\Enums\UserRole::Customer) WhatsApp: {{ $u->whatsapp ?? '—' }} @else {{ $u->agency_name ?? '—' }} · {{ $u->license_number ?? '—' }} Mobile: {{ $u->whatsapp ?? '—' }} @endif $u->isPendingApproval(), 'bg-green-100 text-green-800' => $u->isApproved(), 'bg-red-100 text-red-800' => $u->approval_status === \App\Enums\UserApprovalStatus::Rejected, ])> {{ $u->approval_status->label() }} @if ($u->id === auth()->id()) @elseif ($u->isPendingApproval())
@elseif ($u->isApproved())
@if ($u->role === \App\Enums\UserRole::Agent) @elseif ($u->role === \App\Enums\UserRole::Customer) View @endif
@else
Rejected
@endif
{{ $this->users->links() }}
@endif