<div class="d-flex align-items-end mb-3">
    <b class="large">Incoming Reports not signed</b>
</div>
<table class="table table-striped table-sm table-bordered mb-0">
    <thead>
    <tr>
        <th class="px-2 text-secondary">Created</th>
        <th class="px-2 text-secondary">Patient</th>
        <th class="px-2 text-secondary">Pro</th>
        <th class="px-2 text-secondary">Report Date</th>
        <th class="px-2 text-secondary">Report</th>
        <th class="px-2 text-secondary">Title</th>
        <th class="px-2 text-secondary">Category</th>
        <th class="px-2 text-secondary">Memo</th>
    </tr>
    </thead>
    <tbody>
    @foreach($incomingReports as $document)
        <tr class="{{$document->is_entry_error ? 'entry-error' : ''}}">
            <td class="px-2 text-nowrap">
                <a href="/patients/view/{{$document->patient->uid}}/incoming-reports/{{$document->uid}}">
                    <i class="fa fa-arrow-right"></i>
                    {{friendlier_date_time($document->created_at)}}
                </a>
            </td>
            <td class="px-2 text-nowrap">
                <a href="/patients/view/{{$document->patient->uid}}/tickets/erx">
                    {{$document->patient->displayName()}}
                </a>
            </td>
            <td class="px-2">
                {{$document->hcp ? $document->hcp->displayName() : '-'}}
            </td>
            <td class="px-2">{{ friendly_date_time($document->report_date, false) }}</td>
            <td class="px-2">
                <div class="d-flex align-items-center">
                    <a class="pdf-viewer-trigger" native target="_blank"
                       href="/api/incomingReport/download/{{ $document->uid }}"
                       title="View">View</a>
                    @if($document->is_entry_error)
                        <span class="ml-auto text-danger on-hover-opaque" title="Entry Error">
                            <i class="fa fa-exclamation-triangle"></i>
                        </span>
                    @endif
                </div>
            </td>
            <td class="px-2">{{ $document->title }}</td>
            <td class="px-2">{{ $document->category }}{{ $document->subcategory ? ' / ' . $document->subcategory : '' }}</td>
            <td class="px-2">{{ $document->memo }}</td>
        </tr>
    @endforeach
    </tbody>
</table>