@php $plan = $dentalPlan; $history = ($dentalPlanHistory ?? collect())->filter(fn ($p) => ! $plan || $p->id !== $plan->id); $canManage = $canConsult ?? false; @endphp

Treatment plan

@if ($plan) Status: {{ ucfirst(str_replace('_', ' ', $plan->status)) }} · Estimate {{ $currency ?? 'GHS' }} {{ number_format($plan->estimate_minor / 100, 2) }} @else Create a plan by adding the first item. @endif

@if ($canManage && $plan)
@if ($plan->status === 'draft')
@csrf
@endif @if (in_array($plan->status, ['draft', 'accepted'], true))
@csrf
@endif @if ($plan->status !== 'completed')
@csrf
@endif
@endif
@if ($canManage && (! $plan || ! in_array($plan->status, ['completed', 'rejected', 'cancelled'], true)))
@csrf

Add item

Surfaces

@foreach ($dentalSurfaces as $surface) @endforeach
@endif
@if ($history->isNotEmpty())

Plan history

@endif