@extends('layouts.app')
@section('title', $appointment->reference)
@php
use App\Modules\Appointments\Enums\AppointmentStatus;
/*
| The status enum names a Bootstrap contextual colour, because that is what
| it was written against and the calendar still reads it. Mapped here rather
| than renamed underneath everything that already uses it.
*/
$pill = static fn (string $bootstrapTone): string => match ($bootstrapTone) {
'success' => 'px-pill--green',
'warning' => 'px-pill--amber',
'danger' => 'px-pill--red',
'info' => 'px-pill--blue',
'primary' => 'px-pill--violet',
default => 'px-pill--grey',
};
/*
| A status change is either the ordinary next step or the one that ends the
| appointment badly. Cancelling and marking a no-show carry a reason and are
| not undone, so they get the danger treatment; everything else is the
| quiet default.
*/
$ending = [AppointmentStatus::Cancelled, AppointmentStatus::NoShow];
@endphp
@section('content')
{{-- ============================ IDENTITY ============================ --}}
{{ $patient?->name ?? __('appointments::messages.appointments.unknown_patient') }}
{{ $appointment->notes }}
{{ $appointment->status->label() }}
{{ __('appointments::messages.appointments.no_transitions') }}