@php $depth = (int) ($level ?? 0); $hasChildren = !empty($item['children']); $hasRoute = isset($item['route']); $hasUrl = !empty($item['url']); $hasLink = $hasRoute || $hasUrl; $link = $hasRoute ? route($item['route']) : ($item['url'] ?? '#'); $levelClasses = [ 0 => 'rounded-2xl border border-slate-200 bg-white', 1 => 'rounded-xl border border-slate-200 bg-slate-50', 2 => 'rounded-xl border border-slate-100 bg-white', ]; $containerClass = $levelClasses[$depth] ?? 'rounded-xl border border-slate-100 bg-white'; @endphp @if ($hasChildren)

{{ $item['title'] }}

@if (!empty($item['description']))

{{ $item['description'] }}

@endif
@foreach ($item['children'] as $child) @include('mobile::livewire.mobile.partials.service-tree-item', ['item' => $child, 'level' => $depth + 1]) @endforeach
@else @if ($hasLink)

{{ $item['title'] }}

@if (!empty($item['description']))

{{ $item['description'] }}

@endif
@else

{{ $item['title'] }}

@if (!empty($item['description']))

{{ $item['description'] }}

@endif
@endif @endif