<div class="p-3 mcp-theme-1">
    <div class="card">

        <div class="card-header px-2 py-1 hide-inside-popup border-bottom-0">
            <strong class="mr-4">
                <i class="fas fa-file-signature"></i>
                Reports Pending Signature
            </strong>
        </div>

        <div class="card-body p-0 border-top-0 pb-0">


            <table class="table table-sm table-striped mb-0">
                <thead class="bg-light">
                <tr>
                    <th class="border-0">Patient</th>
                    <th class="border-0">Title</th>
                    <th class="border-0">Category</th>
                    <th class="border-0">Report Date</th>
                    <th class="border-0">Sign</th>
                </tr>
                </thead>
                <tbody>
                @foreach($records as $document)
                    <tr class="{{$document->is_entry_error ? 'entry-error' : ''}} {{@$currentReport->uid === $document->uid ? 'bg-aliceblue' : ''}}">
                        <td>{{$document->client->displayName()}}</td>
                        <td>
                            <a native target="_blank" href="{{route('patients.view.incoming-reports', ['patient' => $document->client, 'currentReport' => $document])}}">
                                {{ $document->title ? $document->title : '(not set)' }}
                            </a>
                        </td>
                        <td>{{ $document->category }}{{ $document->subcategory ? ' / ' . $document->subcategory : '' }}</td>
                        <td>{{ friendly_date_time($document->report_date, false) }}</td>
                        <td>
                            @if(!$document->has_hcp_pro_signed)
                                -
                            @else
                                <div class="text-success mb-1">
                                    <i class="fa fa-check"></i>
                                    Signed
                                </div>
                                @if($document->hcp)
                                    <div class="text-secondary">
                                        <div class="text-sm">{{$document->hcp->displayName()}}</div>
                                        <div class="text-sm">{{friendlier_date_time($document->hcp_pro_signed_at)}}</div>
                                    </div>
                                @endif
                            @endif
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
    </div>
</div>
