{{-- Recursive folder tree component --}} @php $isReadOnly = $isReadOnly ?? false; @endphp @foreach($folders as $folder) @php $folderId = (string) $folder['id']; @endphp
{{-- Chevron toggle --}} @if(count($folder['children']) > 0) @else @endif {{-- Folder icon and name (clickable to navigate) --}} {{-- Right side container for badge/actions (fixed width to prevent layout shift) --}}
{{-- File count badge (shown when not hovered or always in read-only mode) --}} @if($folder['file_count'] > 0) {{ $folder['file_count'] }} @endif @if(!$isReadOnly) {{-- Hover actions (shown when hovered) --}}
{{-- Add subfolder --}} {{-- Rename --}} {{-- Move --}}
@endif
{{-- Children folders --}} @if(count($folder['children']) > 0 && $this->isFolderExpanded($folderId)) @include('filemanager::filament.pages.partials.folder-tree', ['folders' => $folder['children'], 'level' => $level + 1, 'isReadOnly' => $isReadOnly]) @endif
@endforeach