<div class="row">
    {{-- @if($is_edit)
    <div class="col-md-12 mb-4"></div>

    <div class="col-auto mb-4">
        <div class="form-group">
            <button class="btn btn-outline-primary text-uppercase btn-medium" type="button" wire:click="cancel()">Annulla</button>
        </div>
    </div>
    <div class="col-auto mb-4">
        <div class="form-group">
            <button class="btn btn-primary text-uppercase btn-medium" type="button" wire:click="save()">Salva</button>
        </div>
    </div>

    @else --}}

    <div class="col-md-12 col-xs-12">
        <div class="form-group text-end">
            <button class="btn btn-primary text-uppercase btn-medium" type="button" wire:click="add()">Aggiungi</button>
        </div>
    </div>
    <div class="col-md-12 col-xs-12">
        <table class="dataTable display" id="company-services">
            <thead>
                <tr>
                    <th>Servizio</th>
                    <th>Descrizione</th>
                    <th>Referente</th>
                    <th class="no-sort text-center dt-actions-th">Azioni</th>
                </tr>
            </thead>
            <tbody>
                {{-- @foreach($company_services as $c)
                <tr>
                    <td>{{$c->name}}</td>
                    <td>{{$c->description}}</td>
                    <td class="text-center dt-actions">
                        <a class="dt-action" wire:click="edit({{$c->id}})"><i class="icli iconly-Edit-Square"></i></a>
                        <a class="dt-action" {{--wire:click="delete({{$c->id}})" --/}}><i class="icli iconly-Delete"></i></a>
                    </td>
                </tr>
                @endforeach --}}
            </tbody>
        </table>
    </div>

    {{-- @endif --}}
</div>

@push('scripts')
<script>
    document.addEventListener("DOMContentLoaded", () => {
        let table_id = "#company-services";
        let options = {
                paging: true,
                ordering: true,
                columnDefs: [
                    {
                        targets: 'no-sort',
                        orderable: false,
                    }
                ],
                language: {
                    url: DT_languageIT,
                },
            };
        Livewire.on('update', () => {
            setTimeout(() => {
                loadDatatables("#company-services", options);
            }, 10);
        });
        loadDatatables("#company-services", options);
    });
</script>
@endpush