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