@php $agent = $node['agent']; $children = $node['children']; $hasChildren = count($children) > 0; @endphp
{{ strtoupper(substr($agent->name, 0, 2)) }}
{{ $agent->name }} {{ ucfirst($agent->status) }}
{{ $agent->coupon_code }} {{ $agent->performanceTier->name ?? 'Basic' }} @if($hasChildren) {{ count($children) }} downline(s) @endif
@csrf
@if($hasChildren)
@foreach($children as $child) @include('agents.partials.genealogy-node', ['node' => $child, 'depth' => $depth + 1]) @endforeach
@endif