{{-- Recursive node for the boxes organogram. Managers/homes = box cards, workers = small circles. --}} @php $depth = $depth ?? 0; $type = $node['type']; $hasChildren = ! empty($node['children']); @endphp @if($type === 'worker') @php $pct = $node['compliance']; $none = $node['total'] == 0; $accent = $none ? '#8A9199' : ($node['overdue'] > 0 ? '#C1473A' : ($pct >= 100 ? '#0E7C7B' : '#B08D57')); $initials = strtoupper(\Illuminate\Support\Str::of($node['name'])->explode(' ')->filter()->map(fn ($p) => mb_substr($p, 0, 1))->take(2)->implode('')); @endphp
  • {{ $initials }}

    {{ \Illuminate\Support\Str::of($node['name'])->explode(' ')->first() }}

    {{ $none ? '—' : $node['compliance'] . '%' }}

  • @else
  • $type === 'home' && $hasChildren])> @include('management._org-box-card', ['node' => $node, 'showToggle' => true]) @if($hasChildren) @endif
  • @endif