<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 charge in charges %}
       
        <tr>
            <!-- PROPRIETE -->
            <td>
                {% if charge.properties %}
                    {{ charge.properties.name }}
                {% else %}
                    <span class="badge badge-danger">Aucun appartement</span>
                {% endif %}
            </td>
            
            <td>
               {{ charge.type }}
            </td>
            <td>
               {{ charge.dateIntervention|date('d/m/Y') }}
            </td>
            <td>
                {{ charge.montant }} FCFA
            </td>
            <td>
                {{ charge.description   }}
            </td>

            <td>
                <div class="custom-control custom-switch {% if charge.active %}custom-control-success{% else %}custom-control-danger{% endif %}">
                    <input type="checkbox" data-id="{{ charge.id }}" class="custom-control-input js-status-input" id="status-{{ charge.id }}" {% if charge.active %}checked{% endif %}>
                    <label class="custom-control-label position-static p-0" for="status-{{ charge.id }}"></label>
                </div>
            
            <td>{{ charge.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(charge, path('admin.charges.edit', {'id': charge.id}), 'Modifier') }}
                            {{ delete_form(charge, path('admin.charges.delete', {'id': charge.id}), 'Etes vous sûr de vouloir supprimer cette charge?', 'Supprimer la charge') }}
                        </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>