<table class="table table-striped table-sm text-center dinamicTable SeeIndexArea">
    <thead>
    <tr>
        <th scope="col">Nombre</th>
        <th scope="col">Estado</th>
        <th scope="col">Acciones</th>
    </tr>
    </thead>
    <tbody>
    @foreach($areas as $area)

        <tr>
            <td class="btnEvent" data-event="dblclick" data-route="SeeEdit_Area" data-field="nombre"
                data-reference="{{ $area->id_encrypt_area }}">{{ $area->nom_area }}</td>

            <td>
                @if(\Illuminate\Support\Facades\Auth::user()->super_admin_id == $area->super_admin_id)

                    @if($area->estado == 1)
                        <button class="btn btn-primary btn-sm btnEvent"
                                title="Inactivar el área clínica {{ $area->nom_area }}" data-route="ChangeStatus_Area"
                                data-tables_liged="Area" data-event="click"
                                data-reference="{{ $area->id_encrypt_area }}"
                                data-nom="{{ $area->nom_area }}" data-estado="inactivo">Activo
                        </button>
                    @else
                        <button class="btn btn-warning btn-sm btnEvent"
                                title="Activar el área clínica {{ $area->nom_area }}" data-route="ChangeStatus_Area"
                                data-tables_liged="Area" data-event="click"
                                data-reference="{{ $area->id_encrypt_area }}"
                                data-nom="{{ $area->nom_area }}" data-estado="activo">Inactivo
                        </button>
                    @endif
                @endif
            </td>
            <td>
                @if(\Illuminate\Support\Facades\Auth::user()->super_admin_id == $area->super_admin_id)
                    <button class="btn btn-danger btn-sm btnEvent"
                            title="Eliminar el área clínica {{ $area->nom_area }}"
                            data-route="Destroy_Area" data-event="click" data-reference="{{ $area->id_encrypt_area }}"
                            data-nom="{{ $area->nom_area }}" data-tables_liged="Area"><i class="far fa-trash-alt"></i>
                    </button>
                @endif

            </td>
        </tr>

    @endforeach
    </tbody>
</table>
