<div>
    @component('common.breadcrumb', ['addBtn' => false, 'permission_create' => null, 'breadcrumb_show' => $breadcrumb_show])
        @slot('breadcrumb_title')
            <h3>{{ $componentName }} | {{ $pageTitle }}</h3>
        @endslot
        <li class="breadcrumb-item">Empresa</li>
        <li class="breadcrumb-item active">Hojas de Vida</li>
    @endcomponent
    @include('common.searchbox')
    <div class="container-fluid">
        <div class="row layout-top-spacing">
            <div class="col-sm-12">
                <div class="card">
                    <div class="table-responsive">
                        <table class="table">
                        @if ($data->count())
                            <thead class="bg-primary">
                                <tr>
                                    <th scope="col">DOCUMENTO </th>
                                    <th scope="col">NOMBRE @include('common.orderby', ['column' => 'first_name'])</th>
                                    <th scope="col">TELÉFONO</th>
                                    <th scope="col">EMPRESA</th>
                                    <th scope="col">IMAGEN</th>
                                    <th scope="col" class="text-center">HOJA DE VIDA</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach($data as $user)
                                <tr class="middle">
                                    <td>{{ $user->document }}</td>
                                    <td>{{ $user->first_name }} {{$user->last_name}}</td>
                                    <td>{{ $user->phone }}</td>
                                    <td>{{ $user->company_name }}</td>

                                    <td class="text-center">
                                        <img src="{{ asset('storage/users/' .$user->imagen) }}" alt="imagen"  class="rounded img-h-50">
                                    </td>
                                    <td class="text-center">
                                        @can('CvEmployee_update')
                                        <a href="{{ route('hoja-de-vida.edit', $user) }}"
                                            class="btn btn-outline-primary" title="Editar">
                                            <i class="far fa-edit"></i>
                                        </a>
                                        @endcan
                                        @can('CvEmployee_pdf')
                                        <a href="{{ url('/hoja-de-vida/pdf/' . $user->id) }}" target="_blank"
                                            class="btn btn-outline-primary " title="Imprimir">
                                            <i class="far fa-file-pdf"></i>
                                        </a>
                                        @endcan
                                    </td>
                                </tr>
                                @endforeach
                            </tbody>
                        @else
                            <tr>
                                <td colspan="8" class="text-center alert alert-danger"><strong>No se encuentran registos </strong></td>
                            </tr>
                        @endif
                        </table>
                        {{ $data->links() }}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

