@php
    $isFile = isset($item['id']);
@endphp

<li class="{{ $isFile ? 'file' : 'folder' }} tree">
    @if($isFile)
        <a href="#" class="text-bold" wire:click="$emit('openModalFormPatchFile', '{{ $item['id'] }}' , '{{ $patchId??'' }}')"><i aria-hidden="true" class='fa fa-file text-base mr-2'></i>{{ $name }}</a>
    @else
        <span>{{ $name }}</span> 
        <ul class='pl-4 mt-1'>
            @foreach($item as $childName => $childItem)
                @include('livewire.pages.patch.tree-item', ['name' => $childName, 'item' => $childItem])
            @endforeach
        </ul>
    @endif
</li>
