<div>
    <h3>{{ $componentName }} </h3>

    <div class="container-fluid">
        <div class="row layout-top-spacing">
            <div class="col-sm-12">
                @if ($this->activeButtonSaveUpdate)
                    <a href="javascript:void(0)" wire:click.prevent="openAddTR()"
                        class="btn btn-square btn-primary txt-white mb-4 mt-4">
                        Agregar <i class="fa fa-plus"></i>
                    </a>
                @endif
                <ul class="list-group list-group-flush">
                    @foreach ($trainings as $training)
                        <li class="list-group-item">
                            <div class="row">
                                <div class="col-sm-12 col-md-5">
                                    <h5>{{ $training->name }}</h5>
                                    <p>{{ $training->company }}</p>
                                </div>
                                <div class="col-sm-12 col-md-2 d-flex align-items-end justify-content-start">
                                    @if ($training->year != null)
                                        <p>{{ $training->year }}</p>
                                    @endif
                                </div>
                                <div class="col-sm-12 col-md-3 d-flex align-items-end justify-content-start">
                                    @if ($training->time != null)
                                        <p>{{ $training->time }}</p>
                                    @endif
                                </div>
                                <div class="col-sm-12 col-md-2 d-flex align-items-center justify-content-end">
                                    @if ($this->activeButtonSaveUpdate)
                                        <span wire:click="EditTR({{ $training->id }})"
                                            class="c-pointer action-box large complete-btn f-right" title="Editar">
                                            <i class="fas fa-edit f-20 text-primary"></i>
                                        </span>
                                        <span onclick="ConfirmCV('{{ $training->id }}','TR')"
                                            class="c-pointer action-box large complete-btn f-right" title="Eliminar">
                                            <i class="fas fa-trash f-20 text-danger"></i>
                                        </span>
                                    @endif
                                </div>
                            </div>
                        </li>
                    @endforeach
                </ul>
            </div>
        </div>
    </div>
    @include('livewire.cv-employee.detail.partials.trainings.form')
    @include('common.scriptsCompCV', ['ComponentId' => 'TR'])
</div>
