@switch($cell)
    @case('id')
        <span class="token_id_of_table">{{ $r->id }}</span>
        @break
    @case('token_info')
        <span class="badge badge-success"> T.ID : </span> {{ $r->token }} <br>
        <span class="badge badge-info"> C.T : </span> {{ date('d-M-Y g:i: a ', strtotime($r->created_at)) }} <br>
        @if ($r->assign_time)
            <span class="badge badge-warning"> A.T : </span> {{ date('d-M-Y g:i: a ', strtotime($r->assign_time)) }} <br>
            @if ($r->close_time)
                <span class="badge badge-danger"> C.T : </span> {{ date('d-M-Y g:i: a ', strtotime($r->close_time)) }} <br>
            @else
                {{ 'Token Assigned ' . dateTimeDifferent(now(), $r->assign_time) . ' ago Not Closed' }}<br>
            @endif
        @else
            {{ 'Token Created ' . dateTimeDifferent(now(), $r->created_at) . ' ago Not assigned' }}<br>
        @endif
        @break
    @case('category_code')
        {{ $r->category->tokenCategory ?? '' }} ({{ $r->Code->tokenCode ?? '' }})
        @break
    @case('description')
        {{ $r->description }}
        @break
    @case('source')
        @if ($r->token_source == 'CRM')
            <span class="btn btn-info btn-xs">{{ $r->token_source }}</span>
        @else
            {{ $r->token_source }}
        @endif
        @break
    @case('creator')
        {{ $r->creator->name ?? '' }}
        @if ($r->createByClient)
            <span class="badge badge-danger">{{ $r->createByClient ?? '' }}</span>
        @endif
        @break
    @case('reseller')
        {{ $r->clients->pops->reseller->name ?? '' }}
        @break
    @case('pop')
        {{ $r->clients->pops->popname ?? '' }}
        @break
    @case('customer_id_username')
        {{ $r->clientId }} <br> {{ $r->clients->userid ?? '' }}
        @break
    @case('customer_info')
        <p style="font-size:14px;">
            @if (function_exists('checkAPI') && checkAPI())
                @if (isset($mikrotik_online_users['onlineUsers']) && array_key_exists($r->clients->userid ?? '', $mikrotik_online_users['onlineUsers']))
                    <span class="badge badge-success" title="Online">Online</span>
                @else
                    <span class="btn btn-danger btn-xs" title="Offline">Offline</span>
                @endif
                <br>
            @else
                @if (!empty($mikrotik_online_users) && is_array($mikrotik_online_users) && in_array($r->clients->userid ?? '', $mikrotik_online_users))
                    <span class="btn btn-success btn-xs">Online</span>
                @else
                    <span class="btn btn-danger btn-xs">Offline</span>
                @endif
            @endif
            @if (!empty($r->clients->clientsinfo->clients_name ?? null))
                C Name : {{ $r->clients->clientsinfo->clients_name ?? '' }} <br>
            @endif
            @if (!empty($r->clients->pops->reseller->name))
                R Name : {{ $r->clients->pops->reseller->name ?? '' }} <br>
            @endif
            @if (!empty($r->clients->clientsinfo->flat_no))
                Flat No: {{ $r->clients->clientsinfo->flat_no ?? '' }},
            @endif
            @if (!empty($r->clients->clientsinfo->building_name))
                Building Name: {{ $r->clients->clientsinfo->building_name ?? '' }},<br>
            @endif
            @if (!empty($r->clients->clientsinfo->road_no))
                Road No: {{ $r->clients->clientsinfo->road_no ?? '' }},<br>
            @endif
            @if (!empty($r->clients->clientsinfo->block_sector))
                Block/Sector: {{ $r->clients->clientsinfo->block_sector ?? '' }},
            @endif
            @if (!empty($r->clients->clientsinfo->area))
                Area : {{ $r->clients->clientsinfo->area ?? '' }}, <br>
            @endif
            @if (!empty($r->clients->clientsinfo->box))
                Box : {{ $r->clients->clientsinfo->box ?? '' }}
            @endif
        </p>
        @break
    @case('reporter_contact')
        {{ $r->reportedBy }} <br> {{ $r->reporterContact }}
        @break
    @case('assigned')
        {{ $r->employees->name ?? '' }}
        @break
    @case('token_type')
        {{ $r->token_type ?? '' }}
        @break
    @case('actions')
        <div class="dropdown">
            <button class="btn dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="ml-3 far fas fa-list nav-icon" style="font-size: 10px"></i>
            </button>
            <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                @can('close-token')
                    @if ($r->employees != null)
                        <button type="button" class="btn btn-info btn-small close_token_btn" data-toggle="modal" data-target="#closeTokenModel">Close Token</button>
                    @endif
                @endcan
                @can('assign-token')
                    @if ($r->employees == null)
                        <button type="button" class="btn btn-block btn-info btn-small assign_token_btn" data-toggle="modal" data-target="#assignTokenModel">Assign Token</button>
                    @else
                        <button type="button" class="btn btn-block btn-info btn-small re_assign_token_btn" data-toggle="modal" data-target="#reAssignTokenModel">Re-Assign Token</button>
                    @endif
                @endcan
                <button type="button" class="btn btn-block btn-info btn-small add_note" data-toggle="modal" data-target="#addNoteModel">Note</button>
            </div>
        </div>
        @break
    @default
        —
@endswitch
