39 lines
1.5 KiB
PHP
39 lines
1.5 KiB
PHP
@props(['node', 'level' => 1])
|
|
|
|
<li>
|
|
@php
|
|
$isPure = $node['is_pure'] ?? false;
|
|
$label = $node['atribut'] ?? $node['pemenang'] ?? ($node['root'] ?? 'NODE');
|
|
$branches = $node['branches'] ?? $node['subsets'] ?? [];
|
|
@endphp
|
|
|
|
@if($isPure || empty($branches))
|
|
<!-- LEAF NODE (HASIL REKOMENDASI JURUSAN) -->
|
|
<div class="leaf-box-result shadow-sm">
|
|
<i class="fas fa-graduation-cap mb-1 d-block fs-5"></i>
|
|
<strong>{{ $node['pemenang'] ?? $node['jurusan'] ?? $label }}</strong>
|
|
</div>
|
|
@else
|
|
<!-- NODE LINGKARAN KEPUTUSAN -->
|
|
<div class="{{ $level == 1 ? 'circle-node-root' : 'circle-node-child' }}">
|
|
<span class="badge {{ $level == 1 ? 'bg-primary' : 'bg-info' }} text-white mb-1" style="font-size: 8px;">
|
|
{{ $level == 1 ? '1. ROOT' : $level . '. NODE' }}
|
|
</span>
|
|
<span>{{ strtoupper(str_replace('_', ' ', $label)) }}</span>
|
|
</div>
|
|
|
|
<!-- CABANG ANAK (SUBSETS) -->
|
|
<ul>
|
|
@foreach($branches as $branchLabel => $childNode)
|
|
<li>
|
|
<div class="branch-label-wrapper">
|
|
<span class="branch-label-dosen">{{ $branchLabel }}</span>
|
|
</div>
|
|
|
|
<!-- REKURSI KE LEVEL BERIKUTNYA -->
|
|
<x-tree-node :node="$childNode" :level="$level + 1" />
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
@endif
|
|
</li> |