
<table class="table">

    <thead>
    <tr>
        @if($user->disabledColumn('name','employees'))
            <th class="column_name">
                <div class="header-content" >
                    <label class="form-check-label" for='selectall'>{{ __('employees.name') }}</label>
                </div>
            </th>
        @endif
        @if($user->disabledColumn('email','employees'))
            <th  class="column_email">
                <div class="header-content" >
                    <span>{{ __('employees.email') }}</span>
                </div>
            </th>
        @endif
        @if($user->disabledColumn('phone','employees'))
            <th class="column_phone">
                <div class="header-content" >
                    <span>{{ __('employees.phone') }}</span>
                </div>
            </th>
        @endif
        @if($user->disabledColumn('role','employees'))
            <th class="column_role">
                <div class="header-content" >
                    <span>{{ __('users.role') }}</span>
                </div>
            </th>
        @endif
        @if($user->disabledColumn('sector_id','employees'))
            <th  class="column_sector_id">
                <div class="header-content" >
                    <span>{{ __('employees.sector_id') }}</span>

                </div>
            </th>
        @endif
        @if($user->disabledColumn('created_at','employees'))
            <th colspan="2" class="column_created_at">
                <div class="header-content" >
                    <span>{{ __('dashboard.created_at') }}</span>
                </div>
            </th>
        @endif
    </tr>
    </thead>
    <tbody>
    @foreach($employees as $row)
        <tr>
            @if($user->disabledColumn('name','employees'))
                <td class="column_name"> <div class="text"> {{$row->name}} </div> </td>
            @endif
            @if($user->disabledColumn('email','employees'))
                <td class="column_email"> <div class="text"> {{$row->email}} </div> </td>
            @endif
            @if($user->disabledColumn('phone','employees'))
                <td class="column_phone"> <a href="tel:{{$row->phone}}" class="text"> {{$row->phone}} </a> </td>
            @endif
            @if($user->disabledColumn('role','employees'))
                <td class="column_role"> <div class="text"> {{__('users.roles.'.$row->role)}} </td>
            @endif
            @if($user->disabledColumn('sector_id','employees'))
                <td class="column_sector_id"> <div class="text sector_txt" style="white-space: normal; ">
                        @foreach($row->sectors as $keySector=>$sector)
                            {{ $sector->sector->currentDescription->title }}
                            @if (count($row->sectors) != $keySector + 1)
                                ,
                    @endif
                    @endforeach
                </td>
            @endif
            @if($user->disabledColumn('name','employees'))
                <td colspan="2" class="column_created_at"> <div class="text"> {{ \Carbon\Carbon::parse($row->created_at)->format('Y/m/d') }} </td>
            @endif
        </tr>
    @endforeach

    </tbody>
</table>
