@extends('layouts.admin') @section('title', 'User — ' . ($user->name ?? 'Details')) @push('styles') @endpush @section('content')
{{-- Left: Profile Card --}}
@if($user->avatar) @else {{ strtoupper(substr($user->name, 0, 1)) }} @endif
{{ $user->name }}
{{ $user->email }}
Phone {{ $user->phone ?? 'N/A' }}
Role {{ ucfirst(str_replace('_', ' ', $user->role)) }}
Status {{ $user->is_active ? 'Active' : 'Inactive' }}
Member Since {{ $user->created_at->format('M d, Y') }}
Tenseal ID {{ $user->tenseal_id ?? $user->id }}
Edit Role @if($user->inventoryTenants && $user->inventoryTenants->count() === 1) Open Tenant @elseif($user->inventoryTenants && $user->inventoryTenants->count() > 1) {{ $user->inventoryTenants->count() }} Tenants @endif
@csrf @method('PATCH')
@csrf
{{-- Impersonate (super-admin only, not on other admins) --}} @if(auth()->user()->role === 'super_admin' && $user->id !== auth()->id() && ! in_array($user->role ?? '', ['admin', 'super_admin', 'support_admin', 'data_admin'], true))
@csrf
@endif @if($user->id !== auth()->id() && auth()->user()->role === 'super_admin')
@csrf @method('DELETE')
@endif
{{-- Right: Activity Summary --}}

Activity Summary

₦{{ number_format($walletBalance ?? 0, 2) }}
Wallet Balance
{{ number_format($totalTransactions ?? 0) }}
Total Transactions
{{ number_format($totalListings ?? 0) }}
Total Listings
@if($user->is_verified ?? false) @else @endif
KYC Verification
{{-- Recent Transactions --}}

Recent Transactions

@forelse(($recentTransactions ?? []) as $tx) @empty @endforelse
Title Type Amount Status Date
{{ $tx->title ?? 'N/A' }} {{ ucfirst($tx->type ?? 'escrow') }} ₦{{ number_format($tx->amount ?? 0, 2) }} {{ ucfirst($tx->status ?? 'pending') }} {{ $tx->created_at ? $tx->created_at->format('M d, Y') : '' }}
No transactions found.
{{-- Wallet Transactions --}}

Wallet Transactions

@forelse(($walletTransactions ?? []) as $wtx) @empty @endforelse
Type Amount Balance After Description Date
{{ ucfirst($wtx->type ?? '') }} ₦{{ number_format($wtx->amount ?? 0, 2) }} ₦{{ number_format($wtx->balance_after ?? 0, 2) }} {{ Str::limit($wtx->description ?? '', 40) }} {{ $wtx->created_at ? $wtx->created_at->format('M d, Y') : '' }}
No wallet transactions.
@endsection