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

        <div class="card-header px-2 py-1 hide-inside-popup border-bottom-0">
            <strong class="mr-4">
                <i class="fas fa-sticky-note"></i>
                Notes With Pending Summary Suggestion
            </strong>
        </div>

        <div class="card-body p-0 border-top-0 pb-0">
            <table class="table table-sm border-top table-striped mb-0">
                <thead class="bg-light">
                <tr>
                    <th class="border-0">Date</th>
                    <th class="border-0">Patient</th>
                    <th class="border-0">ICD</th>
                    <th class="border-0">Status</th>
                    <th class="border-0">Suggestions</th>
                </tr>
                </thead>
                <tbody>
                @foreach($records as $row)
                    <tr>
                        <td>
                            <a native target="_blank" href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on">
                                {{ friendlier_date($row->effective_dateest) }}
                            </a>
                        </td>
                        <td>{{$row->client->displayName()}}</td>
                        <td>
                            @foreach($row->reasons() as $reason)
                                <span class="pr-2">{{$reason->code}}</span>
                            @endforeach
                            @if(!$row->reasons() || !count($row->reasons()))
                                -
                            @endif
                        </td>
                        <td>
                            {{$row->overallStatus()}}
                        </td>
                        <td class="p-0">
                            @php $segments = $row->segmentsWithPendingSummarySuggestion; @endphp
                            <table class="table table-sm m-0">
                                @foreach($segments as $segment)
                                    <tr>
                                        <td class="width-100px">
                                            <div class="d-flex align-items-baseline grow-till-300px">
                                                <span>{{$segment->display_title}}</span>
                                                <div class="on-hover-show left on-hover-opaque">
                                                    <i class="fa fa-info-circle ml-1"></i>
                                                    <div class="on-hover-content p-2 text-sm">
                                                        <div class="d-flex align-items-start border p-1 mb-2">
                                                            <span class="mr-1 width-70px">Original:</span>
                                                            <div class="bg-light inline-html-container max-height-100px max-width-300px overflow-hidden">
                                                                {!! $segment->summary_html !!}
                                                            </div>
                                                        </div>
                                                        <div class="d-flex align-items-start border p-1">
                                                            <span class="mr-1 width-70px">Suggested:</span>
                                                            <div class="bg-light inline-html-container max-height-100px max-width-300px overflow-hidden">
                                                                {!! $segment->proposedSegmentSummarySuggestion->summary_html !!}
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </td>
                                        <td>{{$segment->proposedSegmentSummarySuggestion->creator->displayName()}}</td>
                                        <td>{{friendlier_date($segment->proposedSegmentSummarySuggestion->created_at)}}</td>
                                    </tr>
                                @endforeach
                            </table>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
    </div>
</div>
