File: D:/HostingSpaces/SBogers10/shop.komma.nl/resources/views/components/accordionList.blade.php
@php /** @var \Komma\KMS\Core\Tree\NestedSets\Nodes\TreeModelInterface $root **/ @endphp
<ul class="{{ !isset($isSubItem) ? 'c-accordion-list' : '' }}">
@foreach($root->getChildren() as $child)
@php /** @var \Komma\KMS\Core\Tree\NestedSets\Nodes\TreeModelInterface $child **/ @endphp
<li class="{{ !isset($isSubItem) ? 'c-accordion-list__item' : '' }}">
<a class="{{ !isset($isSubItem) ? 'c-accordion-list__link ' : '' }}{{ $child->is_current ? 'is-current': ''}}"
href="{{ $child->link }}"
@if($child->is_current)
data-test="current-assortment-menu-item" @else
data-test="assortment-menu-item"
@endif
>
{{ $child->translation ? $child->translation->name : '-' }}
</a>
@if(count($child->getChildren()) > 0)
@include('components.accordionList', [
'root' => $child,
'isSubItem' => true,
])
@endif
</li>
@endforeach
</ul>