<table class="datatable-show-all table">
    <thead class="{{ class }}">
    <tr>
       
        <th>Nom & prénoms</th>
        <th>Email</th>
        <th>Téléphone</th>
        <th>Status</th>
        <th style="width: 200px!important;">Date de création</th>
        <th style="width: 100px!important;">Actions</th>
    </tr>
    </thead>
    <tbody>
    {% for bien in biens %}
       
        <tr>
             <td>

                {% if bien.locations %}
                        <span class="badge badge-danger"> {{ bien.locations.name }}</span>
                    {% else %}
                        <span class="badge badge-danger">Aucune zone</span>
                    {% endif %}


             </td>
            
            <td>
               {{ bien.adresse }}
            </td>
            <td>
               {{ bien.commission }}
            </td>

            <td>
                <div class="custom-control custom-switch {% if bien.active %}custom-control-success{% else %}custom-control-danger{% endif %}">
                    <input type="checkbox" data-id="{{ bien.id }}" class="custom-control-input js-status-input" id="status-{{ bien.id }}" {% if bien.active %}checked{% endif %}>
                    <label class="custom-control-label position-static p-0" for="status-{{ bien.id }}"></label>
                </div>
            
            <td>{{ bien.createdAt|date('d/m/Y à H:i:s') }}</td>
            <td style="text-align: center!important;display: flex; flex-direction: row; justify-content: center; align-items: center;">
                <div class="list-icons">
                    <div class="dropdown">
                        <a href="javascript:" class="list-icons-item" data-toggle="dropdown">
                            <i class="icon-menu9"></i>
                        </a>
                        <div class="dropdown-menu dropdown-menu-right">
                           
                            {{ action_form(bien, path('admin.biens.edit', {'id': bien.id}), 'Modifier') }}
                            {{ delete_form(bien, path('admin.biens.delete', {'id': bien.id}), 'Êtes-vous sûr de vouloir supprimer ce bien?', 'Supprimer le bien') }}
                        </div>
                    </div>
                </div>
            </td>
        </tr>
    {% else %}
        <tr>
            <td colspan="8">{{ data_none }}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>
<script type="module">
    import Save from "{{ asset('js/modules/module.js') }}";
    Save('/admin/api/locataires/check-status')
</script>