@foreach($records as $record)
    <tr>
        <td>{!! str_repeat("&nbsp;", $indentation * 5) !!} {{$record->name}}</td>
        <td>
            <button type="button" class="btn btn-outline-success btn-sm" wire:click="addLevel({{ $record->id }})">Aggiungi livello</button>
            <button type="button" class="btn" wire:click="edit({{ $record->id }})" data-bs-toggle="popover"  data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
            <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="delete({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
        </td>
    </tr>
    @if(count($record->childs))
        @include('livewire/course_child',['records' => $record->childs, 'indentation' => $indentation + 1])
    @endif
@endforeach
