@foreach($units as $key=> $row)
    <tr>
        <th scope="row">
            <div class="custom-control custom-checkbox">
                <input type="checkbox" class="custom-control-input selectOne deleteCheck" id="customCheck{{$row->code}}" value="{{$row->code}}" name="id[]">
                <label class="custom-control-label" for="customCheck{{$row->code}}">{{-- $row->code --}}</label>
            </div>
        </th>
        <td>{{ $row->user->name ?? '' }}</td>
        <td>{{ $row->area->city->currentDescription->title ?? '' }}</td>
        <td>{{ $row->area->currentDescription->title ?? '' }}</td>
        <td>{{ $row->price }}</td>
        <td>{{ $row->type->currentDescription->title ?? '' }}</td>
        <td>{{ $row->baths }}</td>
        <td>{{ $row->title }}</td>
        <td>{{ $row->status_text }}</td>
        <td>{{ $row->sold_status_text }}</td>
        <td>{{ dateFormat($row->created_at, 'Y/m/d') }}</td>
        <td>
            <div class="dropdown">
                <button class="icon_dots dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-expanded="false">
                    <i class="bi bi-three-dots-vertical"></i>
                </button>
                <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                    @if($row->deleted_at ?? null)
                        <a href="{{ route ('units.restore', $row->code) }}" data-method="put" class="dropdown-item rowAction" title="{{ __('dashboard.restore') }}"> <i class="bi bi-pen ml-1"></i> {{ __('dashboard.restore') }} </a>

                        {{-- <a href="{{ route ('units.destroy', $row->code) }}" data-method="delete" class="dropdown-item rowAction" title="{{ __('dashboard.delete') }}"> <i class="bi bi-trash ml-1"></i> {{ __('dashboard.delete') }} </a> --}}
                    @else
                        <a href="{{ route ('units.edit', $row->code) }}" class="dropdown-item" title="{{ __('dashboard.edit') }}"> <i class="bi bi-pen ml-1"></i> {{ __('dashboard.edit') }} </a>

                        <a href="{{ route ('units.destroy', $row->code) }}" data-method="delete" class="dropdown-item rowAction" title="{{ __('dashboard.trash') }}"> <i class="bi bi-slash-circle ml-1"></i> {{ __('dashboard.trash') }} </a>

                    @endif
                </div>
            </div>
        </td>
    </tr>
@endforeach

@if( count( $units ) && $units->hasPages() )
    <tr> <td colspan="11"> {{ $units->links() }} </td> </tr>
@endif
