@extends('layouts.app')
@section('title', __('portal::messages.review.title'))
@php
/*
| The filter actually in force.
|
| An empty status means pending — the controller's default, because this
| screen exists to be emptied. The cards and the dropdown both have to show
| that, or the page would open with nothing selected while plainly being
| filtered.
*/
$current = $filters['status'] !== '' ? $filters['status'] : 'pending';
// Keeps the patient scope on every link out of this screen.
$carry = fn (string $status): array => array_filter([
'status' => $status,
'patient' => $filters['patient'],
]);
@endphp
@section('content')
{{-- ── Page head ──────────────────────────────────────────────────────── --}}
{{ __('portal::messages.review.title') }}
{{-- Says whose queue this is. Reviewing the wrong patient's file is
the one mistake this screen can make, so the scope is stated in
the same breath as the title rather than left to a filter. --}}
@if ($filters['patient'] !== '')
{{ __('portal::messages.review.scoped', [
'patient' => $only?->name ?? __('portal::messages.review.unknown_patient'),
]) }}
@else
{{ __('portal::messages.review.subtitle') }}
@endif
@if ($filters['patient'] !== '')
{{ __('portal::messages.review.show_all') }}
@endif
{{-- ── Status: the filter and what it is filtering ────────────────────── --}}
{{--
The counts, and the filter said a second way.
Each card is a link to its own status rather than a decorative
figure: the number and the way to act on it are the same thing,
and a reviewer who sees "3 declined" wants to read those three.
Counts follow the patient scope above — cards counted over the
whole table beside a list showing one patient would disagree,
and the bigger numbers would be the half people believed.
--}}
@foreach ([
['status' => 'pending', 'tone' => 'violet', 'icon' => 'bi-clock-history', 'count' => $tally['pending'], 'label' => __('portal::messages.statuses.pending')],
['status' => 'accepted', 'tone' => 'green', 'icon' => 'bi-check-circle', 'count' => $tally['accepted'], 'label' => __('portal::messages.statuses.accepted')],
['status' => 'rejected', 'tone' => 'red', 'icon' => 'bi-x-circle', 'count' => $tally['rejected'], 'label' => __('portal::messages.statuses.rejected')],
['status' => 'all', 'tone' => 'blue', 'icon' => 'bi-file-earmark-text', 'count' => $tally['total'], 'label' => __('portal::messages.review.total')],
] as $card)
@endforeach
{{-- ── The queue ──────────────────────────────────────────────────────── --}}