@php $hasChildren = $agent->downlines_count > 0; $statusClass = $agent->status === 'active' ? 'bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400' : 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400'; $programColors = [ 'legacy' => 'bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200', 'progressive' => 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200', 'performance' => 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200', ]; $programType = $agent->commissionProgram?->type ?? 'none'; $programClass = $programColors[$programType] ?? 'bg-gray-100 text-gray-800'; @endphp
{{-- Expand/Collapse Button --}} @if($hasChildren) @else
@endif {{-- Avatar --}}
{{ strtoupper(substr($agent->name, 0, 2)) }}
{{-- Info --}}
{{ $agent->name }} {{ ucfirst($agent->status) }} @if($programType !== 'none') {{ ucfirst($programType) }} @endif
{{ $agent->coupon_code }} @if($hasChildren) {{ $agent->downlines_count }} downline(s) @endif
{{-- Actions --}}
{{-- Edit Upline Button --}} {{-- View as Agent --}}
@csrf
{{-- Edit Agent --}}
{{-- Children Container (loaded via AJAX) --}}