<div class="p-3">
    @php
    $encountersPendingMyReview = $performer->pro->encountersPendingMyReviewRecordsAsRd();
    @endphp
    <div class="card">
        <div class="card-body p-0">
        @if($encountersPendingMyReview && count($encountersPendingMyReview))
        <div class="table-responsive">
            <table class="table table-sm table-striped mb-0">
                <thead class="bg-light">
                    <tr>
                        <th class="border-0">Chart#</th>
                        <th class="border-0">Patient</th>
                        <th class="border-0">Encounter</th>
                        <th class="border-0">DOB</th>
                        <th class="border-0">Gender</th>
                        <th class="border-0">Coverage</th>
                        <th class="border-0">MCP</th>
                        <th class="border-0">Date</th>
                        <th class="border-0"></th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($encountersPendingMyReview as $row)
                    <tr>
                        <td class="text-nowrap">
                            {{$row->client->chart_number}}
                        </td>
                        <td>
                            <a native target="_blank" href="{{ route('patients.view.dashboard', $row->client) }}">
                                {{$row->client->displayName()}}
                            </a>
                        </td>
                        <td>
                            <a native target="_blank" href="{{ route('patients.view.notes.view.dashboard', ['patient' => $row->client, 'note' => $row]) }}">
                                {{friendly_date($row->effective_dateest)}}
                            </a>
                        </td>
                        <td class="text-nowrap">
                            {{friendly_date($row->client->dob)}}
                        </td>
                        <td class="text-nowrap">
                            {{$row->client->sex}}
                        </td>
                        <td class="text-nowrap">
                            @include('app.patient.coverage_column_renderer', ['patient'=>$row->client])
                        </td>
                        <td class="text-nowrap">
                            {{$row->hcpPro->displayName()}}
                        </td>
                        <td class="text-nowrap">
                            {{friendly_date($row->effective_dateest)}}
                        </td>
                        <td>
                            @if(!$row->is_signed_by_ally)
                            <div moe relative class="ml-auto">
                                <form show url="/api/note/signAsAlly">
                                    <input type="hidden" name="uid" value="{{ $row->uid }}">
                                    <button submit class="bg-transparent border-0 p-0 text-primary">Ack.</button>
                                </form>
                            </div>
                            @else
                            <div moe relative class="ml-auto">
                                <form show url="/api/note/undoSignAsAlly">
                                    <input type="hidden" name="uid" value="{{ $row->uid }}">
                                    <button submit class="bg-transparent border-0 p-0 text-primary">Ack.</button>
                                </form>
                            </div>    
                            @endif
                        </td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
        @if($encountersPendingMyReview->hasPages())
            <div class="m-2">
                {{ $encountersPendingMyReview->onEachSide(0)->withQueryString()->links() }}
            </div>
        @endif
        @else
        <div class="p-3">
            No encounters pending review
        </div>
        @endif
        </div>
    </div>
</div>