
<?php 
    $reviewRequests = $performer->pro->activeClientReviewRequests;
?>
@if(!count($reviewRequests))
    <div class="mt-3 pl-2">
        <p>No client review requests found.</p>
    </div>
@else
<div class="table-responsive">
    <table class="table table-striped table-sm table-bordered">
        <thead class="bg-light">
            <tr>
                <th class="border-0 text-secondary text-nowrap">Created</th>
                <th class="border-0 text-secondary">Patient</th>
                <th class="border-0 text-secondary">Scoped Month Start</th>
                <th class="border-0 text-secondary">Access Start</th>
                <th class="border-0 text-secondary">Access End</th>                
                <th class="border-0 text-secondary">Is Active</th>
                <th class="border-0 text-secondary">Status</th>
            </tr>
        </thead>
        <tbody>
            @foreach($reviewRequests as $rr)
            <tr>
                <td class="text-nowrap">{{ friendlier_date($rr->created_at) }}</td>
                <td>
                <a native target="_blank" href="{{route('patients.view.dashboard', $rr->client)}}">
						{{$rr->client->displayName()}}
					</a>
                </td>
                <td>{{ friendlier_date($rr->scoped_month_start_date) }}</td>
                <td>{{ friendlier_date($rr->access_start_date) }}</td>
                <td>{{ friendlier_date($rr->access_end_date) }}</td>                
                <td>
                    @if($rr->is_active)
                    <span class="text-success mr-2">YES
                        @if($rr->reactivation_memo)
                        <i class="fas fa-info-circle text-muted" title="{{ $rr->reactivation_memo }}"></i>
                        @endif
                    </span>
                    @else
                    <span class="text-secondary mr-2">NO
                        @if($rr->deactivation_memo)
                        <i class="fas fa-info-circle text-muted" title="{{ $rr->deactivation_memo }}"></i>
                        @endif
                    </span>
                    @endif
                </td>
                <td>
                    <span class="mr-2">{{ $rr->status ?? '--' }}
                        @if($rr->status_memo )
                        <i class="fas fa-info-circle text-muted" title="{{ $rr->status_memo }}"></i>
                        @endif
                    </span>
                </td>
            </tr>
            @endforeach
        </tbody>
    </table>
</div>
@endif